Datasets:
question_id
int64 1
75.7k
| db_id
stringclasses 33
values | db_name
stringclasses 4
values | question
stringlengths 19
259
| partition
stringclasses 4
values | difficulty
stringclasses 3
values | SQL
stringlengths 25
862
|
|---|---|---|---|---|---|---|
1
|
financial
|
bird
|
How many accounts who choose issuance after transaction are staying in East Bohemia region?
|
dev
|
medium
|
SELECT COUNT(t2.account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id WHERE t1.a3 = 'east bohemia' AND t2.frequency = 'poplatek po obratu'
|
2
|
financial
|
bird
|
How many accounts who have region in Prague are eligible for loans?
|
dev
|
easy
|
SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN loan AS t2 ON t1.account_id = t2.account_id INNER JOIN district AS t3 ON t1.district_id = t3.district_id WHERE t3.a3 = 'prague'
|
3
|
financial
|
bird
|
The average unemployment ratio of 1995 and 1996, which one has higher percentage?
|
dev
|
easy
|
SELECT DISTINCT IIF(AVG(a13) > AVG(a12), '1996', '1995') FROM district
|
4
|
financial
|
bird
|
List out the no. of districts that have female average salary is more than 6000 but less than 10000?
|
dev
|
easy
|
SELECT COUNT(DISTINCT t2.district_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'f' AND t2.a11 BETWEEN 6000 AND 10000
|
5
|
financial
|
bird
|
How many male customers who are living in North Bohemia have average salary greater than 8000?
|
dev
|
medium
|
SELECT COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'm' AND t2.a3 = 'north bohemia' AND t2.a11 > 8000
|
6
|
financial
|
bird
|
List out the account numbers of female clients who are oldest and has lowest average salary, calculate the gap between this lowest average salary with the highest average salary?
|
dev
|
hard
|
SELECT t1.account_id, (SELECT MAX(a11) - MIN(a11) FROM district) FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN disp AS t3 ON t1.account_id = t3.account_id INNER JOIN client AS t4 ON t3.client_id = t4.client_id WHERE t2.district_id = (SELECT district_id FROM client WHERE gender = 'f' ORDER BY birth_date ASC LIMIT 1) ORDER BY t2.a11 DESC LIMIT 1
|
7
|
financial
|
bird
|
List out the account numbers of clients who are youngest and have highest average salary?
|
dev
|
medium
|
SELECT t1.account_id FROM account AS t1 INNER JOIN disp AS t2 ON t1.account_id = t2.account_id INNER JOIN client AS t3 ON t2.client_id = t3.client_id INNER JOIN district AS t4 ON t4.district_id = t1.district_id WHERE t2.client_id = (SELECT client_id FROM client ORDER BY birth_date DESC LIMIT 1) GROUP BY t4.a11, t1.account_id
|
8
|
financial
|
bird
|
How many customers who choose statement of weekly issuance are Owner?
|
dev
|
easy
|
SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN disp AS t2 ON t1.account_id = t2.account_id WHERE t2.type = 'owner' AND t1.frequency = 'poplatek tydne'
|
9
|
financial
|
bird
|
List out the id number of client who choose statement of issuance after transaction are Disponent?
|
dev
|
easy
|
SELECT t2.client_id FROM account AS t1 INNER JOIN disp AS t2 ON t1.account_id = t2.account_id WHERE t1.frequency = 'poplatek po obratu' AND t2.type = 'disponent'
|
10
|
financial
|
bird
|
Among the accounts who have approved loan date in 1997, list out the accounts that have the lowest approved amount and choose weekly issuance statement.
|
dev
|
medium
|
SELECT t2.account_id FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE STRFTIME('%y', t1.date) = '1997' AND t2.frequency = 'poplatek tydne' ORDER BY t1.amount LIMIT 1
|
11
|
financial
|
bird
|
Among the accounts who have loan validity more than 12 months, list out the accounts that have the highest approved amount and have account opening date in 1993.
|
dev
|
medium
|
SELECT t1.account_id FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE STRFTIME('%y', t2.date) = '1993' AND t1.duration > 12 ORDER BY t1.amount DESC LIMIT 1
|
12
|
financial
|
bird
|
Among the account opened, how many female customers who were born before 1950 and stayed in Sokolov?
|
dev
|
medium
|
SELECT COUNT(t2.client_id) FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id WHERE t2.gender = 'f' AND STRFTIME('%y', t2.birth_date) < '1950' AND t1.a2 = 'sokolov'
|
13
|
financial
|
bird
|
List out the accounts who have the earliest trading date in 1995 ?
|
dev
|
easy
|
SELECT account_id FROM trans WHERE STRFTIME('%y', date) = '1995' ORDER BY date ASC LIMIT 1
|
14
|
financial
|
bird
|
State different accounts who have account opening date before 1997 and own an amount of money greater than 3000USD
|
dev
|
easy
|
SELECT DISTINCT t2.account_id FROM trans AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE STRFTIME('%y', t2.date) < '1997' AND t1.amount > 3000
|
15
|
financial
|
bird
|
Which client issued his/her card in 1994/3/3, give his/her client id.
|
dev
|
easy
|
SELECT t2.client_id FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN card AS t3 ON t2.disp_id = t3.disp_id WHERE t3.issued = '1994-03-03'
|
16
|
financial
|
bird
|
The transaction of 840 USD happened in 1998/10/14, when was this account opened?
|
dev
|
easy
|
SELECT t1.date FROM account AS t1 INNER JOIN trans AS t2 ON t1.account_id = t2.account_id WHERE t2.amount = 840 AND t2.date = '1998-10-14'
|
17
|
financial
|
bird
|
There was a loan approved in 1994/8/25, where was that account opened, give the district Id of the branch.
|
dev
|
easy
|
SELECT t1.district_id FROM account AS t1 INNER JOIN loan AS t2 ON t1.account_id = t2.account_id WHERE t2.date = '1994-08-25'
|
18
|
financial
|
bird
|
What is the biggest amount of transaction that the client whose card was opened in 1996/10/21 made?
|
dev
|
easy
|
SELECT t4.amount FROM card AS t1 JOIN disp AS t2 ON t1.disp_id = t2.disp_id JOIN account AS t3 ON t2.account_id = t3.account_id JOIN trans AS t4 ON t3.account_id = t4.account_id WHERE t1.issued = '1996-10-21' ORDER BY t4.amount DESC LIMIT 1
|
19
|
financial
|
bird
|
What is the gender of the oldest client who opened his/her account in the highest average salary branch?
|
dev
|
easy
|
SELECT t2.gender FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id ORDER BY t1.a11 DESC, t2.birth_date ASC LIMIT 1
|
20
|
financial
|
bird
|
For the client who applied the biggest loan, what was his/her first amount of transaction after opened the account?
|
dev
|
easy
|
SELECT t3.amount FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id ORDER BY t1.amount DESC, t3.date ASC LIMIT 1
|
21
|
financial
|
bird
|
How many clients opened their accounts in Jesenik branch were women?
|
dev
|
easy
|
SELECT COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'f' AND t2.a2 = 'jesenik'
|
22
|
financial
|
bird
|
What is the disposition id of the client who made 5100 USD transaction in 1998/9/2?
|
dev
|
easy
|
SELECT t1.disp_id FROM disp AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id WHERE t3.date = '1997-08-20' AND t3.amount = 5100
|
23
|
financial
|
bird
|
How many accounts were opened in Litomerice in 1996?
|
dev
|
easy
|
SELECT COUNT(t2.account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id WHERE STRFTIME('%y', t2.date) = '1996' AND t1.a2 = 'litomerice'
|
24
|
financial
|
bird
|
For the female client who was born in 1976/1/29, which district did she opened her account?
|
dev
|
easy
|
SELECT t1.a2 FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id WHERE t2.birth_date = '1976-01-29' AND t2.gender = 'f'
|
25
|
financial
|
bird
|
For the client who applied 98832 USD loan in 1996/1/3, when was his/her birthday?
|
dev
|
easy
|
SELECT t4.birth_date FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN disp AS t3 ON t2.account_id = t3.account_id INNER JOIN client AS t4 ON t3.client_id = t4.client_id WHERE t1.date = '1996-01-03' AND t1.amount = 98832
|
26
|
financial
|
bird
|
For the first client who opened his/her account in Prague, what is his/her account ID?
|
dev
|
easy
|
SELECT t1.account_id FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t2.a3 = 'prague' ORDER BY t1.date ASC LIMIT 1
|
27
|
financial
|
bird
|
For the branch which located in the south Bohemia with biggest number of inhabitants, what is the percentage of the male clients?
|
dev
|
hard
|
SELECT CAST(CAST(SUM(t1.gender = 'm') AS REAL) * 100 AS REAL) / COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t2.a3 = 'south bohemia' GROUP BY t2.a4 ORDER BY t2.a4 DESC LIMIT 1
|
28
|
financial
|
bird
|
For the client whose loan was approved first in 1993/7/5, what is the increase rate of his/her account balance from 1993/3/22 to 1998/12/27?
|
dev
|
hard
|
SELECT CAST(CAST((SUM(IIF(t3.date = '1998-12-27', t3.balance, 0)) - SUM(IIF(t3.date = '1993-03-22', t3.balance, 0))) AS REAL) * 100 AS REAL) / SUM(IIF(t3.date = '1993-03-22', t3.balance, 0)) FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN trans AS t3 ON t3.account_id = t2.account_id WHERE t1.date = '1993-07-05'
|
29
|
financial
|
bird
|
What is the percentage of loan amount that has been fully paid with no issue.
|
dev
|
medium
|
SELECT CAST((CAST(SUM(CASE WHEN status = 'a' THEN amount ELSE 0 END) AS REAL) * 100) AS REAL) / SUM(amount) FROM loan
|
30
|
financial
|
bird
|
For loan amount less than USD100,000, what is the percentage of accounts that is still running with no issue.
|
dev
|
medium
|
SELECT CAST(CAST(SUM(status = 'c') AS REAL) * 100 AS REAL) / COUNT(account_id) FROM loan WHERE amount < 100000
|
31
|
financial
|
bird
|
For accounts in 1993 with statement issued after transaction, list the account ID, district name and district region.
|
dev
|
medium
|
SELECT t1.account_id, t2.a2, t2.a3 FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.frequency = 'poplatek po obratu' AND STRFTIME('%y', t1.date) = '1993'
|
32
|
financial
|
bird
|
From Year 1995 to 2000, who are the accounts holders from 'east Bohemia'. State the account ID the frequency of statement issuance.
|
dev
|
medium
|
SELECT t1.account_id, t1.frequency FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t2.a3 = 'east bohemia' AND STRFTIME('%y', t1.date) BETWEEN '1995' AND '2000'
|
33
|
financial
|
bird
|
List account ID and account opening date for accounts from 'Prachatice'.
|
dev
|
easy
|
SELECT t1.account_id, t1.date FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t2.a2 = 'prachatice'
|
34
|
financial
|
bird
|
State the district and region for loan ID '4990'.
|
dev
|
easy
|
SELECT t2.a2, t2.a3 FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN loan AS t3 ON t1.account_id = t3.account_id WHERE t3.loan_id = 4990
|
35
|
financial
|
bird
|
Provide the account ID, district and region for loan amount greater than USD300,000.
|
dev
|
easy
|
SELECT t1.account_id, t2.a2, t2.a3 FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN loan AS t3 ON t1.account_id = t3.account_id WHERE t3.amount > 300000
|
36
|
financial
|
bird
|
List the loan ID, district and average salary for loan with duration of 60 months.
|
dev
|
easy
|
SELECT t3.loan_id, t2.a2, t2.a11 FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN loan AS t3 ON t1.account_id = t3.account_id WHERE t3.duration = 60
|
37
|
financial
|
bird
|
For loans contracts which are still running where client are in debt, list the district of the and the state the percentage unemployment rate increment from year 1995 to 1996.
|
dev
|
hard
|
SELECT CAST(CAST((t3.a13 - t3.a12) AS REAL) * 100 AS REAL) / t3.a12 FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.status = 'd'
|
38
|
financial
|
bird
|
Calculate the percentage of account from 'Decin' district for all accounts are opened in 1993.
|
dev
|
easy
|
SELECT CAST(CAST(SUM(t1.a2 = 'decin') AS REAL) * 100 AS REAL) / COUNT(account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id WHERE STRFTIME('%y', t2.date) = '1993'
|
39
|
financial
|
bird
|
List the account IDs with monthly issuance of statements.
|
dev
|
easy
|
SELECT account_id FROM account WHERE frequency = 'poplatek mesicne'
|
40
|
financial
|
bird
|
List the top nine districts, by descending order, from the highest to the lowest, the number of female account holders.
|
dev
|
medium
|
SELECT t2.a2, COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'f' GROUP BY t2.district_id, t2.a2 ORDER BY COUNT(t1.client_id) DESC LIMIT 9
|
41
|
financial
|
bird
|
Which are the top ten withdrawals (non-credit card) by district names for the month of January 1996?
|
dev
|
medium
|
SELECT DISTINCT t1.a2 FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id WHERE t3.type = 'vydaj' AND t3.date LIKE '1996-01%' ORDER BY a2 ASC LIMIT 10
|
42
|
financial
|
bird
|
How many of the account holders in South Bohemia still do not own credit cards?
|
dev
|
medium
|
SELECT COUNT(t3.account_id) FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id INNER JOIN disp AS t3 ON t2.client_id = t3.client_id WHERE t1.a3 = 'south bohemia' AND t3.type <> 'owner'
|
43
|
financial
|
bird
|
Which district has highest active loan?
|
dev
|
medium
|
SELECT t2.a3 FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN loan AS t3 ON t1.account_id = t3.account_id WHERE t3.status IN ('c', 'd') GROUP BY t2.a3 ORDER BY SUM(t3.amount) DESC LIMIT 1
|
44
|
financial
|
bird
|
What is the average loan amount by male borrowers?
|
dev
|
easy
|
SELECT AVG(t4.amount) FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN account AS t3 ON t2.account_id = t3.account_id INNER JOIN loan AS t4 ON t3.account_id = t4.account_id WHERE t1.gender = 'm'
|
45
|
financial
|
bird
|
In 1996, which districts have the highest unemployment rate? List their branch location and district name.
|
dev
|
easy
|
SELECT district_id, a2 FROM district ORDER BY a13 DESC LIMIT 1
|
46
|
financial
|
bird
|
In the branch where the largest number of crimes were committed in 1996, how many accounts were opened?
|
dev
|
easy
|
SELECT COUNT(t2.account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id GROUP BY t1.a16 ORDER BY t1.a16 DESC LIMIT 1
|
47
|
financial
|
bird
|
After making a credit card withdrawal, how many account/s with monthly issuance has a negative balance?
|
dev
|
medium
|
SELECT COUNT(t1.account_id) FROM trans AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE t1.balance < 0 AND t1.operation = 'vyber kartou' AND t2.frequency = 'poplatek mesicne'
|
48
|
financial
|
bird
|
Between 1/1/1995 and 12/31/1997, how many loans in the amount of at least 250,000 per account that chose monthly statement issuance were approved?
|
dev
|
medium
|
SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN loan AS t2 ON t1.account_id = t2.account_id WHERE t2.date BETWEEN '1995-01-01' AND '1997-12-31' AND t1.frequency = 'poplatek mesicne' AND t2.amount >= 250000
|
49
|
financial
|
bird
|
How many accounts have running contracts in Branch location 1?
|
dev
|
medium
|
SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN loan AS t3 ON t1.account_id = t3.account_id WHERE t1.district_id = 1 AND (t3.status = 'c' OR t3.status = 'd')
|
50
|
financial
|
bird
|
In the branch where the second-highest number of crimes were committed in 1995 occurred, how many male clients are there?
|
dev
|
medium
|
SELECT COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'm' AND t2.a15 = (SELECT t3.a15 FROM district AS t3 ORDER BY t3.a15 DESC LIMIT 1 OFFSET 1)
|
51
|
financial
|
bird
|
How many high-level credit cards have "OWNER" type of disposition?
|
dev
|
easy
|
SELECT COUNT(t1.card_id) FROM card AS t1 INNER JOIN disp AS t2 ON t1.disp_id = t2.disp_id WHERE t1.type = 'gold' AND t2.type = 'owner'
|
52
|
financial
|
bird
|
How many accounts are there in the district of "Pisek"?
|
dev
|
easy
|
SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t2.a2 = 'pisek'
|
53
|
financial
|
bird
|
Which districts have transactions greater than USS$10,000 in 1997?
|
dev
|
easy
|
SELECT t1.district_id FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN trans AS t3 ON t1.account_id = t3.account_id WHERE STRFTIME('%y', t3.date) = '1997' GROUP BY t1.district_id HAVING SUM(t3.amount) > 10000
|
54
|
financial
|
bird
|
Which accounts placed orders for household payment in Pisek?
|
dev
|
easy
|
SELECT DISTINCT t2.account_id FROM trans AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.k_symbol = 'sipo' AND t3.a2 = 'pisek'
|
55
|
financial
|
bird
|
What are the accounts that have gold credit cards?
|
dev
|
easy
|
SELECT t2.account_id FROM disp AS t2 INNER JOIN card AS t1 ON t1.disp_id = t2.disp_id WHERE t1.type = 'gold'
|
56
|
financial
|
bird
|
How much is the average amount in credit card made by account holders in a month, in year 2021?
|
dev
|
medium
|
SELECT AVG(t4.amount) FROM card AS t1 INNER JOIN disp AS t2 ON t1.disp_id = t2.disp_id INNER JOIN account AS t3 ON t2.account_id = t3.account_id INNER JOIN trans AS t4 ON t3.account_id = t4.account_id WHERE STRFTIME('%y', t4.date) = '1998' AND t4.operation = 'vyber kartou'
|
57
|
financial
|
bird
|
Who are the account holder identification numbers whose who have transactions on the credit card with the amount is less than the average, in 1998?
|
dev
|
medium
|
SELECT t1.account_id FROM trans AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE STRFTIME('%y', t1.date) = '1998' AND t1.operation = 'vyber kartou' AND t1.amount < (SELECT AVG(amount) FROM trans WHERE STRFTIME('%y', date) = '1998')
|
58
|
financial
|
bird
|
Who are the female account holders who own credit cards and also have loans?
|
dev
|
easy
|
SELECT t1.client_id FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN account AS t5 ON t2.account_id = t5.account_id INNER JOIN loan AS t3 ON t5.account_id = t3.account_id INNER JOIN card AS t4 ON t2.disp_id = t4.disp_id WHERE t1.gender = 'f'
|
59
|
financial
|
bird
|
How many female clients' accounts are in the region of South Bohemia?
|
dev
|
easy
|
SELECT COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'f' AND t2.a3 = 'south bohemia'
|
60
|
financial
|
bird
|
Please list the accounts whose district is Tabor that are eligible for loans.
|
dev
|
medium
|
SELECT t2.account_id FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN disp AS t3 ON t2.account_id = t3.account_id WHERE t3.type = 'owner' AND t1.a2 = 'tabor'
|
61
|
financial
|
bird
|
Please list the account types that are not eligible for loans, and the average income of residents in the district where the account is located exceeds $8000 but is no more than $9000.
|
dev
|
hard
|
SELECT t3.type FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN disp AS t3 ON t2.account_id = t3.account_id WHERE t3.type <> 'owner' AND t1.a11 BETWEEN 8000 AND 9000
|
62
|
financial
|
bird
|
How many accounts in North Bohemia has made a transaction with the partner's bank being AB?
|
dev
|
medium
|
SELECT COUNT(t2.account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id WHERE t3.bank = 'ab' AND t1.a3 = 'north bohemia'
|
63
|
financial
|
bird
|
Please list the name of the districts with accounts that made withdrawal transactions.
|
dev
|
medium
|
SELECT DISTINCT t1.a2 FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id WHERE t3.type = 'vydaj'
|
64
|
financial
|
bird
|
What is the average number of crimes committed in 1995 in regions where the number exceeds 4000 and the region has accounts that are opened starting from the year 1997?
|
dev
|
medium
|
SELECT AVG(t1.a15) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id WHERE STRFTIME('%y', t2.date) >= '1997' AND t1.a15 > 4000
|
65
|
financial
|
bird
|
How many 'classic' cards are eligible for loan?
|
dev
|
easy
|
SELECT COUNT(t1.card_id) FROM card AS t1 INNER JOIN disp AS t2 ON t1.disp_id = t2.disp_id WHERE t1.type = 'classic' AND t2.type = 'owner'
|
66
|
financial
|
bird
|
How many male clients in 'Hl.m. Praha' district?
|
dev
|
easy
|
SELECT COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE t1.gender = 'm' AND t2.a2 = 'hl.m. praha'
|
67
|
financial
|
bird
|
How many percent of 'Gold' cards were issued prior to 1998?
|
dev
|
easy
|
SELECT CAST(CAST(SUM(type = 'gold' AND STRFTIME('%y', issued) < '1998') AS REAL) * 100 AS REAL) / COUNT(card_id) FROM card
|
68
|
financial
|
bird
|
Who is the owner of the account with the largest loan amount?
|
dev
|
easy
|
SELECT t1.client_id FROM disp AS t1 INNER JOIN account AS t3 ON t1.account_id = t3.account_id INNER JOIN loan AS t2 ON t3.account_id = t2.account_id WHERE t1.type = 'owner' ORDER BY t2.amount DESC LIMIT 1
|
69
|
financial
|
bird
|
What is the number of committed crimes in 1995 in the district of the account with the id 532?
|
dev
|
easy
|
select t1.a15 from district as t1 inner join `account` as t2 on t1.district_id = t2.district_id where t2.account_id = 532
|
70
|
financial
|
bird
|
What is the district Id of the account that placed the order with the id 33333?
|
dev
|
easy
|
select t3.district_id from `order` as t1 inner join account as t2 on t1.account_id = t2.account_id inner join district as t3 on t2.district_id = t3.district_id where t1.order_id = 33333
|
71
|
financial
|
bird
|
List all the withdrawals in cash transactions that the client with the id 3356 makes.
|
dev
|
easy
|
SELECT t4.trans_id FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN account AS t3 ON t2.account_id = t3.account_id INNER JOIN trans AS t4 ON t3.account_id = t4.account_id WHERE t1.client_id = 3356 AND t4.operation = 'vyber'
|
72
|
financial
|
bird
|
Among the weekly issuance accounts, how many have a loan of under 200000?
|
dev
|
easy
|
SELECT COUNT(t1.account_id) FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE t2.frequency = 'poplatek tydne' AND t1.amount < 200000
|
73
|
financial
|
bird
|
What type of credit card does the client with the id 13539 own?
|
dev
|
easy
|
SELECT t3.type FROM disp AS t1 INNER JOIN client AS t2 ON t1.client_id = t2.client_id INNER JOIN card AS t3 ON t1.disp_id = t3.disp_id WHERE t2.client_id = 13539
|
74
|
financial
|
bird
|
What is the region of the client with the id 3541 from?
|
dev
|
easy
|
SELECT t1.a3 FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id WHERE t2.client_id = 3541
|
75
|
financial
|
bird
|
Which district has the most accounts with loan contracts finished with no problems?
|
dev
|
medium
|
SELECT t1.a2 FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN loan AS t3 ON t2.account_id = t3.account_id WHERE t3.status = 'a' GROUP BY t1.district_id ORDER BY COUNT(t2.account_id) DESC LIMIT 1
|
76
|
financial
|
bird
|
Who placed the order with the id 32423?
|
dev
|
easy
|
select t3.client_id from `order` as t1 inner join account as t2 on t1.account_id = t2.account_id inner join disp as t4 on t4.account_id = t2.account_id inner join client as t3 on t4.client_id = t3.client_id where t1.order_id = 32423
|
77
|
financial
|
bird
|
Please list all the transactions made by accounts from district 5.
|
dev
|
easy
|
SELECT t3.trans_id FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id WHERE t1.district_id = 5
|
78
|
financial
|
bird
|
How many of the accounts are from Jesenik district?
|
dev
|
easy
|
SELECT COUNT(t2.account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id WHERE t1.a2 = 'jesenik'
|
79
|
financial
|
bird
|
List all the clients' IDs whose junior credit cards were issued after 1996.
|
dev
|
easy
|
SELECT t2.client_id FROM card AS t1 INNER JOIN disp AS t2 ON t1.disp_id = t2.disp_id WHERE t1.type = 'junior' AND t1.issued >= '1997-01-01'
|
80
|
financial
|
bird
|
What percentage of clients who opened their accounts in the district with an average salary of over 10000 are women?
|
dev
|
medium
|
SELECT CAST(CAST(SUM(t2.gender = 'f') AS REAL) * 100 AS REAL) / COUNT(t2.client_id) FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id WHERE t1.a11 > 10000
|
81
|
financial
|
bird
|
What was the growth rate of the total amount of loans across all accounts for a male client between 1996 and 1997?
|
dev
|
hard
|
SELECT CAST(CAST((SUM(CASE WHEN STRFTIME('%y', t1.date) = '1997' THEN t1.amount ELSE 0 END) - SUM(CASE WHEN STRFTIME('%y', t1.date) = '1996' THEN t1.amount ELSE 0 END)) AS REAL) * 100 AS REAL) / SUM(CASE WHEN STRFTIME('%y', t1.date) = '1996' THEN t1.amount ELSE 0 END) FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN disp AS t3 ON t3.account_id = t2.account_id INNER JOIN client AS t4 ON t4.client_id = t3.client_id WHERE t4.gender = 'm' AND t3.type = 'owner'
|
82
|
financial
|
bird
|
How many credit card withdrawals were recorded after 1995?
|
dev
|
easy
|
SELECT COUNT(account_id) FROM trans WHERE STRFTIME('%y', date) > '1995' AND operation = 'vyber kartou'
|
83
|
financial
|
bird
|
What was the difference in the number of crimes committed in East and North Bohemia in 1996?
|
dev
|
medium
|
SELECT SUM(IIF(a3 = 'east bohemia', a16, 0)) - SUM(IIF(a3 = 'north bohemia', a16, 0)) FROM district
|
84
|
financial
|
bird
|
How many owner and disponent dispositions are there from account number 1 to account number 10?
|
dev
|
easy
|
SELECT SUM(type = 'owner'), SUM(type = 'disponent') FROM disp WHERE account_id BETWEEN 1 AND 10
|
85
|
financial
|
bird
|
How often does account number 3 request an account statement to be released? What was the aim of debiting 3539 in total?
|
dev
|
hard
|
select t1.frequency, t2.k_symbol from account as t1 inner join (select account_id, k_symbol, sum(amount) as total_amount from `order` group by account_id, k_symbol) as t2 on t1.account_id = t2.account_id where t1.account_id = 3 and t2.total_amount = 3539
|
86
|
financial
|
bird
|
What year was account owner number 130 born?
|
dev
|
easy
|
SELECT STRFTIME('%y', t1.birth_date) FROM client AS t1 INNER JOIN disp AS t3 ON t1.client_id = t3.client_id INNER JOIN account AS t2 ON t3.account_id = t2.account_id WHERE t2.account_id = 130
|
87
|
financial
|
bird
|
How many accounts have an owner disposition and request for a statement to be generated upon a transaction?
|
dev
|
medium
|
SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN disp AS t2 ON t1.account_id = t2.account_id WHERE t2.type = 'owner' AND t1.frequency = 'poplatek po obratu'
|
88
|
financial
|
bird
|
What is the amount of debt that client number 992 has, and how is this client doing with payments?
|
dev
|
easy
|
SELECT t4.amount, t4.status FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN account AS t3 ON t2.account_id = t3.account_id INNER JOIN loan AS t4 ON t3.account_id = t4.account_id WHERE t1.client_id = 992
|
89
|
financial
|
bird
|
What is the sum that client number 4's account has following transaction 851? Who owns this account, a man or a woman?
|
dev
|
easy
|
SELECT t4.balance, t1.gender FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN account AS t3 ON t2.account_id = t3.account_id INNER JOIN trans AS t4 ON t3.account_id = t4.account_id WHERE t1.client_id = 4 AND t4.trans_id = 851
|
90
|
financial
|
bird
|
Which kind of credit card does client number 9 possess?
|
dev
|
easy
|
SELECT t3.type FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN card AS t3 ON t2.disp_id = t3.disp_id WHERE t1.client_id = 9
|
91
|
financial
|
bird
|
How much, in total, did client number 617 pay for all of the transactions in 1998?
|
dev
|
easy
|
SELECT SUM(t3.amount) FROM client AS t1 INNER JOIN disp AS t4 ON t1.client_id = t4.client_id INNER JOIN account AS t2 ON t4.account_id = t2.account_id INNER JOIN trans AS t3 ON t2.account_id = t3.account_id WHERE STRFTIME('%y', t3.date) = '1998' AND t1.client_id = 617
|
92
|
financial
|
bird
|
Please provide a list of clients who were born between 1983 and 1987 and whose account branch is in East Bohemia, along with their IDs.
|
dev
|
medium
|
SELECT t1.client_id, t3.account_id FROM client AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id INNER JOIN disp AS t4 ON t1.client_id = t4.client_id INNER JOIN account AS t3 ON t2.district_id = t3.district_id AND t4.account_id = t3.account_id WHERE t2.a3 = 'east bohemia' AND STRFTIME('%y', t1.birth_date) BETWEEN '1983' AND '1987'
|
93
|
financial
|
bird
|
Please provide the IDs of the 3 female clients with the largest loans.
|
dev
|
easy
|
SELECT t1.client_id FROM client AS t1 INNER JOIN disp AS t4 ON t1.client_id = t4.client_id INNER JOIN account AS t2 ON t4.account_id = t2.account_id INNER JOIN loan AS t3 ON t2.account_id = t3.account_id AND t4.account_id = t3.account_id WHERE t1.gender = 'f' ORDER BY t3.amount DESC LIMIT 3
|
94
|
financial
|
bird
|
How many male customers who were born between 1974 and 1976 have made a payment on their home in excess of $4000?
|
dev
|
medium
|
SELECT COUNT(t1.account_id) FROM trans AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id INNER JOIN disp AS t4 ON t2.account_id = t4.account_id INNER JOIN client AS t3 ON t4.client_id = t3.client_id WHERE STRFTIME('%y', t3.birth_date) BETWEEN '1974' AND '1976' AND t3.gender = 'm' AND t1.amount > 4000 AND t1.k_symbol = 'sipo'
|
95
|
financial
|
bird
|
How many accounts in Beroun were opened after 1996?
|
dev
|
easy
|
SELECT COUNT(account_id) FROM account AS t1 INNER JOIN district AS t2 ON t1.district_id = t2.district_id WHERE STRFTIME('%y', t1.date) > '1996' AND t2.a2 = 'beroun'
|
96
|
financial
|
bird
|
How many female customers have a junior credit card?
|
dev
|
easy
|
SELECT COUNT(t1.client_id) FROM client AS t1 INNER JOIN disp AS t2 ON t1.client_id = t2.client_id INNER JOIN card AS t3 ON t2.disp_id = t3.disp_id WHERE t1.gender = 'f' AND t3.type = 'junior'
|
97
|
financial
|
bird
|
What proportion of customers who have accounts at the Prague branch are female?
|
dev
|
medium
|
SELECT CAST(SUM(t2.gender = 'f') AS REAL) / COUNT(t2.client_id) * 100 FROM district AS t1 INNER JOIN client AS t2 ON t1.district_id = t2.district_id WHERE t1.a3 = 'prague'
|
98
|
financial
|
bird
|
What percentage of male clients request for weekly statements to be issued?
|
dev
|
medium
|
SELECT CAST(CAST(SUM(t1.gender = 'm') AS REAL) * 100 AS REAL) / COUNT(t1.client_id) FROM client AS t1 INNER JOIN district AS t3 ON t1.district_id = t3.district_id INNER JOIN account AS t2 ON t2.district_id = t3.district_id INNER JOIN disp AS t4 ON t1.client_id = t4.client_id AND t2.account_id = t4.account_id WHERE t2.frequency = 'poplatek tydne'
|
99
|
financial
|
bird
|
How many clients who choose statement of weekly issuance are Owner?
|
dev
|
easy
|
SELECT COUNT(t2.account_id) FROM account AS t1 INNER JOIN disp AS t2 ON t2.account_id = t1.account_id WHERE t1.frequency = 'poplatek tydne' AND t2.type = 'owner'
|
100
|
financial
|
bird
|
Among the accounts who have loan validity more than 24 months, list out the accounts that have the lowest approved amount and have account opening date before 1997.
|
dev
|
medium
|
SELECT t1.account_id FROM loan AS t1 INNER JOIN account AS t2 ON t1.account_id = t2.account_id WHERE t1.duration > 24 AND STRFTIME('%y', t2.date) < '1997' ORDER BY t1.amount ASC LIMIT 1
|
Dataset Card for FINCH - Financial Intelligence using Natural language for Contextualized SQL Handling
A comprehensive collection of SQLite databases from the FINCH benchmark, containing 33 databases with 292 tables and 75,725 natural language-SQL pairs across diverse financial domains for Text-to-SQL research and development.
Dataset Details
Dataset Description
Curated by: Domyn
Authors: Avinash Kumar Singh, Bhaskarjit Sarmah, Stefano Pasquali
Language(s): English
License: CC-BY-NC-4.0
FINCH (Financial Intelligence using Natural language for Contextualized SQL Handling) provides SQLite database files from a carefully curated financial Text-to-SQL benchmark that consolidates and extends existing resources into a unified, finance-specific dataset. Each database preserves original schema structure, relationships, and data while focusing specifically on financial domains and applications.
This dataset addresses a critical gap in Text-to-SQL research: despite significant progress in general-domain benchmarks, financial applications remain especially challenging due to complex schemas, domain-specific terminology, and high stakes of error. FINCH provides the first large-scale, finance-oriented Text-to-SQL benchmark suitable for both evaluation and fine-tuning.
Dataset Sources
Paper: FINCH: Financial Intelligence using Natural language for Contextualized SQL Handling (coming soon)
Key Features
- 33 SQLite databases specifically curated for financial applications
- 292 tables with 2,233 columns and 177 relations
- 75,725 NL-SQL pairs for comprehensive training and evaluation
- Financial domain focus including retail, banking, insurance, e-commerce, funds, stocks, and accounting
- Direct SQLite format - ready for SQL queries and analysis
- Preserved relationships - foreign keys and indexes intact
- Multi-difficulty coverage with easy, medium, and hard query complexity levels
Dataset Structure
The dataset is organized by financial domain with meaningful database names:
File Organization
finch/
├── spider/ # 22 SQLite files (financial subset from Spider)
├── bird/ # 7 SQLite files (financial subset from BIRD)
├── bull/ # 3 SQLite files (BULL/CCKS financial data)
└── book_sql/ # 1 SQLite file (BookSQL accounting data)
Financial Domains Covered
Retail & E-commerce
- customers_and_invoices: E-commerce customer and billing systems
- e_commerce: Online retail transactions and order management
- department_store: Retail chain operations and inventory management
- shop_membership: Customer loyalty and membership programs
Banking & Financial Services
- financial: Czech bank transactions and loan portfolios (1M+ records)
- small_bank: Banking account management systems
- loan_1: Loan processing and customer account data
Insurance & Risk Management
- insurance_policies: Insurance claims and policy management
- insurance_and_eClaims: Electronic claims processing systems
- insurance_fnol: First notification of loss handling
Investment & Trading
- ccks_fund: Mutual fund management and performance data
- ccks_stock: Stock market data and trading information
- tracking_share_transactions: Investment portfolio tracking
Sales & Marketing
- sales: Large-scale sales transactions (6M+ records)
- sales_in_weather: Sales data correlated with external factors
- customers_campaigns_ecommerce: Marketing campaign effectiveness
Accounting & Financial Reporting
- accounting: Complete accounting system with 185+ tables covering transactions, customers, vendors, and financial reporting
- school_finance: Educational institution financial management
Dataset Format & Examples
Data Files Structure
finch_dataset.json: Main dataset file with 75,725 NL-SQL pairs (appears in HF dataset viewer)schemas/database_schemas.yaml: Database schema metadata for all 33 databases (auxiliary file)text2sql-db/: SQLite database files organized by source (auxiliary files)
Sample Data from finch_dataset.json
[
{
"question_id": 1,
"db_id": "financial",
"db_name": "bird",
"question": "How many accounts who choose issuance after transaction are staying in East Bohemia region?",
"partition": "dev",
"difficulty": "medium",
"SQL": "SELECT COUNT(t2.account_id) FROM district AS t1 INNER JOIN account AS t2 ON t1.district_id = t2.district_id WHERE t1.a3 = 'east bohemia' AND t2.frequency = 'poplatek po obratu'"
},
{
"question_id": 2,
"db_id": "financial",
"db_name": "bird",
"question": "How many accounts who have region in Prague are eligible for loans?",
"partition": "dev",
"difficulty": "easy",
"SQL": "SELECT COUNT(t1.account_id) FROM account AS t1 INNER JOIN loan AS t2 ON t1.account_id = t2.account_id INNER JOIN district AS t3 ON t1.district_id = t3.district_id WHERE t3.a3 = 'prague'"
},
{
"question_id": 3,
"db_id": "financial",
"db_name": "bird",
"question": "The average unemployment ratio of 1995 and 1996, which one has higher percentage?",
"partition": "dev",
"difficulty": "easy",
"SQL": "SELECT DISTINCT IIF(AVG(a13) > AVG(a12), '1996', '1995') FROM district"
}
]
Schema Information (schemas/database_schemas.yaml)
The schemas/database_schemas.yaml file contains comprehensive schema metadata for all databases:
financial:
db_id: financial
table_names_original:
- account
- card
- client
- disp
- district
- loan
- order
- trans
table_names:
- account
- card
- client
- disposition
- district
- loan
- order
- transaction
column_names_original:
- [-1, "*"]
- [0, "account_id"]
- [0, "district_id"]
- [0, "frequency"]
- [0, "date"]
column_types:
- text
- number
- number
- text
- text
foreign_keys:
- [2, 1]
- [4, 2]
primary_keys:
- 1
Example Usage
Loading with Python
Primary Method: Using datasets library (Recommended)
from datasets import load_dataset
from huggingface_hub import hf_hub_download
import sqlite3
import yaml
# Load the main dataset using HuggingFace datasets library
dataset = load_dataset("domyn/FINCH")
print(f"Dataset: {dataset}")
print(f"Number of examples: {len(dataset['train'])}")
# Access individual examples
sample = dataset['train'][0]
print(f"Question: {sample['question']}")
print(f"SQL: {sample['SQL']}")
print(f"Database: {sample['db_id']}")
print(f"Difficulty: {sample['difficulty']}")
# Load schema information for the database
schema_path = hf_hub_download(repo_id="domyn/FINCH", filename="schemas/database_schemas.yaml")
with open(schema_path, 'r') as f:
schemas = yaml.safe_load(f)
# Download the corresponding SQLite database
db_path = hf_hub_download(
repo_id="domyn/FINCH",
filename=f"text2sql-db/text2sql/bird/{sample['db_id']}.sqlite"
)
# Execute the SQL query on the actual database
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
cursor.execute(sample['SQL'])
results = cursor.fetchall()
print(f"Query Results: {results}")
Alternative Method: Direct file download
import json
import sqlite3
from huggingface_hub import hf_hub_download
# Alternative: Load dataset JSON file directly
samples_path = hf_hub_download(repo_id="domyn/FINCH", filename="finch_dataset.json")
with open(samples_path, 'r') as f:
dataset = json.load(f)
sample = dataset[0] # First sample
print(f"Question: {sample['question']}")
print(f"SQL: {sample['SQL']}")
Financial Query Examples
# Analyze banking transactions
cursor.execute("""
SELECT account_id, SUM(amount) as total_balance
FROM transactions
WHERE transaction_date >= '2023-01-01'
GROUP BY account_id
ORDER BY total_balance DESC
""")
# Insurance claims analysis
cursor.execute("""
SELECT policy_type, COUNT(*) as claim_count, AVG(claim_amount)
FROM claims c
JOIN policies p ON c.policy_id = p.policy_id
WHERE claim_status = 'approved'
GROUP BY policy_type
""")
Schema Exploration
# Get all tables
cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables = cursor.fetchall()
print("Available tables:", tables)
# Get detailed schema information
cursor.execute("PRAGMA table_info(transactions)")
schema = cursor.fetchall()
for column in schema:
print(f"Column: {column[1]}, Type: {column[2]}")
Data Quality & Statistics
Database Statistics
📊 TOTAL DATABASES: 33
📅 FINANCIAL DOMAINS: 8+ specialized areas
🏢 TABLES: 292 across all databases
🔗 RELATIONS: 177 foreign key relationships
💼 NL-SQL PAIRS: 75,725 total examples
| Source | Database Count | Table Count | NL-SQL Pairs | Domain Focus |
|---|---|---|---|---|
| Spider (financial) | 22 | 145 | 1,100 | Cross-domain financial |
| BIRD (financial) | 7 | 48 | 1,139 | Large-scale realistic |
| BULL/CCKS | 3 | 99 | 4,966 | Chinese financial markets |
| BookSQL | 1 | 185 | 68,907 | Accounting systems |
| TOTAL | 33 | 292 | 75,725 | Financial |
Difficulty Distribution
- Easy queries: 9,358 examples (12.4%)
- Medium queries: 33,780 examples (44.6%)
- Hard queries: 32,587 examples (43.0%)
Quality Assurance
The dataset has undergone extensive validation and cleaning:
- ✅ SQL execution verified for all 75,725 queries
- ✅ Schema consistency maintained across all databases
- ✅ Error correction performed on original datasets:
- BIRD: 327 queries fixed (column names, table references)
- BULL: 60 queries corrected (syntax errors, invalid references)
- BookSQL: 9,526 queries repaired (column names, table references, syntax)
- ✅ Financial domain relevance verified for all included databases
Applications
This dataset is specifically designed for:
Financial Research Applications
- Financial Text-to-SQL Systems: Train models specifically for financial database querying
- Domain Adaptation Studies: Research cross-domain transfer from general to financial SQL
- Financial Schema Understanding: Develop models that understand complex financial relationships
- Regulatory Compliance: Build systems for automated financial reporting and compliance checking
- Risk Analysis Automation: Create tools for automated risk assessment query generation
Industry Applications
- Financial Analytics Platforms: Natural language interfaces for financial data analysis
- Banking Query Systems: Customer service and internal analyst tools
- Investment Research: Automated portfolio analysis and market research
- Regulatory Reporting: Compliance and audit report generation
- Insurance Processing: Claims analysis and policy management systems
Educational Applications
- Financial SQL Training: Teach SQL with realistic financial datasets
- Business Intelligence Education: Train on real-world financial database structures
- Fintech Development: Build and test financial technology applications
FINCH Evaluation Metric
The dataset introduces the FINCH Score, a specialized evaluation metric for financial Text-to-SQL that addresses limitations of traditional exact-match and execution accuracy metrics:
Key Features of FINCH Score
- Component-wise Scoring: Weighted evaluation of SQL clauses (SELECT, WHERE, JOIN, etc.)
- Financial Clause Priority: Higher weights for business-critical clauses (WHERE, JOIN, GROUP BY)
- Execution Tolerance: Materiality-aware tolerance for floating-point differences
- Structural Fidelity: Emphasis on semantic correctness over syntactic matching
Mathematical Formulation
FINCH Score = S(q̂,q*)^β × (δ + (1-δ)e(q̂,q*))
Where:
- S(q̂,q*): Weighted component similarity score
- e(q̂,q*): Execution accuracy with tolerance τ
- β: Structural fidelity parameter
- δ: Execution failure penalty parameter
Benchmark Results
Initial benchmarking on FINCH reveals detailed performance across multiple state-of-the-art models:
Model Performance Table
| Model | Exact Match | Execution Accuracy | Component Match | FINCH Score |
|---|---|---|---|---|
| GPT-OSS-120B | 1.8% | 27.8% | 16.6% | 11.6% |
| Arctic-Text2SQL-R1-7B | 0.6% | 2.3% | 3.7% | 1.5% |
| Qwen3-235B-A22B | 0.7% | 2.5% | 2.8% | 1.2% |
| Qwen3-8B | 0.5% | 0.8% | 3.5% | 1.2% |
| GPT-OSS-20B | 0.3% | 7.5% | 5.2% | 3.0% |
| Phi-4-mini-reasoning | 0.0% | 0.2% | 1.0% | 0.4% |
SQL Clause-Level Performance
Analysis of errors by SQL clause reveals systematic challenges:
| Model | SELECT | FROM | WHERE | GROUP BY | HAVING | ORDER BY | LIMIT |
|---|---|---|---|---|---|---|---|
| GPT-OSS-120B | 4.7% | 27.3% | 6.9% | 7.5% | 6.3% | 6.3% | 73.8% |
| Arctic-Text2SQL-R1-7B | 2.5% | 3.6% | 0.7% | 4.7% | 1.0% | 1.3% | 42.7% |
| GPT-OSS-20B | 1.4% | 6.2% | 1.5% | 8.4% | 3.7% | 1.5% | 65.2% |
Model Performance Hierarchy
- GPT-OSS-120B: Strongest overall performance (11.6% FINCH Score)
- Arctic-Text2SQL-R1-7B: Best domain-adapted model despite smaller size (1.5% FINCH Score)
- GPT-OSS-20B: Solid medium-scale performance (3.0% FINCH Score)
Key Research Findings
- Domain adaptation outperforms scale alone - Arctic-Text2SQL-R1-7B (7B params) rivals much larger models
- Schema-sensitive clauses (SELECT, FROM, WHERE) remain the primary bottleneck
- Query difficulty shows steep performance degradation: easy queries achieve ~26.5% vs hard queries at ~4.5%
- Financial complexity significantly impacts all models, with even SOTA systems achieving modest absolute performance
- FINCH Score correlation: Provides more nuanced assessment than traditional exact-match metrics
Data Source & Methodology
FINCH consolidates financial databases from multiple sources:
- Careful Domain Selection: Only financial-relevant databases retained
- Comprehensive Validation: All SQL queries tested for execution
- Error Correction: Systematic fixing of syntax and schema errors
- Difficulty Annotation: Query complexity labeled following established guidelines
- Schema Normalization: All databases converted to SQLite for consistency
The curation process prioritized financial domain relevance while maintaining the diversity and complexity necessary for robust model evaluation.
Ethical Considerations
- Public Domain Data: All source databases are from publicly available benchmarks
- Financial Privacy: No real customer or proprietary financial data included
- Synthetic Data: Financial amounts and transactions are synthetic or anonymized
- Research Purpose: Intended primarily for academic and research applications
- Domain Compliance: Respects financial data handling best practices
Citation
If you use the FINCH dataset in your research, please cite:
@inproceedings{singh2025finch,
title={FINCH: Financial Intelligence using Natural language for Contextualized SQL Handling},
author={Singh, Avinash Kumar and Sarmah, Bhaskarjit and Pasquali, Stefano},
booktitle={Proceedings of Advances in Financial AI: Innovations, Risk, and Responsibility in the Era of LLMs (CIKM 2025)},
year={2025},
organization={ACM}
}
Dataset Card Contact
For questions about the FINCH dataset, please contact the research team at Domyn.
Research Team:
- Avinash Kumar Singh ([email protected])
- Bhaskarjit Sarmah ([email protected])
- Stefano Pasquali ([email protected])
- Downloads last month
- 168