Dludora/Bird-minidev-sqlserver-oracle huggingface dataset:
Database: financial

Question: For the client whose loan was approved first in 1993/7/5, what is the increase rate of his/her account balance from 1993/3/22 to 1998/12/27?
Evidence: Increase rate of his/her account balance = [(balance of date A - balance of date B) / balance of Date B] * 100%
SQL (SQLite): 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'
SQL (SQL Server): SELECT TRY_CAST((SUM(IIF(T3.date = '1998-12-27', TRY_CAST(T3.balance AS FLOAT), 0.0)) - SUM(IIF(T3.date = '1993-03-22', TRY_CAST(T3.balance AS FLOAT), 0.0))) AS FLOAT) * 100 / SUM(IIF(T3.date = '1993-03-22', TRY_CAST(T3.balance AS FLOAT), 0.0)) AS _agg1 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'
SQL (Oracle): SELECT CAST((SUM(CASE WHEN T3."DATE" = '1998-12-27' THEN CAST(T3.balance AS BINARY_DOUBLE) ELSE 0.0 END) - SUM(CASE WHEN T3."DATE" = '1993-03-22' THEN CAST(T3.balance AS BINARY_DOUBLE) ELSE 0.0 END)) AS BINARY_DOUBLE) * 100 / SUM(CASE WHEN T3."DATE" = '1993-03-22' THEN CAST(T3.balance AS BINARY_DOUBLE) ELSE 0.0 END) FROM loan T1 INNER JOIN account T2 ON T1.account_id = T2.account_id INNER JOIN trans T3 ON T3.account_id = T2.account_id WHERE T1."DATE" = '1993-07-05'

