Dataset Viewer
Auto-converted to Parquet
question
stringlengths
13
765
query
stringlengths
20
406
db_id
stringclasses
2 values
What is the client_id of accounts?
SELECT client_id FROM Accounts
loan_db
What is the name of the beneficiary country?
SELECT country_name FROM Beneficiary
transactions_db
What is the name of the email of the client with a gender "male"?
SELECT email, first_name FROM Clients WHERE gender = "Male"
loan_db
What is the account_id of the deposit with a deposit_id in (99619, 97683) and a source in ('Cash', 'Transaction')?
SELECT account_id FROM Deposits WHERE deposit_id IN (99619, 97683) AND source IN ('Cash', 'Transaction')
loan_db
What is the beneficiary_id, counterparty_donor_id, and the total amount of currency left for the transactions are all join source on the primary contract_id of the primary contract_id, when amount_currency is "nzd", or when the beneficiary_id belongs in the group (96893, 85625) by the transaction amount?
SELECT Transactions.beneficiary_id, Source.counterparty_donor_id, COUNT(Transactions.amount_currency) FROM Transactions LEFT JOIN Source ON Transactions.primary_contract_id = Source.primary_contract_id WHERE amount_currency = "NZD" OR beneficiary_id IN (96893, 85625) GROUP BY transaction_amount
transactions_db
What is the hour number of the game?
SELECT hour_number FROM Time
transactions_db
What is the branch identification of the beneficiary?
SELECT bank_branch_id FROM Beneficiary
transactions_db
What is beneficiary_id?
SELECT beneficiary_id FROM Beneficiary
transactions_db
What is the primary contract id, the client id when the primary contract id is different than 87589 and the client id is smaller than 80710?
SELECT primary_contract_id, client_id FROM Source WHERE primary_contract_id <> 87589 AND client_id <> 80710
transactions_db
What is the is_fraudulent, timestamp id of the transactions?
SELECT is_fraudulent, timestamp_id FROM Transactions
transactions_db
What is the Account_ID, client_id of accounts?
SELECT account_id, client_id FROM Accounts
loan_db
What is the day number, week number of the game?
SELECT day_number, week_number FROM Time
transactions_db
What is the counterparty_donor_id?
SELECT counterparty_donor_id FROM Source
transactions_db
What is the source of account_id for deposits?
SELECT source, account_id FROM Deposits
loan_db
What is the name of the account?
SELECT * FROM Accounts
loan_db
How many loans have a duration smaller than 5 and an interest greater than 14?
SELECT COUNT(interest) FROM Loans WHERE duration <= 5 AND interest >= 14
loan_db
What is the name, day number of the game?
SELECT day_name, day_number FROM Time
transactions_db
What is the name of the first client?
SELECT first_name FROM Clients
loan_db
What is the client_id, primary contract_id in (64348, 71211) and a counterparty_donor_id different than 46339?
SELECT client_id, primary_contract_id FROM Source WHERE client_id IN (64348, 71211) AND NOT counterparty_donor_id <> 46339
transactions_db
How many days have a number of hours smaller than 18?
SELECT COUNT(day_name) FROM Time WHERE hour_number < 18
transactions_db
How many transactions have a different amount on the currency than "AUD "?
SELECT COUNT(product_family_code), timestamp_id FROM Transactions WHERE amount_currency <> "AUD"
transactions_db
What is the client_id of the account with a type in ('Loan account', 'Saving account', 'Deposit account') or a client_id different from 86565?
SELECT client_id FROM Accounts WHERE type IN ('Loan account', 'Saving account', 'Deposit account') OR client_id <> 86565
loan_db
What is the country code of the beneficiary?
SELECT country_code FROM Beneficiary
transactions_db
What is the counterparty_bank branch ID?
SELECT counterparty_bank_branch_id FROM Source
transactions_db
What is the bank_branch_id, country name of the beneficiary with a country code that is different than BE and a bank branch-id of 20143?
SELECT bank_branch_id, country_name FROM Beneficiary WHERE NOT country_code <> BE AND bank_branch_id = 20143
transactions_db
What is the day number of the hour number between 2 and 24 or the year between 2007 and 2010?
SELECT day_number FROM Time WHERE hour_number BETWEEN 2 AND 24 OR year BETWEEN 2007 AND 2010
transactions_db
What is the Account_id, balance of the account with a balance between 820204 and 933588?
SELECT account_id, balance FROM Accounts WHERE balance BETWEEN 820204 AND 933588
loan_db
What is the source of deposits?
SELECT source FROM Deposits
loan_db
What is the client_id, deposit_id, and total number of types of accounts that join deposits via account ID of account_id when the type is the "deposit account" group by balance?
SELECT Accounts.client_id, Deposits.deposit_id, COUNT(Accounts.type) FROM Accounts JOIN Deposits ON Accounts.account_id = Deposits.account_id WHERE Accounts.type LIKE "Deposit account" GROUP BY Accounts.balance
loan_db
How many countries have a bank branch ID in (10448, 34142)?
SELECT COUNT(country_name) FROM Beneficiary WHERE bank_branch_id IN (10448, 34142)
transactions_db
What is the month number, day name of the episode with a week number less than 7?
SELECT month_number, day_name FROM Time WHERE week_number <= 7
transactions_db
How many customers have a client_id of 94594?
SELECT COUNT(client_id), balance FROM Accounts WHERE client_id = 94594
loan_db
What is the transaction_amount and transaction_id?
SELECT transaction_amount, transaction_id FROM Transactions
transactions_db
What is the type, account_id of the account with a client_id different from 20126 or a type in ('saving account', 'deposit account', 'loan account')?
SELECT type, account_id FROM Accounts WHERE client_id <> 20126 OR type IN ('Saving account', 'Deposit account', 'Loan account')
loan_db
What is the interest, duration of loan?
SELECT interest, duration FROM Loans
loan_db
What is the amount of currency, hour number, total number of product family code, client_id for transactions that joint time on timestamp_id of timestamp_id when beneficiary_id is different from 98589 or product family code is smaller than 73313 of the group by client_id?
SELECT Transactions.amount_currency, Time.hour_number, COUNT(Transactions.product_family_code), Transactions.client_id FROM Transactions JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE beneficiary_id <> 98589 OR product_family_code <> 73313 GROUP BY client_id
transactions_db
What is the source, amount of deposits?
SELECT source, amount FROM Deposits
loan_db
What is the deposit amount?
SELECT * FROM Deposits
loan_db
What is the client_id, year and total number of is_fraudulent transactions that have a time on timestamp_id on timestamp_id, when primary contract id is different from 89494 GROUP by is_fraudulent?
SELECT Transactions.client_id, Time.year, COUNT(Transactions.is_fraudulent) FROM Transactions JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE primary_contract_id <> 89494 GROUP BY is_fraudulent
transactions_db
What is the balance of accounts?
SELECT balance FROM Accounts
loan_db
What is the total deposit_ID amount when the deposit_id is different than the group 76095 and the deposit_id is not equal to 647944 and 727241?
SELECT COUNT(deposit_id), amount FROM Deposits WHERE NOT amount BETWEEN 647944 AND 727241 AND deposit_id <> 76095 GROUP BY source
loan_db
What is the deposit_id of the account with an account number different than 73301 and a deposit number smaller than 66202?
SELECT deposit_id FROM Deposits WHERE account_id <> 73301 AND deposit_id <> 66202
loan_db
What is the beneficiary_id and counterparty_donor_id, and the total amount of currency for the transaction with a primary contract-id of the primary contract-id with a product_family_code in (94637, 91241) and a client-id in (91537, 65516) by product_family_code?
SELECT Transactions.beneficiary_id, Source.counterparty_donor_id, COUNT(Transactions.amount_currency) FROM Transactions JOIN Source ON Transactions.primary_contract_id = Source.primary_contract_id WHERE product_family_code IN (94637, 91241) AND client_id IN (91537, 65516) GROUP BY product_family_code
transactions_db
How many loans have a budget of 962179 or a interest higher than 13?
SELECT COUNT(*) FROM Loans WHERE budget = 962179 OR interest > 13
loan_db
What is the branch id of the counterparty bank, the donor id of the counterparty bank?
SELECT counterparty_bank_branch_id, counterparty_donor_id FROM Source
transactions_db
What is the counterparty_donor_id?
SELECT counterparty_donor_id FROM Source
transactions_db
What is the balance, account_id of the account with a client_id of 74547 and a balance larger than 459541?
SELECT balance, account_id FROM Accounts WHERE client_id = 74547 AND balance >= 459541
loan_db
What is the name of the country and bank branch id of the beneficiary with a country name different from "Germany" and a beneficiary id of 24214?
SELECT country_name, bank_branch_id FROM Beneficiary WHERE country_name <> "Germany" AND beneficiary_id = 24214
transactions_db
What is the lowest day number for the day number between 10 and 30?
SELECT MIN(day_number) FROM Time WHERE day_number BETWEEN 10 AND 30
transactions_db
What is the client_id of accounts?
SELECT client_id FROM Accounts
loan_db
How many bank branch ids, country codes for the beneficiary with a country_name ('France', 'Germany', 'Canada', 'USA', 'England', 'Belgium') or bank branch id (54748, 48948) are there?
SELECT COUNT(bank_branch_id), country_code FROM Beneficiary WHERE country_name IN ('France', 'Germany', 'Canada', 'USA', 'England', 'Belgium') OR bank_branch_id IN (54748, 48948)
transactions_db
What is the account_id of deposits?
SELECT account_id FROM Deposits
loan_db
What is the product_family_code, the timestamp_id for transactions?
SELECT product_family_code, timestamp_id FROM Transactions
transactions_db
What is the Account_ID, source of the deposits?
SELECT account_id, source FROM Deposits
loan_db
What is the name, balance, number of the first-name, gender of the client with a birth year different than 1968 and first-name in the group ('Johnson', 'Hernandez', 'Edwards') by last-names?
SELECT Clients.city, Accounts.balance, COUNT(Clients.first_name), Clients.gender FROM Clients INNER JOIN Accounts ON Clients.client_id = Accounts.client_id WHERE Clients.year_of_birth <> 1968 AND Clients.first_name IN ('Johnson', 'Hernandez', 'Edwards') GROUP BY Clients.last_name
loan_db
What is the unique loan_ID and the status of the loan?
SELECT DISTINCT loan_id, status FROM Loans
loan_db
What is the unique account_ID, interest rate and total balance of the account with a different type than the group "Loan account" by balance?
SELECT DISTINCT Accounts.account_id, Loans.interest, COUNT(Accounts.balance) FROM Accounts INNER JOIN Loans ON Accounts.client_id = Loans.client_id WHERE Accounts.type <> "Loan account" GROUP BY Accounts.balance
loan_db
What is the transaction_amount and product_family_code when primary contract id is different than 93254?
SELECT transaction_amount, product_family_code FROM Transactions WHERE primary_contract_id <> 93254
transactions_db
What is the transaction_id, counterparty_donor_id, total number of client-id, product_family_code for the transaction with the amount in the ('CAD', 'CHF', 'NZD') group for amount?
SELECT Transactions.transaction_id, Source.counterparty_donor_id, COUNT(Transactions.client_id), Transactions.product_family_code FROM Transactions JOIN Source ON Transactions.primary_contract_id = Source.primary_contract_id WHERE amount_currency IN ('CAD', 'CHF', 'NZD') GROUP BY amount_currency
transactions_db
What is the budget, gender, total interest rate and status of the loan for joining clients with a loan id different than 98427 or status of the "overdue" group?
SELECT Loans.budget, Clients.gender, COUNT(Loans.status), Loans.interest FROM Loans JOIN Clients ON Loans.client_id = Clients.client_id WHERE Loans.loan_id <> 98427 OR Loans.status = "overdue" GROUP BY Loans.loan_id
loan_db
How many loans have an interest greater than 13, or a client_id of 33794 group by duration?
SELECT COUNT(interest) FROM Loans WHERE interest >= 13 OR client_id = 33794 GROUP BY duration
loan_db
What is the name of the beneficiary and beneficiary id with a beneficiary id of 35944 and country code ('UK', 'US', 'CA', 'LU', 'BE', 'FR')?
SELECT country_name, beneficiary_id FROM Beneficiary WHERE beneficiary_id = 35944 AND country_code IN ('UK', 'US', 'CA', 'LU', 'BE', 'FR')
transactions_db
What is the week number, hour number of the episode with a month number less than 3?
SELECT week_number, hour_number FROM Time WHERE NOT month_number <= 3
transactions_db
What is the source of deposits?
SELECT source FROM Deposits
loan_db
What is what is clients when the year of birth is less than 2006?
SELECT * FROM Clients WHERE NOT year_of_birth > 2006
loan_db
What is the name of the client?
SELECT last_name FROM Clients
loan_db
What is the name of the account?
SELECT * FROM Accounts
loan_db
What is the primary contract ID if the primary contract ID is different than 96557 or the client ID is smaller than 92216?
SELECT primary_contract_id FROM Source WHERE primary_contract_id <> 96557 OR client_id <> 92216
transactions_db
What is the client_id and type of account?
SELECT client_id, type FROM Accounts
loan_db
What is the transaction_id and amount currency of transactions?
SELECT transaction_id, amount_currency FROM Transactions
transactions_db
What is the client_id, bank branch_id and transaction_amount of the transaction with a beneficiary ID of beneficiary_id when the timestamp_id is 99726 group by is_fraudulent?
SELECT Transactions.client_id, Beneficiary.bank_branch_id, COUNT(Transactions.transaction_amount) FROM Transactions JOIN Beneficiary ON Transactions.beneficiary_id = Beneficiary.beneficiary_id WHERE timestamp_id = 99726 GROUP BY is_fraudulent
transactions_db
What is the client_id of the source?
SELECT client_id FROM Source
transactions_db
What is the timestamp_id of the transaction with is_fraudulent of "yes"?
SELECT timestamp_id FROM Transactions WHERE is_fraudulent = "Yes"
transactions_db
What is the counterparty_donor_id?
SELECT counterparty_donor_id FROM Source
transactions_db
What is the fraud code for product family transactions with a transaction id of 91273?
SELECT is_fraudulent, product_family_code FROM Transactions WHERE transaction_id = 91273
transactions_db
What is the name of the first email address for clients?
SELECT first_name, email FROM Clients
loan_db
What is the counterparty_bank branch ID of the source?
SELECT counterparty_bank_branch_id, client_id FROM Source
transactions_db
What is the counterparty_donor_id of the contract with a counterparty_donor_id in (70369, 80136) and primary contract_id of 71042?
SELECT counterparty_donor_id FROM Source WHERE counterparty_donor_id IN (70369, 80136) AND primary_contract_id = 71042
transactions_db
What is the client_id and transaction_id of the transaction with the beneficiary_id in (20622, 1092) and the client-id of 87486?
SELECT client_id, transaction_id FROM Transactions WHERE beneficiary_id IN (20622, 1092) AND client_id = 87486
transactions_db
What is the day number, timestamp id of the time when the day number is different than 25?
SELECT day_number, timestamp_id FROM Time WHERE day_number <> 25
transactions_db
What is the unique loan_ID and the status of the loan?
SELECT DISTINCT loan_id, status FROM Loans
loan_db
What is balance, client_ID of accounts?
SELECT balance, client_id FROM Accounts
loan_db
What is the primary contract id, transaction id of transactions?
SELECT primary_contract_id, transaction_id FROM Transactions
transactions_db
What is the primary contract ID for the contract ID (15115, 76959)?
SELECT primary_contract_id FROM Source WHERE primary_contract_id IN (15115, 76959)
transactions_db
What is the deposit_id amount in (60785, 81175) or less than 107712?
SELECT amount, source FROM Deposits WHERE amount <= 107712 OR deposit_id IN (60785, 81175)
loan_db
What is balance, account_ID of the account with a type in ('saving account', 'deposit account')?
SELECT balance, account_id FROM Accounts WHERE type IN ('Saving account', 'Deposit account')
loan_db
What is the amount of the account with a deposit_id of 94879?
SELECT amount, account_id FROM Deposits WHERE deposit_id = 94879
loan_db
What is the name of the client?
SELECT last_name FROM Clients
loan_db
What is the status, interest of loan on an interest of 7?
SELECT status, interest FROM Loans WHERE interest = 7
loan_db
What is is_fraudulent, counterparty_donor_id, total number of product-family-codes for the transaction in the inner connection source with a transaction_amount of 47707 by transaction_id?
SELECT Transactions.is_fraudulent, Source.counterparty_donor_id, COUNT(Transactions.product_family_code) FROM Transactions INNER JOIN Source ON Transactions.primary_contract_id = Source.primary_contract_id WHERE transaction_amount = 47707 GROUP BY transaction_id
transactions_db
What is the unique first name of the client?
SELECT DISTINCT first_name FROM Clients
loan_db
What is the source, client_id, total number of deposits in the account_id with an amount less than 152611 group by source?
SELECT Deposits.source, Accounts.client_id, COUNT(Deposits.amount), Deposits.deposit_id FROM Deposits INNER JOIN Accounts ON Deposits.account_id = Accounts.account_id WHERE Deposits.amount < 152611 GROUP BY Deposits.source
loan_db
What is the name, gender and first name of the client?
SELECT gender, first_name FROM Clients
loan_db
How many customers left to join loans on client_id of client_id for a city like the group "New York city" by last_name?
SELECT COUNT(*) FROM Clients LEFT JOIN Loans ON Clients.client_id = Loans.client_id WHERE Clients.city LIKE "New York City" GROUP BY Clients.last_name
loan_db
What is the deposit_id and the quantity of deposits?
SELECT deposit_id, amount FROM Deposits
loan_db
What type of accounts has different account_id than 22571?
SELECT type FROM Accounts WHERE NOT account_id <> 22571
loan_db
What is the name of the day of the game?
SELECT day_name FROM Time
transactions_db
What is the name, balance, and total number of years of birth in the city where the birth year is 1959 and 2001 group by city?
SELECT Clients.first_name, Accounts.balance, COUNT(Clients.year_of_birth), Clients.city FROM Clients INNER JOIN Accounts ON Clients.client_id = Accounts.client_id WHERE Clients.year_of_birth BETWEEN 1959 AND 2001 GROUP BY Clients.city
loan_db
How many accounts have an account_id in (86196, 90626) or client_id that is different than 90037 Group by client_id?
SELECT COUNT(*) FROM Accounts WHERE account_id IN (86196, 90626) OR NOT client_id <> 90037 GROUP BY client_id
loan_db
What are the clients?
SELECT * FROM Clients
loan_db
End of preview. Expand in Data Studio

