question
stringlengths 13
765
| query
stringlengths 20
406
| db_id
stringclasses 2
values |
---|---|---|
What is the beneficiary_id and transaction_id of transactions?
|
SELECT beneficiary_id, transaction_id FROM Transactions
|
transactions_db
|
What are the clients?
|
SELECT * FROM Clients
|
loan_db
|
How many different numbers are there for the counterparty donor and primary contract ID when the client_id is different from 98284 group by counterparty-bank branch_id?
|
SELECT COUNT(counterparty_donor_id), primary_contract_id FROM Source WHERE client_id <> 98284 GROUP BY counterparty_bank_branch_id
|
transactions_db
|
What is the status of the loan?
|
SELECT status FROM Loans
|
loan_db
|
How many beneficiaries have a bank branch ID in (59328, 33931)?
|
SELECT COUNT(beneficiary_id) FROM Beneficiary WHERE bank_branch_id IN (59328, 33931)
|
transactions_db
|
How many beneficiaries have a bank branch ID different than 82504?
|
SELECT COUNT(beneficiary_id) FROM Beneficiary WHERE bank_branch_id <> 82504
|
transactions_db
|
What is the name of the account?
|
SELECT * FROM Accounts
|
loan_db
|
What is the duration, balance, total number of budget, status of the borrowed with an interest between 3 and 13 or a budget larger than 494429 Group by status?
|
SELECT Loans.duration, Accounts.balance, COUNT(Loans.budget), Loans.status FROM Loans LEFT JOIN Accounts ON Loans.client_id = Accounts.client_id WHERE Loans.interest BETWEEN 3 AND 13 OR Loans.budget >= 494429 GROUP BY Loans.status
|
loan_db
|
What is the product_family_code for the currency "eur"?
|
SELECT product_family_code FROM Transactions WHERE amount_currency LIKE "EUR"
|
transactions_db
|
What is the primary contract id for the transactions?
|
SELECT primary_contract_id FROM Transactions
|
transactions_db
|
What is the client_id of the loans?
|
SELECT client_id FROM Loans
|
loan_db
|
What is Clients when ClientID is (92053, 91415) or when year_of_birth is greater than 2001?
|
SELECT * FROM Clients WHERE client_id IN (92053, 91415) OR year_of_birth > 2001
|
loan_db
|
What year was the day number?
|
SELECT year, day_number FROM Time
|
transactions_db
|
What is beneficiary_id?
|
SELECT beneficiary_id FROM Beneficiary
|
transactions_db
|
What is what client is when Email is "(ma', ma')"?
|
SELECT * FROM Clients WHERE email IN ('young.williams@cs.ma', 'young.williams@cs.ma')
|
loan_db
|
What is the client_id of the primary contract-id in (58519, 74675)?
|
SELECT client_id FROM Source WHERE primary_contract_id IN (58519, 74675)
|
transactions_db
|
What is the country name of the beneficiary with a country code of "BE" or bank_branch id of 26790?
|
SELECT country_name FROM Beneficiary WHERE country_code = "BE" OR bank_branch_id = 26790
|
transactions_db
|
What is the beneficiary_id of the beneficiary whose country name is different than "Germany"?
|
SELECT beneficiary_id FROM Beneficiary WHERE country_name <> "Germany"
|
transactions_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 amount of currency, day_name, total client_id, transaction_amount for the transaction transaction amount between 99590 and 99893 and is_fraudulent is "yes" Group?
|
SELECT Transactions.amount_currency, Time.day_name, COUNT(Transactions.client_id), Transactions.transaction_amount FROM Transactions INNER JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE transaction_amount BETWEEN 99590 AND 99893 AND is_fraudulent = "Yes" GROUP BY amount_currency
|
transactions_db
|
How many beneficiaries have a country name (’ Belgium’, ‘ Luxembourg’, USA , Canada , France ?
|
SELECT COUNT(beneficiary_id), country_code FROM Beneficiary WHERE country_name IN ('Belgium', 'Luxembourg', 'USA', 'Canada', 'France')
|
transactions_db
|
What is the duration, gender and total number of loan-ids left with clients with a duration less than 28 and a status different by interest than the "overdue" group?
|
SELECT Loans.duration, Clients.gender, COUNT(Loans.loan_id) FROM Loans LEFT JOIN Clients ON Loans.client_id = Clients.client_id WHERE Loans.duration <= 28 AND Loans.status <> "overdue" GROUP BY Loans.interest
|
loan_db
|
What is the primary contract id, counterparty bank branch id of the bank?
|
SELECT primary_contract_id, counterparty_bank_branch_id FROM Source
|
transactions_db
|
How many customers have an email of ma?"
|
SELECT COUNT(gender), client_id FROM Clients WHERE email = "hughes.johnson@cs.ma"
|
loan_db
|
What is the name of the beneficiary country?
|
SELECT country_name FROM Beneficiary
|
transactions_db
|
What is the client’s email address?
|
SELECT email FROM Clients
|
loan_db
|
What is the unique source, account_id of deposits?
|
SELECT DISTINCT source, account_id FROM Deposits
|
loan_db
|
What is the budget for loans?
|
SELECT budget FROM Loans
|
loan_db
|
What day was the game played in the year?
|
SELECT day_name, year FROM Time
|
transactions_db
|
What is the account_id of deposits?
|
SELECT account_id FROM Deposits
|
loan_db
|
What is the sum of the loan amount on a client id 84161 and interest between 2 and 22?
|
SELECT SUM(budget) FROM Loans WHERE client_id = 84161 AND interest BETWEEN 2 AND 22
|
loan_db
|
How many deposits have a not(account_id in (5207, 56507)) group by source?
|
SELECT COUNT(account_id) FROM Deposits WHERE NOT(account_id IN (5207, 56507)) GROUP BY source
|
loan_db
|
What is the name, status, number of the first-name, year of birth of client with a client - ID of client - ID who is from a city different than Richmond or whose gender is the "Male" GROUP by email?
|
SELECT Clients.email, Loans.status, COUNT(Clients.first_name), Clients.year_of_birth FROM Clients JOIN Loans ON Clients.client_id = Loans.client_id WHERE Clients.city <> "Richmond" OR Clients.gender = "Male" GROUP BY Clients.email
|
loan_db
|
What is the gender of the client with a year of birth before 1997 and a gender like "male"?
|
SELECT gender, email FROM Clients WHERE year_of_birth < 1997 AND gender LIKE "Male"
|
loan_db
|
What is the client_id of accounts?
|
SELECT client_id FROM Accounts
|
loan_db
|
What is the client_id, month_number, total number of transactions with a time-on-time timestamp_id on timestamp_id when the primary contract-id is 91239 or is_fraudulent is different from the group by amount_currency?
|
SELECT Transactions.client_id, Time.month_number, COUNT(Transactions.product_family_code), Transactions.transaction_amount FROM Transactions JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE primary_contract_id = 91239 OR is_fraudulent <> "Yes" GROUP BY amount_currency
|
transactions_db
|
What is the sum of the budget for loans with a interest under 14?
|
SELECT SUM(budget) FROM Loans WHERE interest <= 14
|
loan_db
|
What is the client_id of the loan with a budget different than 934754 or a duration smaller than 27?
|
SELECT client_id FROM Loans WHERE budget <> 934754 OR duration <= 27
|
loan_db
|
What is the client_id and account_id of the account with a type like "Loan account"?
|
SELECT client_id, account_id FROM Accounts WHERE type LIKE "Loan account"
|
loan_db
|
What is the budget for loans?
|
SELECT budget FROM Loans
|
loan_db
|
What is the timestamp_id, week_number of the episode?
|
SELECT timestamp_id, week_number FROM Time
|
transactions_db
|
What is the unique account_ID and the quantity of deposits?
|
SELECT DISTINCT account_id, amount FROM Deposits
|
loan_db
|
What is the balance of accounts?
|
SELECT balance FROM Accounts
|
loan_db
|
What is the amount of the deposit with a source different than the transaction and an account_id of 97594?
|
SELECT amount, account_id FROM Deposits WHERE NOT source <> Transaction AND account_id = 97594
|
loan_db
|
What is the lowest transaction amount for beneficiary ID of 80810 or client ID of 94516?
|
SELECT MIN(transaction_amount) FROM Transactions WHERE beneficiary_id = 80810 OR client_id = 94516
|
transactions_db
|
How many bank branch ids are there for the beneficiary in (75096, 84855) and a country code in ('sale', 'be')?
|
SELECT COUNT(bank_branch_id) FROM Beneficiary WHERE bank_branch_id IN (75096, 84855) AND country_code IN ('US', 'BE')
|
transactions_db
|
What is the timestamp_id, transaction_amount of the transaction in a Product-family code of 91198 and amount_currency in ('GBP', 'CNH', 'JPY', 'AUD', 'CAD', 'NZD')?
|
SELECT timestamp_id, transaction_amount FROM Transactions WHERE NOT product_family_code = 91198 AND amount_currency IN ('GBP', 'CNH', 'JPY', 'AUD', 'CAD', 'NZD')
|
transactions_db
|
What is the client_id and account_id of the account with a balance of 945765?
|
SELECT client_id, account_id FROM Accounts WHERE balance = 945765
|
loan_db
|
What city was the client born in?
|
SELECT city, year_of_birth FROM Clients
|
loan_db
|
How many loans have a status of "paid off" or loan_id in (70846, 76070)?
|
SELECT COUNT(duration) FROM Loans WHERE status LIKE "paid off" OR loan_id IN (70846, 76070)
|
loan_db
|
How many primary contract ids, client ids have a counterparty bank branch id 99273 or a client id in (87151, 87048)?
|
SELECT COUNT(primary_contract_id), client_id FROM Source WHERE counterparty_bank_branch_id = 99273 OR client_id IN (87151, 87048)
|
transactions_db
|
What is the product_family_code, client_id, number of client_id, beneficiary_id of the transaction in the source of the primary contract_id, when product_family code is different from 19277 and when beneficiary_id for the transaction amount is 89749?
|
SELECT Transactions.product_family_code, Source.client_id, COUNT(Transactions.client_id), Transactions.beneficiary_id FROM Transactions INNER JOIN Source ON Transactions.primary_contract_id = Source.primary_contract_id WHERE product_family_code <> 19277 AND beneficiary_id = 89749 GROUP BY transaction_amount
|
transactions_db
|
What is the client_id, hour_number and the total number of primary contract_id for the transaction with a time on timestamp_id of timestamp_id, when the beneficiary_id is 24947, or when the product family code is different by primary contract id to 89302 group?
|
SELECT Transactions.client_id, Time.hour_number, COUNT(Transactions.primary_contract_id) FROM Transactions JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE beneficiary_id = 24947 OR product_family_code <> 89302 GROUP BY primary_contract_id
|
transactions_db
|
What is the hour number, week number, when the hour number is below 18 or month number is 5?
|
SELECT hour_number, week_number FROM Time WHERE hour_number <= 18 OR month_number = 5
|
transactions_db
|
What is the total number of timestamp id for the week number less than 4 and a year larger than 2011?
|
SELECT COUNT(timestamp_id) FROM Time WHERE week_number < 4 AND year > 2011
|
transactions_db
|
How many deposits have a deposit_id different than 63803 or not (source in ('transaction', 'cash', 'check'))?
|
SELECT COUNT(source) FROM Deposits WHERE deposit_id <> 63803 OR NOT(source IN ('Transaction', 'Cash', 'Check'))
|
loan_db
|
What is the country code of the beneficiary?
|
SELECT country_code FROM Beneficiary
|
transactions_db
|
How many customers have a client_id in (98509, 9991) or type other than a "deposit account"?
|
SELECT COUNT(client_id) FROM Accounts WHERE client_id IN (98509, 92991) OR type <> "Deposit account"
|
loan_db
|
What is the account_id, source of the deposit with an account_id (92624, 81118)?
|
SELECT account_id, source FROM Deposits WHERE account_id IN (92624, 81118)
|
loan_db
|
What is the counterparty_donor_id of the player with a counterparty_donor_id (52017, 58283)?
|
SELECT counterparty_donor_id FROM Source WHERE counterparty_donor_id IN (52017, 58283)
|
transactions_db
|
What is the transaction amount of the transaction?
|
SELECT transaction_amount FROM Transactions
|
transactions_db
|
What is the year of birth, account ID, number of first names of the client in "Jacksonville" left with an account ID of client-id or a last name like "Coleman" by the year of birth?
|
SELECT Clients.year_of_birth, Accounts.account_id, COUNT(Clients.first_name) FROM Clients LEFT JOIN Accounts ON Clients.client_id = Accounts.client_id WHERE Clients.city = "Jacksonville" OR Clients.last_name LIKE "Coleman" GROUP BY Clients.year_of_birth
|
loan_db
|
How many times is the counterparty bank branch id, not client id (counterparty donor id (68874, 93142))?
|
SELECT COUNT(counterparty_bank_branch_id), client_id FROM Source WHERE NOT(counterparty_donor_id IN (68874, 93142))
|
transactions_db
|
What is the timestamp_id, transaction_amount of the transaction in (70073, 93520) and transaction_id in (38063, 25940)?
|
SELECT timestamp_id, transaction_amount FROM Transactions WHERE beneficiary_id IN (70073, 93520) AND transaction_id IN (38063, 25940)
|
transactions_db
|
What is the client_id, day_name, total number of transactions id, transaction amount for the transaction with a transaction amount higher than 43088 by beneficiary_id?
|
SELECT Transactions.client_id, Time.day_name, COUNT(Transactions.transaction_id), Transactions.transaction_amount FROM Transactions JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE transaction_amount > 43088 GROUP BY beneficiary_id
|
transactions_db
|
What is the status, duration of loan on a client id 77349, 85617 or a status of "overdue"?
|
SELECT status, duration FROM Loans WHERE client_id IN (77349, 85617) OR status = "overdue"
|
loan_db
|
What is the bank_branch_id, country name of the beneficiary with a beneficiary_id different than 96672 or a bank branch-id smaller than 84859?
|
SELECT bank_branch_id, country_name FROM Beneficiary WHERE beneficiary_id <> 96672 OR bank_branch_id <> 84859
|
transactions_db
|
What is the status of the loan with a client_id different from 8714 or a status of "overdue"?
|
SELECT status FROM Loans WHERE client_id <> 8714 OR status = "overdue"
|
loan_db
|
How many loans have a loan_id different than 87516?
|
SELECT COUNT(status) FROM Loans WHERE loan_id <> 87516
|
loan_db
|
What is the client_id and the first name of the client?
|
SELECT client_id, first_name FROM Clients
|
loan_db
|
What is the type, source, total number of deposits to account_id of account_id when the client-id is different from 38208 or type in the group ('saving account', 'loan account')?
|
SELECT Accounts.type, Deposits.source, COUNT(Accounts.client_id) FROM Accounts JOIN Deposits ON Accounts.account_id = Deposits.account_id WHERE Accounts.client_id <> 38208 OR Accounts.type IN ('Saving account', 'Loan account') GROUP BY Accounts.type
|
loan_db
|
How many transactions have an is_fraudulent of "no"?
|
SELECT COUNT(client_id) FROM Transactions WHERE is_fraudulent = "No"
|
transactions_db
|
What type of client_id has a client_id in (54829, 74204)?
|
SELECT type, client_id FROM Accounts WHERE client_id IN (54829, 74204)
|
loan_db
|
What is the budget for loans with a status ('Repaid', 'current') or a duration smaller than 26?
|
SELECT budget FROM Loans WHERE status IN ('overdue', 'paid off', 'current') OR duration <= 26
|
loan_db
|
What is the hour number of the game?
|
SELECT hour_number FROM Time
|
transactions_db
|
What is the account_id, interest rate and total number of different types of accounts that link on the client_id of client_id when the balance differs by group by account_id?
|
SELECT Accounts.account_id, Loans.interest, COUNT(Accounts.type) FROM Accounts JOIN Loans ON Accounts.client_id = Loans.client_id WHERE Accounts.balance <> 493950 GROUP BY Accounts.account_id
|
loan_db
|
What is the timestamp_id of my transactions?
|
SELECT timestamp_id, is_fraudulent FROM Transactions
|
transactions_db
|
What is the name, type, number of city, year_of_birth of the client with a client_id of client_id when the year_of_birth is not greater than 2003 group by year_of_birth?
|
SELECT Clients.last_name, Accounts.type, COUNT(Clients.city), Clients.year_of_birth FROM Clients JOIN Accounts ON Clients.client_id = Accounts.client_id WHERE NOT Clients.year_of_birth > 2003 GROUP BY Clients.year_of_birth
|
loan_db
|
What is the hour number of the time on a timestamp in (27701, 94331) and an hour number smaller than 18?
|
SELECT hour_number FROM Time WHERE timestamp_id IN (27701, 94331) AND hour_number <= 18
|
transactions_db
|
What is the amount of deposits?
|
SELECT amount FROM Deposits
|
loan_db
|
What is the counterparty_donor_id?
|
SELECT counterparty_donor_id FROM Source
|
transactions_db
|
What is the period of the loan?
|
SELECT duration, loan_id FROM Loans
|
loan_db
|
What is the unique beneficiary-ID of transactions?
|
SELECT DISTINCT beneficiary_id FROM Transactions
|
transactions_db
|
What is is_fraudulent for transactions with a not timestamp id of 43298?
|
SELECT is_fraudulent FROM Transactions WHERE NOT timestamp_id = 43298
|
transactions_db
|
What is the day number, month number if hour number is smaller than 3 or month number is less than 7?
|
SELECT day_number, month_number FROM Time WHERE NOT hour_number < 3 OR month_number < 7
|
transactions_db
|
What year was the timetamp_id?
|
SELECT year, timestamp_id FROM Time
|
transactions_db
|
What is the timestamp_id, week_number of the era 2000?
|
SELECT timestamp_id, week_number FROM Time WHERE year = 2000
|
transactions_db
|
What is the average balance of accounts with a balance less than 995314?
|
SELECT AVG(balance) FROM Accounts WHERE balance <= 995314
|
loan_db
|
What is the amount of the loan?
|
SELECT * FROM Loans
|
loan_db
|
What is beneficiary_id?
|
SELECT beneficiary_id FROM Beneficiary
|
transactions_db
|
What is the hour number, month number of the episode with a day name different than "Friday" or a week number smaller than 4?
|
SELECT hour_number, month_number FROM Time WHERE day_name <> "Friday" OR week_number <> 4
|
transactions_db
|
What is the budget, duration of loan on a client id in (59632, 59523)?
|
SELECT budget, duration FROM Loans WHERE client_id IN (59632, 59523)
|
loan_db
|
What is balance, first name and total number of types of accounts that join clients with a client_id of the client_id if the type is "deposit account" and when the account_id is in the group (93201, 87670)?
|
SELECT Accounts.balance, Clients.first_name, COUNT(Accounts.type) FROM Accounts JOIN Clients ON Accounts.client_id = Clients.client_id WHERE Accounts.type = "Deposit account" AND Accounts.account_id IN (93201, 87670) GROUP BY Accounts.balance
|
loan_db
|
What is the unique time-number of the day?
|
SELECT DISTINCT day_number FROM Time
|
transactions_db
|
How many accounts have a type ('saving account', 'deposit account') in?
|
SELECT COUNT(account_id), client_id FROM Accounts WHERE type IN ('Saving account', 'Deposit account')
|
loan_db
|
What is the counterparty bank branch id, primary contract id of the source?
|
SELECT counterparty_bank_branch_id, primary_contract_id FROM Source
|
transactions_db
|
What is the name of the account?
|
SELECT * FROM Accounts
|
loan_db
|
What is the client_id and amount of currency of transactions?
|
SELECT client_id, amount_currency FROM Transactions
|
transactions_db
|
How many countries have a beneficiary that has a not(beneficiary_id in (25014, 32254))?
|
SELECT COUNT(country_name) FROM Beneficiary WHERE NOT(beneficiary_id IN (25014, 32254))
|
transactions_db
|
What is the account_id, amount of the deposit with an account_id in (88897, 93780) or deposit_id in (99542, 52717)?
|
SELECT account_id, amount FROM Deposits WHERE account_id IN (88897, 93780) OR deposit_id IN (99542, 52717)
|
loan_db
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.