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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.