question
stringlengths 23
286
| sql
stringlengths 29
1.45k
| db_id
stringclasses 11
values | prompt
stringlengths 1.09k
6.84k
| question_id
int64 0
1.53k
| difficulty
stringclasses 3
values |
---|---|---|---|---|---|
Among the account opened, how many female customers who were born before 1950 and stayed in Slokolov? | 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 = 'Slokolov' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Among the account opened, how many female customers who were born before 1950 and stayed in Slokolov? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 100 | moderate |
List out the accounts who have the earliest trading date in 1995 ? | SELECT account_id FROM trans WHERE STRFTIME('%Y', date) = '1995' ORDER BY date ASC LIMIT 1 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List out the accounts who have the earliest trading date in 1995 ? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 101 | simple |
State different accounts who have account opening date before 1997 and own an amount of money greater than 3000USD | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
State different accounts who have account opening date before 1997 and own an amount of money greater than 3000USD None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 102 | simple |
Which client issued his/her card in 1994/3/3, give his/her client id. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which client issued his/her card in 1994/3/3, give his/her client id. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 103 | simple |
The transaction of 840 USD happened in 1998/10/14, when was this account opened? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
The transaction of 840 USD happened in 1998/10/14, when was this account opened? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 104 | simple |
There was a loan approved in 1994/8/25, where was that account opened, give the district Id of the branch. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
There was a loan approved in 1994/8/25, where was that account opened, give the district Id of the branch. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 105 | simple |
What is the biggest amount of transaction that the client whose card was opened in 1996/10/21 made? | SELECT T2.amount FROM account AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id WHERE T1.date = '1996-10-21' ORDER BY T2.amount DESC LIMIT 1 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the biggest amount of transaction that the client whose card was opened in 1996/10/21 made? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 106 | simple |
What is the gender of the oldest client who opened his/her account in the highest average salary branch? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the gender of the oldest client who opened his/her account in the highest average salary branch? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 107 | simple |
For the client who applied the biggest loan, what was his/her first amount of transaction after opened the account? | SELECT T2.amount FROM loan AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id ORDER BY T1.amount DESC, T2.date ASC LIMIT 1 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For the client who applied the biggest loan, what was his/her first amount of transaction after opened the account? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 108 | simple |
How many clients opened their accounts in Jesenik branch were women? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many clients opened their accounts in Jesenik branch were women? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 109 | simple |
What is the disposition id of the client who made 5100 USD transaction in 1998/9/2? | SELECT T1.disp_id FROM disp AS T1 INNER JOIN trans AS T2 ON T1.account_id = T2.account_id WHERE T2.date = '1998-09-02' AND T2.amount = 5100 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the disposition id of the client who made 5100 USD transaction in 1998/9/2? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 110 | simple |
How many accounts were opened in Litomerice in 1996? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many accounts were opened in Litomerice in 1996? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 111 | simple |
For the female client who was born in 1976/1/29, which district did she opened her account? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For the female client who was born in 1976/1/29, which district did she opened her account? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 112 | simple |
For the client who applied 98832 USD loan in 1996/1/3, when was his/her birthday? | SELECT T3.birth_date FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T1.date = '1996-01-03' AND T1.amount = 98832 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For the client who applied 98832 USD loan in 1996/1/3, when was his/her birthday? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 113 | simple |
For the first client who opened his/her account in Prague, what is his/her account ID? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For the first client who opened his/her account in Prague, what is his/her account ID? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 114 | simple |
For the branch which located in the south Bohemia with biggest number of inhabitants, what is the percentage of the male clients? | SELECT CAST(SUM(T1.gender = 'M') AS REAL) * 100 / 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For the branch which located in the south Bohemia with biggest number of inhabitants, what is the percentage of the male clients? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 115 | challenging |
For the client who first applied the loan in 1993/7/5, what is the increase rate of his/her account balance from 1993/3/22 to 1998/12/27? | SELECT CAST((SUM(IIF(T3.date = '1998-12-27', T3.balance, 0)) - SUM(IIF(T3.date = '1993-03-22', T3.balance, 0))) AS REAL) * 100 / 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For the client who first applied the loan in 1993/7/5, what is the increase rate of his/her account balance from 1993/3/22 to 1998/12/27? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 116 | challenging |
What is the percentage of loan amount that has been fully paid with no issue. | SELECT (CAST(SUM(CASE WHEN status = 'A' THEN amount ELSE 0 END) AS REAL) * 100) / SUM(amount) FROM loan | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the percentage of loan amount that has been fully paid with no issue. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 117 | moderate |
For loan amount less than USD100,000, what is the percentage of accounts that is still running with no issue. | SELECT CAST(SUM(status = 'C') AS REAL) * 100 / COUNT(amount) FROM loan WHERE amount < 100000 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For loan amount less than USD100,000, what is the percentage of accounts that is still running with no issue. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 118 | moderate |
For accounts in 1993 with statement issued after transaction, list the account ID, district name and district region. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
For accounts in 1993 with statement issued after transaction, list the account ID, district name and district region. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 119 | moderate |
From Year 1995 to 2000, who are the accounts holders from 'east Bohemia'. State the account ID the frequency of statement issuance. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
From Year 1995 to 2000, who are the accounts holders from 'east Bohemia'. State the account ID the frequency of statement issuance. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 120 | moderate |
List account ID and account opening date for accounts from 'Prachatice'. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List account ID and account opening date for accounts from 'Prachatice'. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 121 | simple |
State the district and region for loan ID '4990'. | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
State the district and region for loan ID '4990'. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 122 | simple |
Provide the account ID, district and region for loan amount greater than USD300,000. | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Provide the account ID, district and region for loan amount greater than USD300,000. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 123 | simple |
List the loan ID, district and average salary for loan with duration of 60 months. | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List the loan ID, district and average salary for loan with duration of 60 months. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 124 | simple |
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. | SELECT CAST((T3.A13 - T3.A12) AS REAL) * 100 / 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
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. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 125 | challenging |
Calculate the percentage of account from 'Decin' district for all accounts are opened in 1993. | SELECT CAST(SUM(T1.A2 = 'Decin') AS REAL) * 100 / 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Calculate the percentage of account from 'Decin' district for all accounts are opened in 1993. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 126 | simple |
List the account IDs with monthly issuance of statements. | SELECT account_id FROM account WHERE Frequency = 'POPLATEK MESICNE' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List the account IDs with monthly issuance of statements. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 127 | simple |
List the top ten districts, by descending order, from the highest to the lowest, the number of female account holders. | 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 10 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List the top ten districts, by descending order, from the highest to the lowest, the number of female account holders. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 128 | moderate |
Which are the top ten withdrawals (non-credit card) by district names for the month of January 1996? | SELECT T1.district_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.type = 'VYDAJ' AND T2.date LIKE '1996-01%' ORDER BY A2 ASC LIMIT 10 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which are the top ten withdrawals (non-credit card) by district names for the month of January 1996? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 129 | moderate |
How many of the account holders in South Bohemia still do not own credit cards? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many of the account holders in South Bohemia still do not own credit cards? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 130 | moderate |
Which district has highest active loan? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which district has highest active loan? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 131 | moderate |
What is the average loan amount by male borrowers? | SELECT AVG(T3.amount) FROM client 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 T1.gender = 'M' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the average loan amount by male borrowers? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 132 | simple |
In 1996, which districts have the highest unemployment rate? List their branch location and district name. | SELECT district_id, A2 FROM district ORDER BY A13 DESC LIMIT 1 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
In 1996, which districts have the highest unemployment rate? List their branch location and district name. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 133 | simple |
In the branch where the largest number of crimes were committed in 1996, how many accounts were opened? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
In the branch where the largest number of crimes were committed in 1996, how many accounts were opened? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 134 | simple |
After making a credit card withdrawal, how many account/s with monthly issuance has a negative balance? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
After making a credit card withdrawal, how many account/s with monthly issuance has a negative balance? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 135 | moderate |
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? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
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? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 136 | moderate |
How many accounts have running contracts in Branch location 1? | 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') | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many accounts have running contracts in Branch location 1? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 137 | moderate |
In the branch where the second-highest number of crimes were committed in 1995 occurred, how many male clients are there? | 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, 1) | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
In the branch where the second-highest number of crimes were committed in 1995 occurred, how many male clients are there? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 138 | moderate |
How many high-level credit cards have "disponent" type of disposition? | 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 = 'DISPONENT' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many high-level credit cards have "disponent" type of disposition? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 139 | simple |
How many accounts are there in the district of "Pisek"? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many accounts are there in the district of "Pisek"? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 140 | simple |
Which districts have transactions greater than USS$10,000 in 1997? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which districts have transactions greater than USS$10,000 in 1997? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 141 | simple |
Which accounts placed orders for household payment in Pisek? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which accounts placed orders for household payment in Pisek? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 142 | simple |
What are the accounts that have both gold and junior credit cards? | SELECT T2.account_id FROM card AS T1 INNER JOIN disp AS T2 ON T1.disp_id = T2.disp_id WHERE T1.type IN ('gold', 'junior') | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What are the accounts that have both gold and junior credit cards? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 143 | simple |
How much is the average amount in credit card made by account holders in a month, in year 2021? | SELECT AVG(T3.amount) FROM card AS T1 INNER JOIN disp AS T2 ON T1.disp_id = T2.disp_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id WHERE STRFTIME('%Y', T3.date) = '2021' AND T3.operation = 'VYBER KARTOU' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How much is the average amount in credit card made by account holders in a month, in year 2021? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 144 | moderate |
Who are the account holder identification numbers whose spent per month on the credit card is less than the average, in 1998? | 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') | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Who are the account holder identification numbers whose spent per month on the credit card is less than the average, in 1998? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 145 | moderate |
Who are the female account holders who own credit cards and also have loans? | SELECT T1.client_id FROM client AS T1 INNER JOIN disp AS T2 ON T1.client_id = T2.client_id INNER JOIN loan AS T3 ON T2.account_id = T3.account_id INNER JOIN card AS T4 ON T2.disp_id = T4.disp_id WHERE T1.gender = 'F' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Who are the female account holders who own credit cards and also have loans? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 146 | simple |
How many female clients' accounts are in the region of South Bohemia? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many female clients' accounts are in the region of South Bohemia? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 147 | simple |
Please list the accounts whose district is Tabor that are eligible for loans. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Please list the accounts whose district is Tabor that are eligible for loans. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 148 | moderate |
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. | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
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. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 149 | challenging |
How many accounts in North Bohemia has made a transaction with the partner's bank being AB? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many accounts in North Bohemia has made a transaction with the partner's bank being AB? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 150 | moderate |
Please list the name of the districts with accounts that made withdrawal transactions. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Please list the name of the districts with accounts that made withdrawal transactions. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 151 | moderate |
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? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
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? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 152 | moderate |
How many 'classic' cards are eligible for loan? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many 'classic' cards are eligible for loan? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 153 | simple |
How many male clients in 'Hl.m. Praha' district? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many male clients in 'Hl.m. Praha' district? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 154 | simple |
How many percent of 'Gold' cards were issued prior to 1998? | SELECT CAST(SUM(type = 'gold') AS REAL) * 100 / COUNT(card_id) FROM card WHERE STRFTIME('%Y', issued) < '1998' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many percent of 'Gold' cards were issued prior to 1998? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 155 | simple |
Who is the owner of the account with the largest loan amount? | SELECT T1.client_id FROM disp AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id WHERE T1.type = 'OWNER' ORDER BY T2.amount DESC LIMIT 1 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Who is the owner of the account with the largest loan amount? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 156 | simple |
What is the number of committed crimes in 1995 in the district of the account with the id 532? | SELECT T1.A15 FROM district AS T1 INNER JOIN `account` AS T2 ON T1.district_id = T2.district_id WHERE T2.account_id = 532 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the number of committed crimes in 1995 in the district of the account with the id 532? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 157 | simple |
What is the district Id of the account that placed the order with the id 33333? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the district Id of the account that placed the order with the id 33333? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 158 | simple |
List all the withdrawals in cash transactions that the client with the id 3356 makes. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List all the withdrawals in cash transactions that the client with the id 3356 makes. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 159 | simple |
Among the weekly issuance accounts, how many have a loan of under 200000? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Among the weekly issuance accounts, how many have a loan of under 200000? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 160 | simple |
What type of credit card does the client with the id 13539 own? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What type of credit card does the client with the id 13539 own? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 161 | simple |
What is the region of the client with the id 3541 from? | SELECT T2.district_id, T1.A3 FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T2.client_id = 3541 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the region of the client with the id 3541 from? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 162 | simple |
Which district has the most accounts with loan contracts finished with no problems? | SELECT T1.district_id 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which district has the most accounts with loan contracts finished with no problems? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 163 | moderate |
Who placed the order with the id 32423? | SELECT T3.client_id FROM `order` AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T1.order_id = 32423 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Who placed the order with the id 32423? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 164 | simple |
Please list all the transactions made by accounts from district 5. | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Please list all the transactions made by accounts from district 5. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 165 | simple |
How many of the accounts are from Jesenik district? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many of the accounts are from Jesenik district? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 166 | simple |
List all the clients' IDs whose junior credit cards were issued after 1996. | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List all the clients' IDs whose junior credit cards were issued after 1996. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 167 | simple |
What percentage of clients who opened their accounts in the district with an average salary of over 10000 are women? | SELECT CAST(SUM(T2.gender = 'F') AS REAL) * 100 / COUNT(T2.client_id) FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.A11 > 10000 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What percentage of clients who opened their accounts in the district with an average salary of over 10000 are women? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 168 | moderate |
What was the growth rate of the total amount of loans across all accounts for a male client between 1996 and 1997? | SELECT 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 / 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What was the growth rate of the total amount of loans across all accounts for a male client between 1996 and 1997? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 169 | challenging |
How many credit card withdrawals were recorded after 1995? | SELECT COUNT(account_id) FROM trans WHERE STRFTIME('%Y', date) > '1995' AND operation = 'VYBER KARTOU' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many credit card withdrawals were recorded after 1995? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 170 | simple |
What was the difference in the number of crimes committed in East and North Bohemia in 1996? | SELECT SUM(IIF(A3 = 'East Bohemia', A16, 0)) - SUM(IIF(A3 = 'North Bohemia', A16, 0)) FROM district | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What was the difference in the number of crimes committed in East and North Bohemia in 1996? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 171 | moderate |
How many owner and disponent dispositions are there from account number 1 to account number 10? | SELECT SUM(type = 'Owner') , SUM(type = 'Disponent') FROM disp WHERE account_id BETWEEN 1 AND 10 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many owner and disponent dispositions are there from account number 1 to account number 10? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 172 | simple |
How often does account number 3 request an account statement to be released? What was the aim of debiting 3539 in total? | SELECT T1.frequency, T2.k_symbol FROM account AS T1 INNER JOIN `order` AS T2 ON T1.account_id = T2.account_id WHERE T1.account_id = 3 AND T2.amount = 3539 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How often does account number 3 request an account statement to be released? What was the aim of debiting 3539 in total? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 173 | simple |
What year was account owner number 130 born? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What year was account owner number 130 born? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 174 | simple |
How many accounts have an owner disposition and request for a statement to be generated upon a transaction? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many accounts have an owner disposition and request for a statement to be generated upon a transaction? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 175 | moderate |
What is the amount of debt that client number 992 has, and how is this client doing with payments? | SELECT T3.amount, T3.status FROM client 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 T1.client_id = 992 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the amount of debt that client number 992 has, and how is this client doing with payments? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 176 | simple |
What is the sum that client number 4's account has following transaction 851? Who owns this account, a man or a woman? | SELECT T3.balance, T1.gender FROM client 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.client_id = 4 AND T3.trans_id = 851 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the sum that client number 4's account has following transaction 851? Who owns this account, a man or a woman? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 177 | simple |
Which kind of credit card does client number 9 possess? | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Which kind of credit card does client number 9 possess? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 178 | simple |
How much, in total, did client number 617 pay for all of the transactions in 1998? | SELECT SUM(T3.amount) FROM client 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 STRFTIME('%Y', T3.date)= '1998' AND T1.client_id = 617 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How much, in total, did client number 617 pay for all of the transactions in 1998? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 179 | simple |
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. | 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 account AS T3 ON T2.district_id = T3.district_id WHERE T2.A3 = 'east Bohemia' AND STRFTIME('%Y', T1.birth_date) BETWEEN '1983' AND '1987' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
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. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 180 | moderate |
Please provide the IDs of the 3 female clients with the largest loans. | SELECT T1.client_id FROM client 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 T1.gender = 'F' ORDER BY T3.amount DESC LIMIT 3 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Please provide the IDs of the 3 female clients with the largest loans. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 181 | simple |
How many male customers who were born between 1974 and 1976 have made a payment on their home in excess of $4000? | SELECT COUNT(T1.account_id) FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE STRFTIME('%Y', T3.birth_date) BETWEEN '1974' AND '1976' AND T3.gender = 'M' AND T1.amount > 4000 AND T1.k_symbol = 'SIPO' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many male customers who were born between 1974 and 1976 have made a payment on their home in excess of $4000? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 182 | moderate |
How many accounts in Beroun were opened after 1996? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many accounts in Beroun were opened after 1996? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 183 | simple |
How many female customers have a junior credit card? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many female customers have a junior credit card? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 184 | simple |
What proportion of customers who have accounts at the Prague branch are female? | 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' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What proportion of customers who have accounts at the Prague branch are female? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 185 | moderate |
What percentage of male clients request for weekly statements to be issued? | SELECT CAST(SUM(T1.gender = 'M') AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE T2.frequency = 'POPLATEK TYDNE' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What percentage of male clients request for weekly statements to be issued? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 186 | moderate |
How many clients who choose statement of weekly issuance are User? | 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 = 'USER' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many clients who choose statement of weekly issuance are User? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 187 | simple |
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. | 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 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
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. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 188 | moderate |
Name the account numbers of female clients who are oldest and have lowest average salary? | SELECT T3.account_id FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN account AS T3 ON T2.district_id = T3.district_id WHERE T1.gender = 'F' ORDER BY T1.birth_date ASC, T2.A11 ASC LIMIT 1 | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Name the account numbers of female clients who are oldest and have lowest average salary? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 189 | moderate |
How many clients who were born in 1920 stay in east Bohemia? | SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE STRFTIME('%Y', T1.birth_date) = '1920' AND T2.A3 = 'east Bohemia' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many clients who were born in 1920 stay in east Bohemia? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 190 | simple |
How many loan accounts are for pre-payment of duration of 24 months with weekly issuance of statement. | SELECT COUNT(T2.account_id) FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id WHERE T2.duration = 24 AND T1.frequency = 'POPLATEK TYDNE' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
How many loan accounts are for pre-payment of duration of 24 months with weekly issuance of statement. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 191 | simple |
What is the average amount of loan which are still on running contract with statement issuance after each transaction? | SELECT AVG(T2.payments) FROM account AS T1 INNER JOIN loan AS T2 ON T1.account_id = T2.account_id WHERE T2.status IN ('C', 'D') AND T1.frequency = 'POPLATEK PO OBRATU' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
What is the average amount of loan which are still on running contract with statement issuance after each transaction? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 192 | moderate |
List all ID and district for clients that can only have the right to issue permanent orders or apply for loans. | SELECT T3.client_id, T2.district_id, T2.A2 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 WHERE T3.type = 'OWNER' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
List all ID and district for clients that can only have the right to issue permanent orders or apply for loans. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 193 | moderate |
Provide the IDs and age of the client with high level credit card, which is eligible for loans. | SELECT T1.client_id, STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T3.birth_date) FROM disp AS T1 INNER JOIN card AS T2 ON T2.disp_id = T1.disp_id INNER JOIN client AS T3 ON T1.client_id = T3.client_id WHERE T2.type = 'gold' AND T1.type = 'OWNER' | financial | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#account (account_id integer, district_id integer, frequency text, date date, , PRIMARY KEY(account_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#card (card_id integer, disp_id integer, type text, issued date, , PRIMARY KEY(card_id), FOREIGN KEY(disp_id) REFERENCES disp(disp_id))
#client (client_id integer, gender text, birth_date date, district_id integer, , PRIMARY KEY(client_id), FOREIGN KEY(district_id) REFERENCES district(district_id))
#disp (disp_id integer, client_id integer, account_id integer, type text, , PRIMARY KEY(disp_id), FOREIGN KEY(client_id) REFERENCES client(client_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#district (district_id integer, A2 text, A3 text, A4 text, A5 text, A6 text, A7 text, A8 integer, A9 integer, A10 real, A11 integer, A12 real, A13 real, A14 integer, A15 integer, A16 integer, , PRIMARY KEY(district_id), )
#loan (loan_id integer, account_id integer, date date, amount integer, duration integer, payments real, status text, , PRIMARY KEY(loan_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#order (order_id integer, account_id integer, bank_to text, account_to integer, amount real, k_symbol text, , PRIMARY KEY(order_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#trans (trans_id integer, account_id integer, date date, type text, operation text, amount integer, balance integer, k_symbol text, bank text, account integer, , PRIMARY KEY(trans_id), FOREIGN KEY(account_id) REFERENCES account(account_id))
#
Provide the IDs and age of the client with high level credit card, which is eligible for loans. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 194 | moderate |
What is the most common bond type? | SELECT T.bond_type FROM ( SELECT bond_type, COUNT(bond_id) FROM bond GROUP BY bond_type ORDER BY COUNT(bond_id) DESC LIMIT 1 ) AS T | toxicology | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#atom (atom_id text, molecule_id text, element text, , PRIMARY KEY(atom_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#bond (bond_id text, molecule_id text, bond_type text, , PRIMARY KEY(bond_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#connected (atom_id text, atom_id2 text, bond_id text, , PRIMARY KEY(atom_id), PRIMARY KEY(atom_id2), FOREIGN KEY(atom_id2) REFERENCES atom(atom_id), FOREIGN KEY(bond_id) REFERENCES bond(bond_id), FOREIGN KEY(atom_id) REFERENCES atom(atom_id))
#molecule (molecule_id text, label text, , PRIMARY KEY(molecule_id), )
#
What is the most common bond type? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 195 | simple |
In the non-carcinogenic molecules, how many contain chlorine atoms? | SELECT COUNT(DISTINCT T1.molecule_id) FROM molecule AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.element = 'cl' AND T1.label = '-' | toxicology | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#atom (atom_id text, molecule_id text, element text, , PRIMARY KEY(atom_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#bond (bond_id text, molecule_id text, bond_type text, , PRIMARY KEY(bond_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#connected (atom_id text, atom_id2 text, bond_id text, , PRIMARY KEY(atom_id), PRIMARY KEY(atom_id2), FOREIGN KEY(atom_id2) REFERENCES atom(atom_id), FOREIGN KEY(bond_id) REFERENCES bond(bond_id), FOREIGN KEY(atom_id) REFERENCES atom(atom_id))
#molecule (molecule_id text, label text, , PRIMARY KEY(molecule_id), )
#
In the non-carcinogenic molecules, how many contain chlorine atoms? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 196 | simple |
Calculate the average number of oxygen atoms in single-bonded molecules. | SELECT AVG(oxygen_count) FROM (SELECT T1.molecule_id, COUNT(T1.element) AS oxygen_count FROM atom AS T1 INNER JOIN bond AS T2 ON T1.molecule_id = T2.molecule_id WHERE T2.bond_type = '-' AND T1.element = 'o' GROUP BY T1.molecule_id) AS oxygen_counts | toxicology | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#atom (atom_id text, molecule_id text, element text, , PRIMARY KEY(atom_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#bond (bond_id text, molecule_id text, bond_type text, , PRIMARY KEY(bond_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#connected (atom_id text, atom_id2 text, bond_id text, , PRIMARY KEY(atom_id), PRIMARY KEY(atom_id2), FOREIGN KEY(atom_id2) REFERENCES atom(atom_id), FOREIGN KEY(bond_id) REFERENCES bond(bond_id), FOREIGN KEY(atom_id) REFERENCES atom(atom_id))
#molecule (molecule_id text, label text, , PRIMARY KEY(molecule_id), )
#
Calculate the average number of oxygen atoms in single-bonded molecules. None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 197 | moderate |
On average how many carcinogenic molecules are single bonded? | SELECT AVG(single_bond_count) FROM (SELECT T3.molecule_id, COUNT(T1.bond_type) AS single_bond_count FROM bond AS T1 INNER JOIN atom AS T2 ON T1.molecule_id = T2.molecule_id INNER JOIN molecule AS T3 ON T3.molecule_id = T2.molecule_id WHERE T1.bond_type = '-' AND T3.label = '+' GROUP BY T3.molecule_id) AS subquery | toxicology | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#atom (atom_id text, molecule_id text, element text, , PRIMARY KEY(atom_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#bond (bond_id text, molecule_id text, bond_type text, , PRIMARY KEY(bond_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#connected (atom_id text, atom_id2 text, bond_id text, , PRIMARY KEY(atom_id), PRIMARY KEY(atom_id2), FOREIGN KEY(atom_id2) REFERENCES atom(atom_id), FOREIGN KEY(bond_id) REFERENCES bond(bond_id), FOREIGN KEY(atom_id) REFERENCES atom(atom_id))
#molecule (molecule_id text, label text, , PRIMARY KEY(molecule_id), )
#
On average how many carcinogenic molecules are single bonded? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 198 | challenging |
In the molecule containing sodium atoms, how many are non-carcinogenic? | SELECT COUNT(DISTINCT T2.molecule_id) FROM atom AS T1 INNER JOIN molecule AS T2 ON T1.molecule_id = T2.molecule_id WHERE T1.element = 'na' AND T2.label = '-' | toxicology | You are a proficient SQLite database engineer. You think step by step and give clear and concise answer.
### Here are all the tables with their properties in a SQLite Database.
#
#atom (atom_id text, molecule_id text, element text, , PRIMARY KEY(atom_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#bond (bond_id text, molecule_id text, bond_type text, , PRIMARY KEY(bond_id), FOREIGN KEY(molecule_id) REFERENCES molecule(molecule_id))
#connected (atom_id text, atom_id2 text, bond_id text, , PRIMARY KEY(atom_id), PRIMARY KEY(atom_id2), FOREIGN KEY(atom_id2) REFERENCES atom(atom_id), FOREIGN KEY(bond_id) REFERENCES bond(bond_id), FOREIGN KEY(atom_id) REFERENCES atom(atom_id))
#molecule (molecule_id text, label text, , PRIMARY KEY(molecule_id), )
#
In the molecule containing sodium atoms, how many are non-carcinogenic? None
# Always use aliases for all aggregate functions.
# Use SQL set operations(Union, Union All, Intersect and Minus) if needed.
# Use the actual table names in SQL.
# replace alias with actual table name or column name if equivalent alias present in natural query
SELECT | 199 | simple |