BanQies

Dataset Summary

BanQies is a large-scale, complex, domain-specific text-to-SQL dataset generated using SelectCraft. The goal of SelectCraft is to enable the automatic generation of domain-specific text-to-SQL datasets, with BanQies serving as a use case in the financial domain.

Data Fields

  • db_id: Name of the database associated with the query
  • question: Natural language question to be translated into SQL
  • query: Ground truth SQL query corresponding to the question

Data Splits

  • train: 630.000 question–SQL query pairs
  • test1: 70.000 question–SQL query pairs
  • test2: 1000 question–SQL query pairs
  • hand crafted test: 80 question–SQL query pairs

Databases

  1. Loan_DB:

CREATE TABLE Loans \n{ \n loan_id number, \n client_id number, \n budget real, \n duration number, \n interest real, \n status varchar \n} \n CREATE TABLE Clients \n{ \n client_id number, \n first_name varchar, \n last_name varchar, \n email varchar, \n city varchar, \n year_of_birth number \n} \n CREATE TABLE Accounts \n{ \n account_id number, \n client_id number, \n balance real, \n type varchar \n} \n CREATE TABLE Deposits \n{ \n deposit_id number, \n account_id number, \n source varchar, \n amount real \n} \n

  1. Transactions_DB:

CREATE TABLE Transactions \n{ \n transaction_id number, \n timestamp_id number, \n primary_contract_id number, \n client_id number, \n beneficiary_id number, \n transaction_amount real, \n is_fraudulent boolean, \n product_family_code varchar, \n amount_currency varchar \n} \n CREATE TABLE Beneficiary \n{ \n beneficiary_id number, \n bank_branch_id number, \n country_name varchar, \n country_code varchar \n} \n CREATE TABLE Source \n{ \n primary_contract_id number, \n client_id number, \n counterparty_bank_branch_id number, \n counterparty_donor_id number \n} \n CREATE TABLE Time \n{ \n timestamp_id number, \n week_number number, \n day_number number, \n hour_number number, \n day_name varchar, \n year number, \n month_number number \n} \n

Citation

Downloads last month
88

Models trained or fine-tuned on salmane11/BanQies