question
stringlengths 13
765
| query
stringlengths 20
406
| db_id
stringclasses 2
values |
---|---|---|
What is the account_id, interest rate and total number of different types of accounts left after joining the loans via the client_id of the client_id when the balance is different than 189327 or when the account_id is registered in (68277, 8532) of the group via account_id?
|
SELECT Accounts.account_id, Loans.interest, COUNT(Accounts.type) FROM Accounts LEFT JOIN Loans ON Accounts.client_id = Loans.client_id WHERE Accounts.balance <> 189327 OR Accounts.account_id IN (68277, 8532) GROUP BY Accounts.account_id
|
loan_db
|
How many beneficiaries have a bank branch ID of 31152?
|
SELECT COUNT(beneficiary_id), bank_branch_id FROM Beneficiary WHERE bank_branch_id = 31152
|
transactions_db
|
What is the week number, month number of the episode?
|
SELECT week_number, month_number FROM Time
|
transactions_db
|
What is is_fraudulent, country_name, total number of client_ids, amount_currency for the transaction with beneficiary-id of the beneficiary-id, when amount is not AUD, and when the transaction amount is 95591 AGROUP?
|
SELECT Transactions.is_fraudulent, Beneficiary.country_name, COUNT(Transactions.client_id), Transactions.amount_currency FROM Transactions JOIN Beneficiary ON Transactions.beneficiary_id = Beneficiary.beneficiary_id WHERE NOT amount_currency = AUD AND transaction_amount = 95591 GROUP BY is_fraudulent
|
transactions_db
|
What is the client_id loan number in (60113, 51763)?
|
SELECT * FROM Loans WHERE client_id IN (60113, 51763)
|
loan_db
|
What is the client_id and the status of the loan?
|
SELECT client_id, status FROM Loans
|
loan_db
|
What is the primary contract id?
|
SELECT primary_contract_id FROM Source
|
transactions_db
|
What is the hour number, day number of the time?
|
SELECT hour_number, day_number FROM Time
|
transactions_db
|
What is account_id, balance of accounts?
|
SELECT account_id, balance FROM Accounts
|
loan_db
|
What is the type, deposit_id and total balance of accounts with accounts joining deposits on account_id of account_id when client_id is 66047 group by balance?
|
SELECT Accounts.type, Deposits.deposit_id, COUNT(Accounts.balance) FROM Accounts JOIN Deposits ON Accounts.account_id = Deposits.account_id WHERE Accounts.client_id = 66047 GROUP BY Accounts.balance
|
loan_db
|
What is the client_id, city of the client with an email like "ma" or a client_id of 50022?
|
SELECT client_id, city FROM Clients WHERE email LIKE "[email protected]" OR client_id = 50022
|
loan_db
|
What is the primary contract id, counterparty_bank branch_id of the bank with a counterparty bank branch_id of 74543?
|
SELECT primary_contract_id, counterparty_bank_branch_id FROM Source WHERE counterparty_bank_branch_id = 74543
|
transactions_db
|
How many deposits have a source like "transaction" or deposit_id of 95557?
|
SELECT COUNT(source), account_id FROM Deposits WHERE source LIKE "Transaction" OR deposit_id = 95557
|
loan_db
|
What is the name of the client with a first-name like "carter"?
|
SELECT email FROM Clients WHERE first_name LIKE "Carter"
|
loan_db
|
How many types of accounts have a saving account or account id of 38672?
|
SELECT COUNT(type) FROM Accounts WHERE NOT type LIKE Saving account OR account_id = 38672
|
loan_db
|
How many transactions have an is_fraudulent of "no"?
|
SELECT COUNT(transaction_id) FROM Transactions WHERE is_fraudulent = "No"
|
transactions_db
|
What is the source of deposits?
|
SELECT source FROM Deposits
|
loan_db
|
What is the timestamp_id, currency_device_branch_id and transaction_id of the transaction that has a timestamp_id different by amount_currency than 80063 GROUP?
|
SELECT Transactions.timestamp_id, Source.counterparty_bank_branch_id, COUNT(Transactions.transaction_id) FROM Transactions JOIN Source ON Transactions.primary_contract_id = Source.primary_contract_id WHERE timestamp_id <> 80063 GROUP BY amount_currency
|
transactions_db
|
How many transactions have a timestamp id different than 46324 GROUP by beneficiary id?
|
SELECT COUNT(product_family_code), is_fraudulent FROM Transactions WHERE timestamp_id <> 46324 GROUP BY beneficiary_id
|
transactions_db
|
What is the country code of the beneficiary?
|
SELECT country_code FROM Beneficiary
|
transactions_db
|
How many accounts have a type of "Loan account" and an account_id of 91683?
|
SELECT COUNT(client_id), account_id FROM Accounts WHERE type = "Loan account" AND account_id = 91683
|
loan_db
|
What year was the week number?
|
SELECT year, week_number FROM Time
|
transactions_db
|
What is the budget, interest and interest on the loans?
|
SELECT budget, interest FROM Loans
|
loan_db
|
What is the primary contract ID of client 92598 with a counterparty donor ID of 98030?
|
SELECT primary_contract_id FROM Source WHERE client_id = 92598 AND counterparty_donor_id = 98030
|
transactions_db
|
How many transactions have a timestamp id (98986, 94488)?
|
SELECT COUNT(is_fraudulent), transaction_id FROM Transactions WHERE timestamp_id IN (98986, 94488)
|
transactions_db
|
What is the week number of the week that is different from 7?
|
SELECT week_number, year FROM Time WHERE week_number <> 7
|
transactions_db
|
What is the name, day number of the game?
|
SELECT day_name, day_number FROM Time
|
transactions_db
|
What is the duration of the loan with a budget less than 961094?
|
SELECT duration FROM Loans WHERE budget < 961094
|
loan_db
|
What is the transaction_amount, primary contract - id of the transaction with a transaction - id of 92890 and product family code which is different than 97638?
|
SELECT transaction_amount, primary_contract_id FROM Transactions WHERE transaction_id = 92890 AND NOT product_family_code <> 97638
|
transactions_db
|
What is account_id, type of accounts?
|
SELECT account_id, type FROM Accounts
|
loan_db
|
What is the client_id of accounts?
|
SELECT client_id FROM Accounts
|
loan_db
|
What is the hour number of the game?
|
SELECT hour_number FROM Time
|
transactions_db
|
What is the name of the beneficiary country?
|
SELECT country_name FROM Beneficiary
|
transactions_db
|
What is the transaction amount, year, total number (is_fraudulent), product family code for transactions left with a time on timestamp_id of timestamp_id, if client_id is different from 56489 group by primary contract id?
|
SELECT Transactions.transaction_amount, Time.year, COUNT(Transactions.is_fraudulent), Transactions.product_family_code FROM Transactions LEFT JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE client_id <> 56489 GROUP BY primary_contract_id
|
transactions_db
|
What is balance type of accounts?
|
SELECT balance, type FROM Accounts
|
loan_db
|
How many cities have gender different than "male"?
|
SELECT COUNT(city), last_name FROM Clients WHERE gender <> "Male"
|
loan_db
|
What is the amount of deposits for account ID (96797, 98011)?
|
SELECT amount FROM Deposits WHERE account_id IN (96797, 98011)
|
loan_db
|
How many times is the primary contract id different than 99392?
|
SELECT COUNT(counterparty_donor_id) FROM Source WHERE primary_contract_id <> 99392
|
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 loan amount with a budget of 942784 and 971849 and a client - ID of 55660?
|
SELECT * FROM Loans WHERE budget BETWEEN 942784 AND 971849 AND client_id = 55660
|
loan_db
|
What is the unique city, client_id of clients?
|
SELECT DISTINCT city, client_id FROM Clients
|
loan_db
|
What is the gender, year of birth of the client with a last name like "White"?
|
SELECT gender, year_of_birth FROM Clients WHERE last_name LIKE "White"
|
loan_db
|
What is the earliest year, timestamp - id of the day with a month number larger than 2?
|
SELECT MIN(year), timestamp_id FROM Time WHERE month_number > 2 OR day_name IN ('Wednesday', 'Monday', 'Tuesday', 'Thursday')
|
transactions_db
|
What is the branch identification of the bank, the country_name of the beneficiary?
|
SELECT bank_branch_id, country_name FROM Beneficiary
|
transactions_db
|
How many deposits have an account_id different than 28783 and a deposit_id of 88744?
|
SELECT COUNT(*) FROM Deposits WHERE account_id <> 28783 AND deposit_id = 88744
|
loan_db
|
What is account_id, type of accounts?
|
SELECT account_id, type FROM Accounts
|
loan_db
|
What is the deposit_id, type and total amount of deposits joining accounts with account_id of account_id when source is a "transaction" group by source?
|
SELECT Deposits.deposit_id, Accounts.type, COUNT(Deposits.amount) FROM Deposits JOIN Accounts ON Deposits.account_id = Accounts.account_id WHERE Deposits.source = "Transaction" GROUP BY Deposits.source
|
loan_db
|
What is the client_id of the city?
|
SELECT client_id, city FROM Clients
|
loan_db
|
What is the name of the country and beneficiary id of the beneficiary with a beneficiary id in (23961, 74009)?
|
SELECT country_name, beneficiary_id FROM Beneficiary WHERE beneficiary_id IN (23961, 74009)
|
transactions_db
|
What is the amount of currency, transaction_amount when the transaction_id is (80091, 25666) or when the transaction amount is less than 23683?
|
SELECT amount_currency, transaction_amount FROM Transactions WHERE transaction_id IN (80091, 25666) OR transaction_amount < 23683
|
transactions_db
|
What is the name, type and total number of years of birth for the client with a last name like "young" or a year of birth smaller than 1982 by year of birth?
|
SELECT Clients.email, Accounts.type, COUNT(Clients.year_of_birth) FROM Clients INNER JOIN Accounts ON Clients.client_id = Accounts.client_id WHERE Clients.last_name LIKE "Young" OR Clients.year_of_birth < 1982 GROUP BY Clients.year_of_birth
|
loan_db
|
What is the primary contract id of the transaction with a different product family code than 94827 and is_fraudulent > "no"?
|
SELECT primary_contract_id FROM Transactions WHERE product_family_code <> 94827 AND is_fraudulent <> "No"
|
transactions_db
|
What is the status, duration of loan?
|
SELECT status, duration FROM Loans
|
loan_db
|
What is the duration of the loan with a client_id different from 97009?
|
SELECT duration, client_id FROM Loans WHERE client_id <> 97009
|
loan_db
|
What is the primary contract id, counterparty-donor id of the company with the primary contract id (45375, 75828)?
|
SELECT primary_contract_id, counterparty_donor_id FROM Source WHERE primary_contract_id IN (45375, 75828)
|
transactions_db
|
What week, year was played the game?
|
SELECT week_number, year FROM Time
|
transactions_db
|
What is the total number of accounts with a balance less than 92984 or a " deposit account"?
|
SELECT COUNT(account_id), client_id FROM Accounts WHERE balance <= 92984 OR type = "Deposit account"
|
loan_db
|
How many different numbers are there for the counterparty bank branch id, primary contract id when the counterparty bank branch id is different than 39663?
|
SELECT COUNT(counterparty_bank_branch_id), primary_contract_id FROM Source WHERE counterparty_bank_branch_id <> 39663
|
transactions_db
|
What is the total number of years of birth for the client with a client - ID in (89385, 75823) or a year of birth smaller than 1992?
|
SELECT COUNT(year_of_birth) FROM Clients WHERE client_id IN (89385, 75823) OR year_of_birth <= 1992
|
loan_db
|
What is the week number, timestamp id of the game?
|
SELECT week_number, timestamp_id FROM Time
|
transactions_db
|
What is the type of balance of the account with a balance smaller than 89614 and an account_id different than 56690?
|
SELECT type, balance FROM Accounts WHERE balance < 89614 AND account_id <> 56690
|
loan_db
|
What is the type, balance of accounts?
|
SELECT type, balance FROM Accounts
|
loan_db
|
What is the interest, loan_id for loans?
|
SELECT interest, loan_id FROM Loans
|
loan_db
|
How many customers have gender that is different than the one of "female" or as a first name of "Hill"?
|
SELECT COUNT(gender), client_id FROM Clients WHERE gender <> "Female" OR first_name = "Hill"
|
loan_db
|
What is the unique account_ID, first name and total number of different type of accounts with a balance larger than 311692 and a type like the group of the "deposit account"?
|
SELECT DISTINCT Accounts.account_id, Clients.first_name, COUNT(Accounts.type) FROM Accounts INNER JOIN Clients ON Accounts.client_id = Clients.client_id WHERE Accounts.balance >= 311692 AND Accounts.type LIKE "Deposit account" GROUP BY Accounts.account_id
|
loan_db
|
What year did the birth happen to the client?
|
SELECT year_of_birth FROM Clients
|
loan_db
|
How many loans have a status of "current"?
|
SELECT COUNT(interest), loan_id FROM Loans WHERE status = "current"
|
loan_db
|
What is the hour number of the game?
|
SELECT hour_number FROM Time
|
transactions_db
|
What is the duration, budget of loan?
|
SELECT duration, budget FROM Loans
|
loan_db
|
How many customers have a city that is different than Milwaukee, or a gender like "female" group by gender?
|
SELECT COUNT(*) FROM Clients WHERE NOT city <> Milwaukee OR gender LIKE "Female" GROUP BY gender
|
loan_db
|
What is the account_id and deposit_id of deposit with a deposit_id of 50788 and a source like "Check"?
|
SELECT account_id, deposit_id FROM Deposits WHERE deposit_id = 50788 AND source LIKE "Check"
|
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
|
What is the source of the deposit with account id 98432 or a source like "Cash"?
|
SELECT source FROM Deposits WHERE account_id = 98432 OR source LIKE "Cash"
|
loan_db
|
What is the branch identification of the beneficiary?
|
SELECT bank_branch_id FROM Beneficiary
|
transactions_db
|
What is the balance of accounts?
|
SELECT balance FROM Accounts
|
loan_db
|
What is the loan_id and the duration of the loan?
|
SELECT loan_id, duration FROM Loans
|
loan_db
|
What is the product_family_code, the country_name and transaction_id for the beneficiary with a product_family_code in (4155, 41056) or amount_currency like "USD" group by timestamp_id?
|
SELECT Transactions.product_family_code, Beneficiary.country_name, COUNT(Transactions.transaction_id) FROM Transactions JOIN Beneficiary ON Transactions.beneficiary_id = Beneficiary.beneficiary_id WHERE product_family_code IN (4155, 41056) OR amount_currency LIKE "USD" GROUP BY timestamp_id
|
transactions_db
|
What is the status of the loan with a loan_id different from 89883?
|
SELECT status FROM Loans WHERE loan_id <> 89883
|
loan_db
|
What is the unique source, amount of deposits with account_id 92655 or an amount greater than 247797?
|
SELECT DISTINCT source, amount FROM Deposits WHERE account_id = 92655 OR amount > 247797
|
loan_db
|
What is the primary contract id, day_name, total number of transactions id, transaction amount for the transaction that has a time on timestamp_id of timestamp_id, when is_fraudulent is different by transaction amount from the group of "yes"
|
SELECT Transactions.primary_contract_id, Time.day_name, COUNT(Transactions.transaction_id), Transactions.transaction_amount FROM Transactions JOIN Time ON Transactions.timestamp_id = Time.timestamp_id WHERE is_fraudulent <> "Yes" GROUP BY transaction_amount
|
transactions_db
|
What is the deposit amount?
|
SELECT * FROM Deposits
|
loan_db
|
What year was the game played?
|
SELECT year FROM Time
|
transactions_db
|
What is the day_name of the event with a timestamp_id different from 99029 or a year smaller than 2019?
|
SELECT day_name FROM Time WHERE timestamp_id <> 99029 OR year <= 2019
|
transactions_db
|
What is the primary contract id for the transactions?
|
SELECT primary_contract_id FROM Transactions
|
transactions_db
|
What is the source, client_id and total number of deposit_ids left on account_id of account_id if the amount is more than 678130 or the source is a 'Transaction' group by amount?
|
SELECT Deposits.source, Accounts.client_id, COUNT(Deposits.deposit_id) FROM Deposits LEFT JOIN Accounts ON Deposits.account_id = Accounts.account_id WHERE Deposits.amount > 678130 OR Deposits.source = "Transaction" GROUP BY Deposits.amount
|
loan_db
|
What is beneficiary_id?
|
SELECT beneficiary_id FROM Beneficiary
|
transactions_db
|
What is the counterparty_donor_id, primary contract_id of the source?
|
SELECT counterparty_donor_id, primary_contract_id FROM Source
|
transactions_db
|
What is the client_id of the source?
|
SELECT client_id FROM Source
|
transactions_db
|
What is the status, client_id of loans?
|
SELECT status, client_id FROM Loans
|
loan_db
|
What is the beneficiary_id, country_code of the beneficiary with a beneficiary_id different from 30947 or a country code of "US"
|
SELECT beneficiary_id, country_code FROM Beneficiary WHERE beneficiary_id <> 30947 OR country_code = "US"
|
transactions_db
|
How many countries are called "Belgium" and have a country code like "CA"
|
SELECT COUNT(country_name) FROM Beneficiary WHERE country_name = "Belgium" AND country_code LIKE "CA"
|
transactions_db
|
What is the primary contract id, counterparty_donor id?
|
SELECT primary_contract_id, counterparty_donor_id FROM Source
|
transactions_db
|
What is the client_id of the source?
|
SELECT client_id FROM Source
|
transactions_db
|
What is the product_family_code for the transactions?
|
SELECT product_family_code FROM Transactions
|
transactions_db
|
What is is fraudulent of transactions?
|
SELECT is_fraudulent FROM Transactions
|
transactions_db
|
What is the balance, source, total number of client_ids, type for account_id with a balance of 956639 or client-id 31925 group by type?
|
SELECT Accounts.balance, Deposits.source, COUNT(Accounts.client_id), Accounts.type FROM Accounts INNER JOIN Deposits ON Accounts.account_id = Deposits.account_id WHERE Accounts.balance = 956639 OR NOT Accounts.client_id = 31925 GROUP BY Accounts.type
|
loan_db
|
What is the client_id, balance of accounts?
|
SELECT client_id, balance FROM Accounts
|
loan_db
|
What is the counterparty bank branch id of the bank with primary contract id different from 12402?
|
SELECT counterparty_bank_branch_id FROM Source WHERE primary_contract_id <> 12402
|
transactions_db
|
What is the hour number of the episode with a timestamp_id of 94730 and a week number larger than 1?
|
SELECT hour_number FROM Time WHERE timestamp_id = 94730 AND week_number > 1
|
transactions_db
|
How many loans have a budget of 411170?
|
SELECT COUNT(client_id) FROM Loans WHERE budget = 411170
|
loan_db
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.