Question: What is the percentage of loan amount that has been fully paid with no issue.
Evidence: Loan paid with no issue means contract finished, no problems; status = 'A' means contract finished, no problems; Percentage of accounts by condition = [(total(amount) & condition) / (total amount)] * 100%
SQL (SQLite): SELECT (CAST(SUM(CASE WHEN status = 'A' THEN amount ELSE 0 END) AS REAL) * 100) / SUM(amount) FROM loan
SQL (SQL Server): SELECT (TRY_CAST(SUM(CASE WHEN status = 'A' THEN amount ELSE 0 END) AS FLOAT) * 100) / SUM(amount) AS _agg1 FROM loan
SQL (Oracle): SELECT (CAST(SUM(CASE WHEN status = 'A' THEN CAST(amount AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100) / SUM(amount) FROM loan

Question: For loan amount less than USD100,000, what is the percentage of accounts that is still running with no issue.
Evidence: Status = 'C' stands for running contract, ok so far; Percentage of accounts by condition = [(total(amount) & condition) / (total amount)] * 100.
SQL (SQLite): SELECT CAST(SUM(status = 'C') AS REAL) * 100 / COUNT(account_id) FROM loan WHERE amount < 100000
SQL (SQL Server): SELECT TRY_CAST(SUM(CASE WHEN status = 'C' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(account_id) AS _agg1 FROM loan WHERE amount < 100000
SQL (Oracle): SELECT CAST(SUM(CASE WHEN status = 'C' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(account_id) FROM loan WHERE amount < 100000
Database: financial

Question: 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.
Evidence: Unemployment increment rate in percentage = [(unemployment rate 2016 - unemployment rate 2015) / unemployment rate 2015] * 100; unemployment rate 2015 appears in the A12; unemployment rate 2016 appears in the A13; Loan contracts which are still running where client are in debt can be presented as status = 'D'
SQL (SQLite): 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'
SQL (SQL Server): SELECT TRY_CAST((T3.A13 - T3.A12) AS FLOAT) * 100 / NULLIF(T3.A12, 0) 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'
SQL (Oracle): SELECT CAST((T3.A13 - T3.A12) AS BINARY_DOUBLE) * 100 / NULLIF(T3.A12, 0) FROM loan T1 INNER JOIN account T2 ON T1.account_id = T2.account_id INNER JOIN district T3 ON T2.district_id = T3.district_id WHERE T1.status = 'D'

Question: List the top nine districts, by descending order, from the highest to the lowest, the number of female account holders.
Evidence: A2 refers to districts; Female refers to gender = 'F'
SQL (SQLite): SELECT T2.A2, COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'F' GROUP BY T2.district_id, T2.A2 ORDER BY COUNT(T1.client_id) DESC LIMIT 9
SQL (SQL Server): SELECT T2.A2, COUNT(T1.client_id) AS _agg1 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 OFFSET 0 ROWS FETCH NEXT 9 ROWS ONLY
SQL (Oracle): SELECT T2.A2, COUNT(T1.client_id) FROM client T1 INNER JOIN district 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 NULLS LAST FETCH FIRST 9 ROWS ONLY

Question: 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?
Evidence: Frequency = 'POPLATEK MESICNE' stands for monthly issurance
SQL (SQLite): 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
SQL (SQL Server): SELECT COUNT(T1.account_id) AS _agg1 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
SQL (Oracle): SELECT COUNT(T1.account_id) FROM account T1 INNER JOIN loan 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
Database: financial

Question: How many accounts have running contracts in Branch location 1?
Evidence: Status = 'C' stands for running contract, OK so far; Status = 'D' stands for running contract, client in debt
SQL (SQLite): 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')
SQL (SQL Server): SELECT COUNT(T1.account_id) AS _agg1 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')
SQL (Oracle): SELECT COUNT(T1.account_id) FROM account T1 INNER JOIN district T2 ON T1.district_id = T2.district_id INNER JOIN loan T3 ON T1.account_id = T3.account_id WHERE T1.district_id = 1 AND (T3.status = 'C' OR T3.status = 'D')

Question: In the branch where the second-highest number of crimes were committed in 1995 occurred, how many male clients are there?
Evidence: Male refers to gender = 'M'; A15 stands for no. of commited crimes 1995
SQL (SQLite): 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)
SQL (SQL Server): SELECT COUNT(T1.client_id) AS _agg1 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 OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY)
SQL (Oracle): SELECT COUNT(T1.client_id) FROM client T1 INNER JOIN district T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'M' AND T2.A15 = (SELECT T3.A15 FROM district T3 ORDER BY T3.A15 DESC NULLS LAST OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY)

Question: Which are the top ten withdrawals (non-credit card) by district names for the month of January 1996?
Evidence: Non-credit card withdraws refers to type = 'VYDAJ'; January 1996 can be found by date LIKE '1996-01%' in the database; A2 means district names
SQL (SQLite): SELECT DISTINCT T1.A2 FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id WHERE T3.type = 'VYDAJ' AND T3.date LIKE '1996-01%' ORDER BY A2 ASC LIMIT 10
SQL (SQL Server): SELECT T1.A2 FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id INNER JOIN trans AS T3 ON T2.account_id = T3.account_id WHERE T3.type = 'VYDAJ' AND T3.date LIKE '1996-01%' GROUP BY T1.A2 ORDER BY MIN(A2) ASC OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
SQL (Oracle): SELECT T1.A2 FROM district T1 INNER JOIN account T2 ON T1.district_id = T2.district_id INNER JOIN trans T3 ON T2.account_id = T3.account_id WHERE T3."TYPE" = 'VYDAJ' AND T3."DATE" LIKE '1996-01%' GROUP BY T1.A2 ORDER BY MIN(A2) ASC NULLS FIRST FETCH FIRST 10 ROWS ONLY
Database: financial

Question: How many accounts have running contracts in Branch location 1?
Evidence: Status = 'C' stands for running contract, OK so far; Status = 'D' stands for running contract, client in debt
SQL (SQLite): 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')
SQL (SQL Server): SELECT COUNT(T1.account_id) AS _agg1 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')
SQL (Oracle): SELECT COUNT(T1.account_id) FROM account T1 INNER JOIN district T2 ON T1.district_id = T2.district_id INNER JOIN loan T3 ON T1.account_id = T3.account_id WHERE T1.district_id = 1 AND (T3.status = 'C' OR T3.status = 'D')

Question: In the branch where the second-highest number of crimes were committed in 1995 occurred, how many male clients are there?
Evidence: Male refers to gender = 'M'; A15 stands for no. of commited crimes 1995
SQL (SQLite): 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)
SQL (SQL Server): SELECT COUNT(T1.client_id) AS _agg1 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 OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY)
SQL (Oracle): SELECT COUNT(T1.client_id) FROM client T1 INNER JOIN district T2 ON T1.district_id = T2.district_id WHERE T1.gender = 'M' AND T2.A15 = (SELECT T3.A15 FROM district T3 ORDER BY T3.A15 DESC NULLS LAST OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY)

Question: Who are the account holder identification numbers whose who have transactions on the credit card with the amount is less than the average, in 1998?
Evidence: Operation = 'VYBER KARTOU' refers to credit card withdrawal
SQL (SQLite): 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')
SQL (SQL Server): SELECT T1.account_id FROM trans AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id WHERE YEAR(T1.date) = '1998' AND T1.operation = 'VYBER KARTOU' AND T1.amount < (SELECT AVG(TRY_CAST(amount AS FLOAT)) AS _agg1 FROM trans WHERE YEAR(date) = '1998')
SQL (Oracle): SELECT T1.account_id FROM trans T1 INNER JOIN account T2 ON T1.account_id = T2.account_id WHERE SUBSTR(T1."DATE", 1, 4) = '1998' AND T1.operation = 'VYBER KARTOU' AND T1.amount < (SELECT AVG(amount) FROM trans WHERE SUBSTR("DATE", 1, 4) = '1998')
Database: financial

Question: 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.
Evidence: A11 represents the average salary; Salary and income share the similar meanings; when the account type = 'OWNER', it's eligible for loans
SQL (SQLite): 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
SQL (SQL Server): 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
SQL (Oracle): SELECT T3."TYPE" FROM district T1 INNER JOIN account T2 ON T1.district_id = T2.district_id INNER JOIN disp T3 ON T2.account_id = T3.account_id WHERE T3."TYPE" != 'OWNER' AND T1.A11 BETWEEN 8000 AND 9000

Question: 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?
Evidence: A3 refers to region names; A15 stands for the average number of crimes commited in 1995.
SQL (SQLite): 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
SQL (SQL Server): SELECT AVG(TRY_CAST(T1.A15 AS FLOAT)) AS _agg1 FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id WHERE YEAR(T2.date) >= '1997' AND T1.A15 > 4000
SQL (Oracle): SELECT AVG(T1.A15) FROM district T1 INNER JOIN account T2 ON T1.district_id = T2.district_id WHERE SUBSTR(T2."DATE", 1, 4) >= '1997' AND T1.A15 > 4000

Question: List all the withdrawals in cash transactions that the client with the id 3356 makes.
Evidence: operation = 'VYBER' refers to withdrawal in cash
SQL (SQLite): 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'
SQL (SQL Server): 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'
SQL (Oracle): SELECT T4.trans_id FROM client T1 INNER JOIN disp T2 ON T1.client_id = T2.client_id INNER JOIN account T3 ON T2.account_id = T3.account_id INNER JOIN trans T4 ON T3.account_id = T4.account_id WHERE T1.client_id = 3356 AND T4.operation = 'VYBER'
Database: financial

Question: What percentage of clients who opened their accounts in the district with an average salary of over 10000 are women?
Evidence: Female refers to gender = 'F'; Woman and female are closed; Average salary can be found in A11
SQL (SQLite): 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
SQL (SQL Server): SELECT TRY_CAST(SUM(CASE WHEN T2.gender = 'F' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(T2.client_id) AS _agg1 FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.A11 > 10000
SQL (Oracle): SELECT CAST(SUM(CASE WHEN T2.gender = 'F' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(T2.client_id) FROM district T1 INNER JOIN client T2 ON T1.district_id = T2.district_id WHERE T1.A11 > 10000

Question: What was the growth rate of the total amount of loans across all accounts for a male client between 1996 and 1997?
Evidence: Growth rate = (sum of amount_1997 - sum of amount_1996) / (sum of amount_1996) * 100%; Male refers to gender = 'M'
SQL (SQLite): 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'
SQL (SQL Server): SELECT TRY_CAST((SUM(CASE WHEN YEAR(T1.date) = '1997' THEN T1.amount ELSE 0 END) - SUM(CASE WHEN YEAR(T1.date) = '1996' THEN T1.amount ELSE 0 END)) AS FLOAT) * 100 / SUM(CASE WHEN YEAR(T1.date) = '1996' THEN T1.amount ELSE 0 END) AS _agg1 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'
SQL (Oracle): SELECT CAST((SUM(CASE WHEN SUBSTR(T1."DATE", 1, 4) = '1997' THEN CAST(T1.amount AS BINARY_DOUBLE) ELSE 0.0 END) - SUM(CASE WHEN SUBSTR(T1."DATE", 1, 4) = '1996' THEN CAST(T1.amount AS BINARY_DOUBLE) ELSE 0.0 END)) AS BINARY_DOUBLE) * 100 / SUM(CASE WHEN SUBSTR(T1."DATE", 1, 4) = '1996' THEN CAST(T1.amount AS BINARY_DOUBLE) ELSE 0.0 END) FROM loan T1 INNER JOIN account T2 ON T1.account_id = T2.account_id INNER JOIN disp T3 ON T3.account_id = T2.account_id INNER JOIN client T4 ON T4.client_id = T3.client_id WHERE T4.gender = 'M' AND T3."TYPE" = 'OWNER'
Database: financial

Question: How often does account number 3 request an account statement to be released? What was the aim of debiting 3539 in total?
Evidence: k_symbol refers to the purpose of payments
SQL (SQLite): SELECT T1.frequency, T2.k_symbol FROM account AS T1 INNER JOIN (SELECT account_id, k_symbol, SUM(amount) AS total_amount FROM `order` GROUP BY account_id, k_symbol) AS T2 ON T1.account_id = T2.account_id WHERE T1.account_id = 3 AND T2.total_amount = 3539
SQL (SQL Server): SELECT T1.frequency, T2.k_symbol FROM account AS T1 INNER JOIN (SELECT account_id, k_symbol, SUM(amount) AS total_amount FROM [order] GROUP BY account_id, k_symbol) AS T2 ON T1.account_id = T2.account_id WHERE T1.account_id = 3 AND T2.total_amount = 3539
SQL (Oracle): SELECT T1.frequency, T2.k_symbol FROM account T1 INNER JOIN (SELECT account_id, k_symbol, SUM(amount) total_amount FROM "ORDER" GROUP BY account_id, k_symbol) T2 ON T1.account_id = T2.account_id WHERE T1.account_id = 3 AND T2.total_amount = 3539

Question: What percentage of male clients request for weekly statements to be issued?
Evidence: Percentage of male clients = [count(male clients who requested weekly statements / count(clients who requested weekly statements)] * 100%; Male means gender = 'M'; 'POPLATEK TYDNE' stands for weekly issuance
SQL (SQLite): SELECT CAST(SUM(T1.gender = 'M') AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN district AS T3 ON T1.district_id = T3.district_id INNER JOIN account AS T2 ON T2.district_id = T3.district_id INNER JOIN disp as T4 on T1.client_id = T4.client_id AND T2.account_id = T4.account_id WHERE T2.frequency = 'POPLATEK TYDNE'
SQL (SQL Server): SELECT TRY_CAST(SUM(CASE WHEN T1.gender = 'M' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(T1.client_id) AS _agg1 FROM client AS T1 INNER JOIN district AS T3 ON T1.district_id = T3.district_id INNER JOIN account AS T2 ON T2.district_id = T3.district_id INNER JOIN disp as T4 on T1.client_id = T4.client_id AND T2.account_id = T4.account_id WHERE T2.frequency = 'POPLATEK TYDNE'
SQL (Oracle): SELECT CAST(SUM(CASE WHEN T1.gender = 'M' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(T1.client_id) FROM client T1 INNER JOIN district T3 ON T1.district_id = T3.district_id INNER JOIN account T2 ON T2.district_id = T3.district_id INNER JOIN disp T4 on T1.client_id = T4.client_id AND T2.account_id = T4.account_id WHERE T2.frequency = 'POPLATEK TYDNE'
Database: financial

Question: Name the account numbers of female clients who are oldest and have lowest average salary?
Evidence: Female refers to 'F' in the gender; A11 contains information about average salary
SQL (SQLite): 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 INNER JOIN disp AS T4 ON T1.client_id = T4.client_id AND T4.account_id = T3.account_id  WHERE T1.gender = 'F' ORDER BY T1.birth_date ASC, T2.A11 ASC LIMIT 1
SQL (SQL Server): 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 INNER JOIN disp AS T4 ON T1.client_id = T4.client_id AND T4.account_id = T3.account_id  WHERE T1.gender = 'F' ORDER BY T1.birth_date ASC, T2.A11 ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T3.account_id FROM client T1 INNER JOIN district T2 ON T1.district_id = T2.district_id INNER JOIN account T3 ON T2.district_id = T3.district_id INNER JOIN disp T4 ON T1.client_id = T4.client_id AND T4.account_id = T3.account_id  WHERE T1.gender = 'F' ORDER BY T1.birth_date ASC NULLS FIRST, T2.A11 ASC NULLS FIRST FETCH FIRST 1 ROWS ONLY

Question: What is the average amount of loan which are still on running contract with statement issuance after each transaction?
Evidence: status = 'C' stands for running contract, OK so far; status = 'D' stands for running contract, client in debt. 'POPLATEK PO OBRATU' stands for issuance after transaction
SQL (SQLite): SELECT AVG(T2.amount) 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'
SQL (SQL Server): SELECT AVG(TRY_CAST(T2.amount AS FLOAT)) AS _agg1 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'
SQL (Oracle): SELECT AVG(T2.amount) FROM account T1 INNER JOIN loan T2 ON T1.account_id = T2.account_id WHERE T2.status IN ('C', 'D') AND T1.frequency = 'POPLATEK PO OBRATU'

Question: Provide the IDs and age of the client with high level credit card, which is eligible for loans.
Evidence: the credit card is high-level refers to card.type = 'gold'; eligible for loans refers to disp.type = 'OWNER'
SQL (SQLite): 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'
SQL (SQL Server): SELECT T1.client_id, YEAR(CURRENT_TIMESTAMP) - YEAR(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'
SQL (Oracle): SELECT T1.client_id, TO_CHAR(CURRENT_TIMESTAMP, 'YYYY') - SUBSTR(T3.birth_date, 1, 4) FROM disp T1 INNER JOIN card T2 ON T2.disp_id = T1.disp_id INNER JOIN client T3 ON T1.client_id = T3.client_id WHERE T2."TYPE" = 'gold' AND T1."TYPE" = 'OWNER'