query_id
int64 0
7k
| database_id
stringclasses 140
values | table_id
sequencelengths 1
5
| query
stringlengths 16
224
| answer
stringlengths 18
577
| difficulty
stringclasses 4
values |
---|---|---|---|---|---|
1,500 | debate | [
"debate"
] | Show the distinct venues of debates | SELECT DISTINCT Venue FROM debate | easy |
1,501 | debate | [
"debate",
"people",
"debate_people"
] | Show the names of people, and dates and venues of debates they are on the affirmative side. | SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID | medium |
1,502 | debate | [
"debate",
"people",
"debate_people"
] | Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name. | SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name ASC | hard |
1,503 | debate | [
"debate",
"people",
"debate_people"
] | Show the names of people that are on affirmative side of debates with number of audience bigger than 200. | SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200 | hard |
1,504 | debate | [
"people",
"debate_people"
] | Show the names of people and the number of times they have been on the affirmative side of debates. | SELECT T2.Name , COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name | medium |
1,505 | debate | [
"people",
"debate_people"
] | Show the names of people who have been on the negative side of debates at least twice. | SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2 | medium |
1,506 | debate | [
"people",
"debate_people"
] | List the names of people that have not been on the affirmative side of debates. | SELECT Name FROM people WHERE People_id NOT IN (SELECT Affirmative FROM debate_people) | hard |
1,507 | insurance_and_eClaims | [
"customers"
] | List the names of all the customers in alphabetical order. | SELECT customer_details FROM customers ORDER BY customer_details | easy |
1,508 | insurance_and_eClaims | [
"customers"
] | Sort the customer names in alphabetical order. | SELECT customer_details FROM customers ORDER BY customer_details | easy |
1,509 | insurance_and_eClaims | [
"policies",
"customers"
] | Find all the policy type codes associated with the customer "Dayana Robel" | SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = "Dayana Robel" | medium |
1,510 | insurance_and_eClaims | [
"policies",
"customers"
] | What are the type codes of the policies used by the customer "Dayana Robel"? | SELECT policy_type_code FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_details = "Dayana Robel" | medium |
1,511 | insurance_and_eClaims | [
"policies"
] | Which type of policy is most frequently used? Give me the policy type code. | SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 | hard |
1,512 | insurance_and_eClaims | [
"policies"
] | Find the type code of the most frequently used policy. | SELECT policy_type_code FROM policies GROUP BY policy_type_code ORDER BY count(*) DESC LIMIT 1 | hard |
1,513 | insurance_and_eClaims | [
"policies"
] | Find all the policy types that are used by more than 2 customers. | SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING count(*) > 2 | easy |
1,514 | insurance_and_eClaims | [
"policies"
] | Which types of policy are chosen by more than 2 customers? Give me the policy type codes. | SELECT policy_type_code FROM policies GROUP BY policy_type_code HAVING count(*) > 2 | easy |
1,515 | insurance_and_eClaims | [
"claim_headers"
] | Find the total and average amount paid in claim headers. | SELECT sum(amount_piad) , avg(amount_piad) FROM claim_headers | medium |
1,516 | insurance_and_eClaims | [
"claim_headers"
] | What are the total amount and average amount paid in claim headers? | SELECT sum(amount_piad) , avg(amount_piad) FROM claim_headers | medium |
1,517 | insurance_and_eClaims | [
"claim_headers",
"claims_documents"
] | Find the total amount claimed in the most recently created document. | SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1) | extra |
1,518 | insurance_and_eClaims | [
"claim_headers",
"claims_documents"
] | How much amount in total were claimed in the most recently created document? | SELECT sum(t1.amount_claimed) FROM claim_headers AS t1 JOIN claims_documents AS t2 ON t1.claim_header_id = t2.claim_id WHERE t2.created_date = (SELECT created_date FROM claims_documents ORDER BY created_date LIMIT 1) | extra |
1,519 | insurance_and_eClaims | [
"customers",
"claim_headers",
"policies"
] | What is the name of the customer who has made the largest amount of claim in a single claim? | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT max(amount_claimed) FROM claim_headers) | extra |
1,520 | insurance_and_eClaims | [
"customers",
"claim_headers",
"policies"
] | Which customer made the largest amount of claim in a single claim? Return the customer details. | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_claimed = (SELECT max(amount_claimed) FROM claim_headers) | extra |
1,521 | insurance_and_eClaims | [
"customers",
"claim_headers",
"policies"
] | What is the name of the customer who has made the minimum amount of payment in one claim? | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT min(amount_piad) FROM claim_headers) | extra |
1,522 | insurance_and_eClaims | [
"customers",
"claim_headers",
"policies"
] | Which customer made the smallest amount of claim in one claim? Return the customer details. | SELECT t3.customer_details FROM claim_headers AS t1 JOIN policies AS t2 ON t1.policy_id = t2.policy_id JOIN customers AS t3 ON t2.customer_id = t3.customer_id WHERE t1.amount_piad = (SELECT min(amount_piad) FROM claim_headers) | extra |
1,523 | insurance_and_eClaims | [
"policies",
"customers"
] | Find the names of customers who have no policies associated. | SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id | hard |
1,524 | insurance_and_eClaims | [
"policies",
"customers"
] | What are the names of customers who do not have any policies? | SELECT customer_details FROM customers EXCEPT SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id | hard |
1,525 | insurance_and_eClaims | [
"claims_processing_stages"
] | How many claim processing stages are there in total? | SELECT count(*) FROM claims_processing_stages | easy |
1,526 | insurance_and_eClaims | [
"claims_processing_stages"
] | Find the number of distinct stages in claim processing. | SELECT count(*) FROM claims_processing_stages | easy |
1,527 | insurance_and_eClaims | [
"claims_processing_stages",
"claims_processing"
] | What is the name of the claim processing stage that most of the claims are on? | SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1 | extra |
1,528 | insurance_and_eClaims | [
"claims_processing_stages",
"claims_processing"
] | Which claim processing stage has the most claims? Show the claim status name. | SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY count(*) DESC LIMIT 1 | extra |
1,529 | insurance_and_eClaims | [
"customers"
] | Find the names of customers whose name contains "Diana". | SELECT customer_details FROM customers WHERE customer_details LIKE "%Diana%" | medium |
1,530 | insurance_and_eClaims | [
"customers"
] | Which customers have the substring "Diana" in their names? Return the customer details. | SELECT customer_details FROM customers WHERE customer_details LIKE "%Diana%" | medium |
1,531 | insurance_and_eClaims | [
"policies",
"customers"
] | Find the names of the customers who have an deputy policy. | SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" | medium |
1,532 | insurance_and_eClaims | [
"policies",
"customers"
] | Which customers have an insurance policy with the type code "Deputy"? Give me the customer details. | SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" | medium |
1,533 | insurance_and_eClaims | [
"policies",
"customers"
] | Find the names of customers who either have an deputy policy or uniformed policy. | SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniform" | hard |
1,534 | insurance_and_eClaims | [
"policies",
"customers"
] | Which customers have an insurance policy with the type code "Deputy" or "Uniform"? Return the customer details. | SELECT DISTINCT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.policy_type_code = "Deputy" OR t1.policy_type_code = "Uniform" | hard |
1,535 | insurance_and_eClaims | [
"customers",
"staff"
] | Find the names of all the customers and staff members. | SELECT customer_details FROM customers UNION SELECT staff_details FROM staff | hard |
1,536 | insurance_and_eClaims | [
"customers",
"staff"
] | What are the names of the customers and staff members? | SELECT customer_details FROM customers UNION SELECT staff_details FROM staff | hard |
1,537 | insurance_and_eClaims | [
"policies"
] | Find the number of records of each policy type and its type code. | SELECT policy_type_code , count(*) FROM policies GROUP BY policy_type_code | medium |
1,538 | insurance_and_eClaims | [
"policies"
] | For each policy type, return its type code and its count in the record. | SELECT policy_type_code , count(*) FROM policies GROUP BY policy_type_code | medium |
1,539 | insurance_and_eClaims | [
"policies",
"customers"
] | Find the name of the customer that has been involved in the most policies. | SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1 | extra |
1,540 | insurance_and_eClaims | [
"policies",
"customers"
] | Which customer have the most policies? Give me the customer details. | SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t2.customer_details ORDER BY count(*) DESC LIMIT 1 | extra |
1,541 | insurance_and_eClaims | [
"claims_processing_stages"
] | What is the description of the claim status "Open"? | SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = "Open" | easy |
1,542 | insurance_and_eClaims | [
"claims_processing_stages"
] | Find the description of the claim status "Open". | SELECT claim_status_description FROM claims_processing_stages WHERE claim_status_name = "Open" | easy |
1,543 | insurance_and_eClaims | [
"claims_processing"
] | How many distinct claim outcome codes are there? | SELECT count(DISTINCT claim_outcome_code) FROM claims_processing | easy |
1,544 | insurance_and_eClaims | [
"claims_processing"
] | Count the number of distinct claim outcome codes. | SELECT count(DISTINCT claim_outcome_code) FROM claims_processing | easy |
1,545 | insurance_and_eClaims | [
"policies",
"customers"
] | Which customer is associated with the latest policy? | SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT max(start_date) FROM policies) | extra |
1,546 | insurance_and_eClaims | [
"policies",
"customers"
] | Find the customer who started a policy most recently. | SELECT t2.customer_details FROM policies AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.start_date = (SELECT max(start_date) FROM policies) | extra |
1,547 | customers_and_invoices | [
"Accounts"
] | Show the number of accounts. | SELECT count(*) FROM Accounts | easy |
1,548 | customers_and_invoices | [
"Accounts"
] | How many accounts are there? | SELECT count(*) FROM Accounts | easy |
1,549 | customers_and_invoices | [
"Accounts"
] | How many customers have opened an account? | SELECT count(DISTINCT customer_id) FROM Accounts | easy |
1,550 | customers_and_invoices | [
"Accounts"
] | Count the number of customers who have an account. | SELECT count(DISTINCT customer_id) FROM Accounts | easy |
1,551 | customers_and_invoices | [
"Accounts"
] | Show the id, the date of account opened, the account name, and other account detail for all accounts. | SELECT account_id , date_account_opened , account_name , other_account_details FROM Accounts | medium |
1,552 | customers_and_invoices | [
"Accounts"
] | What are the ids, date opened, name, and other details for all accounts? | SELECT account_id , date_account_opened , account_name , other_account_details FROM Accounts | medium |
1,553 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'. | SELECT T1.account_id , T1.date_account_opened , T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' | medium |
1,554 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the ids, names, dates of opening, and other details for accounts corresponding to the customer with the first name "Meaghan"? | SELECT T1.account_id , T1.date_account_opened , T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' | medium |
1,555 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show the account name and other account detail for all accounts by the customer with first name Meaghan and last name Keeling. | SELECT T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Meaghan" AND T2.customer_last_name = "Keeling" | extra |
1,556 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the names and other details for accounts corresponding to the customer named Meaghan Keeling? | SELECT T1.account_name , T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = "Meaghan" AND T2.customer_last_name = "Keeling" | extra |
1,557 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show the first name and last name for the customer with account name 900. | SELECT T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "900" | medium |
1,558 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the full names of customers with the account name 900? | SELECT T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "900" | medium |
1,559 | customers_and_invoices | [
"Accounts",
"Customers"
] | How many customers don't have an account? | SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts) | extra |
1,560 | customers_and_invoices | [
"Accounts",
"Customers"
] | Count the number of customers who do not have an account. | SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts) | extra |
1,561 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show the unique first names, last names, and phone numbers for all customers with any account. | SELECT DISTINCT T1.customer_first_name , T1.customer_last_name , T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id | medium |
1,562 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the distinct first names, last names, and phone numbers for customers with accounts? | SELECT DISTINCT T1.customer_first_name , T1.customer_last_name , T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id = T2.customer_id | medium |
1,563 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show customer ids who don't have an account. | SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts | hard |
1,564 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the customer ids for customers who do not have an account? | SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts | hard |
1,565 | customers_and_invoices | [
"Accounts"
] | How many accounts does each customer have? List the number and customer id. | SELECT count(*) , customer_id FROM Accounts GROUP BY customer_id | medium |
1,566 | customers_and_invoices | [
"Accounts"
] | Count the number of accounts corresponding to each customer id. | SELECT count(*) , customer_id FROM Accounts GROUP BY customer_id | medium |
1,567 | customers_and_invoices | [
"Accounts",
"Customers"
] | What is the customer id, first and last name with most number of accounts. | SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 | extra |
1,568 | customers_and_invoices | [
"Accounts",
"Customers"
] | Return the id and full name of the customer with the most accounts. | SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 | extra |
1,569 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show id, first name and last name for all customers and the number of accounts. | SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | medium |
1,570 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the the full names and ids for all customers, and how many accounts does each have? | SELECT T1.customer_id , T2.customer_first_name , T2.customer_last_name , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | medium |
1,571 | customers_and_invoices | [
"Accounts",
"Customers"
] | Show first name and id for all customers with at least 2 accounts. | SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 | medium |
1,572 | customers_and_invoices | [
"Accounts",
"Customers"
] | What are the first names and ids for customers who have two or more accounts? | SELECT T2.customer_first_name , T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) >= 2 | medium |
1,573 | customers_and_invoices | [
"Customers"
] | Show the number of customers. | SELECT count(*) FROM Customers | easy |
1,574 | customers_and_invoices | [
"Customers"
] | Count the number of customers. | SELECT count(*) FROM Customers | easy |
1,575 | customers_and_invoices | [
"Customers"
] | Show the number of customers for each gender. | SELECT gender , count(*) FROM Customers GROUP BY gender | medium |
1,576 | customers_and_invoices | [
"Customers"
] | How many customers are there of each gender? | SELECT gender , count(*) FROM Customers GROUP BY gender | medium |
1,577 | customers_and_invoices | [
"Financial_transactions"
] | How many transactions do we have? | SELECT count(*) FROM Financial_transactions | easy |
1,578 | customers_and_invoices | [
"Financial_transactions"
] | Count the number of transactions. | SELECT count(*) FROM Financial_transactions | easy |
1,579 | customers_and_invoices | [
"Financial_transactions"
] | How many transaction does each account have? Show the number and account id. | SELECT count(*) , account_id FROM Financial_transactions | medium |
1,580 | customers_and_invoices | [
"Financial_transactions"
] | Count the number of financial transactions that correspond to each account id. | SELECT count(*) , account_id FROM Financial_transactions | medium |
1,581 | customers_and_invoices | [
"Accounts",
"Financial_transactions"
] | How many transaction does account with name 337 have? | SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = "337" | medium |
1,582 | customers_and_invoices | [
"Accounts",
"Financial_transactions"
] | Count the number of financial transactions that the account with the name 337 has. | SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id WHERE T2.account_name = "337" | medium |
1,583 | customers_and_invoices | [
"Financial_transactions"
] | What is the average, minimum, maximum, and total transaction amount? | SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions | medium |
1,584 | customers_and_invoices | [
"Financial_transactions"
] | Return the average, minimum, maximum, and total transaction amounts. | SELECT avg(transaction_amount) , min(transaction_amount) , max(transaction_amount) , sum(transaction_amount) FROM Financial_transactions | medium |
1,585 | customers_and_invoices | [
"Financial_transactions"
] | Show ids for all transactions whose amounts are greater than the average. | SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions) | hard |
1,586 | customers_and_invoices | [
"Financial_transactions"
] | What are the ids for transactions that have an amount greater than the average amount of a transaction? | SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions) | hard |
1,587 | customers_and_invoices | [
"Financial_transactions"
] | Show the transaction types and the total amount of transactions. | SELECT transaction_type , sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type | medium |
1,588 | customers_and_invoices | [
"Financial_transactions"
] | What are total transaction amounts for each transaction type? | SELECT transaction_type , sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type | medium |
1,589 | customers_and_invoices | [
"Accounts",
"Financial_transactions"
] | Show the account name, id and the number of transactions for each account. | SELECT T2.account_name , T1.account_id , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | medium |
1,590 | customers_and_invoices | [
"Accounts",
"Financial_transactions"
] | Return the names and ids of each account, as well as the number of transactions. | SELECT T2.account_name , T1.account_id , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | medium |
1,591 | customers_and_invoices | [
"Financial_transactions"
] | Show the account id with most number of transactions. | SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1 | hard |
1,592 | customers_and_invoices | [
"Financial_transactions"
] | What is the id of the account with the most transactions? | SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1 | hard |
1,593 | customers_and_invoices | [
"Accounts",
"Financial_transactions"
] | Show the account id and name with at least 4 transactions. | SELECT T1.account_id , T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING count(*) >= 4 | medium |
1,594 | customers_and_invoices | [
"Accounts",
"Financial_transactions"
] | What are the ids and names of accounts with 4 or more transactions? | SELECT T1.account_id , T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id HAVING count(*) >= 4 | medium |
1,595 | customers_and_invoices | [
"Products"
] | Show all product sizes. | SELECT DISTINCT product_size FROM Products | easy |
1,596 | customers_and_invoices | [
"Products"
] | What are the different product sizes? | SELECT DISTINCT product_size FROM Products | easy |
1,597 | customers_and_invoices | [
"Products"
] | Show all product colors. | SELECT DISTINCT product_color FROM Products | easy |
1,598 | customers_and_invoices | [
"Products"
] | What are the different product colors? | SELECT DISTINCT product_color FROM Products | easy |
1,599 | customers_and_invoices | [
"Financial_transactions"
] | Show the invoice number and the number of transactions for each invoice. | SELECT invoice_number , count(*) FROM Financial_transactions GROUP BY invoice_number | medium |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.