minktn/spider-data huggingface dataset:
Database: gymnast
Question: List the names of the top 5 oldest people.
SQL: SELECT Name FROM People ORDER BY Age DESC LIMIT 5
Database: gymnast
Question: What are the names of the five oldest people?
SQL: SELECT Name FROM People ORDER BY Age DESC LIMIT 5
Database: gymnast
Question: What is the total point count of the youngest gymnast?
SQL: SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Age ASC LIMIT 1
Database: gymnast
Question: Return the total points of the gymnast with the lowest age.
SQL: SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Age ASC LIMIT 1
Database: gymnast
Question: What is the average age of all gymnasts?
SQL: SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
Database: gymnast
Question: Return the average age across all gymnasts.
SQL: SELECT avg(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
Database: gymnast
Question: What are the distinct hometowns of gymnasts with total points more than 57.5?
SQL: SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID WHERE T1.Total_Points  >  57.5
Database: gymnast
Question: Give the different hometowns of gymnasts that have a total point score of above 57.5.
SQL: SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID WHERE T1.Total_Points  >  57.5
Database: gymnast
Question: What are the hometowns of gymnasts and the corresponding number of gymnasts?
SQL: SELECT T2.Hometown ,  COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown
Database: gymnast
Question: How many gymnasts are from each hometown?
SQL: SELECT T2.Hometown ,  COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown
Database: gymnast
Question: What is the most common hometown of gymnasts?
SQL: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1
Database: gymnast
Question: Return the hometown that is most common among gymnasts.
SQL: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1
Database: gymnast
Question: What are the hometowns that are shared by at least two gymnasts?
SQL: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*)  >=  2
Database: gymnast
Question: Give the hometowns from which two or more gymnasts are from.
SQL: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*)  >=  2
Database: gymnast
Question: List the names of gymnasts in ascending order by their heights.
SQL: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Height ASC
Database: gymnast
Question: What are the names of gymnasts, ordered by their heights ascending?
SQL: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Height ASC
Database: gymnast
Question: List the distinct hometowns that are not associated with any gymnast.
SQL: SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
Database: gymnast
Question: From which hometowns did no gymnasts come from?
SQL: SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
Database: gymnast
Question: Show the hometowns shared by people older than 23 and younger than 20.
SQL: SELECT Hometown FROM people WHERE Age  >  23 INTERSECT SELECT Hometown FROM people WHERE Age  <  20
Database: gymnast
Question: From which hometowns did both people older than 23 and younger than 20 come from?
SQL: SELECT Hometown FROM people WHERE Age  >  23 INTERSECT SELECT Hometown FROM people WHERE Age  <  20
Database: gymnast
Question: How many distinct hometowns did these people have?
SQL: SELECT count(DISTINCT Hometown) FROM people
Database: gymnast
Question: Count the number of different hometowns of these people.
SQL: SELECT count(DISTINCT Hometown) FROM people
Database: gymnast
Question: Show the ages of gymnasts in descending order of total points.
SQL: SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T1.Total_Points DESC
Database: gymnast
Question: What are the ages of the gymnasts, ordered descending by their total points?
SQL: SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T1.Total_Points DESC
Database: small_bank_1
Question: Find the total savings balance of all accounts except the account with name ‘Brown’.
SQL: SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T1.name != 'Brown'
Database: small_bank_1
Question: What is the total balance of savings accounts not belonging to someone with the name Brown?
SQL: SELECT sum(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T1.name != 'Brown'
Database: small_bank_1
Question: How many accounts are there in total?
SQL: SELECT count(*) FROM accounts
Database: small_bank_1
Question: Count the number of accounts.
SQL: SELECT count(*) FROM accounts
Database: small_bank_1
Question: What is the total checking balance in all accounts?
SQL: SELECT sum(balance) FROM checking
Database: small_bank_1
Question: Find the total balance across checking accounts.
SQL: SELECT sum(balance) FROM checking
Database: small_bank_1
Question: Find the average checking balance.
SQL: SELECT avg(balance) FROM checking
Database: small_bank_1
Question: What is the average balance in checking accounts?
SQL: SELECT avg(balance) FROM checking
Database: small_bank_1
Question: How many accounts have a savings balance above the average savings balance?
SQL: SELECT count(*) FROM savings WHERE balance  >  (SELECT avg(balance) FROM savings)
Database: small_bank_1
Question: Find the number of accounts with a savings balance that is higher than the average savings balance.
SQL: SELECT count(*) FROM savings WHERE balance  >  (SELECT avg(balance) FROM savings)
Database: small_bank_1
Question: Find the name and id of accounts whose checking balance is below the maximum checking balance.
SQL: SELECT T1.custid ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT max(balance) FROM checking)
Database: small_bank_1
Question: What are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance?
SQL: SELECT T1.custid ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT max(balance) FROM checking)
Database: small_bank_1
Question: What is the checking balance of the account whose owner’s name contains the substring ‘ee’?
SQL: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T1.name LIKE '%ee%'
Database: small_bank_1
Question: Find the balance of the checking account belonging to an owner whose name contains 'ee'.
SQL: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T1.name LIKE '%ee%'
Database: small_bank_1
Question: Find the checking balance and saving balance in the Brown’s account.
SQL: SELECT T2.balance ,  T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T1.name  =  'Brown'
Database: small_bank_1
Question: What are the checking and savings balances in accounts belonging to Brown?
SQL: SELECT T2.balance ,  T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T1.name  =  'Brown'
Database: small_bank_1
Question: Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance.
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  >  (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT avg(balance) FROM savings)
Database: small_bank_1
Question: What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance?
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  >  (SELECT avg(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT avg(balance) FROM savings)
Database: small_bank_1
Question: Find the checking balance of the accounts whose savings balance is higher than the average savings balance.
SQL: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  >  (SELECT avg(balance) FROM savings))
Database: small_bank_1
Question: What are the balances of checking accounts belonging to people with savings balances greater than the average savings balance?
SQL: SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T1.name IN (SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  >  (SELECT avg(balance) FROM savings))
Database: small_bank_1
Question: List all customers’ names in the alphabetical order.
SQL: SELECT name FROM accounts ORDER BY name
Database: small_bank_1
Question: What are the names of all the customers in alphabetical order?
SQL: SELECT name FROM accounts ORDER BY name
Database: small_bank_1
Question: Find the name of account that has the lowest total checking and saving balance.
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
Database: small_bank_1
Question: What is the name corresponding to the accoung with the lowest sum of checking and savings balances?
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
Database: small_bank_1
Question: Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.
SQL: SELECT T1.name ,  T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  >  (SELECT avg(balance) FROM savings)
Database: small_bank_1
Question: What are the names and sum of checking and savings balances for accounts with savings balances higher than the average savings balance?
SQL: SELECT T1.name ,  T2.balance + T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  >  (SELECT avg(balance) FROM savings)
Database: small_bank_1
Question: Find the name and checking balance of the account with the lowest savings balance.
SQL: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
Database: small_bank_1
Question: What are the names and balances of checking accounts belonging to the customer with the lowest savings balance?
SQL: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
Database: small_bank_1
Question: Find the number of checking accounts for each account name.
SQL: SELECT count(*) ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name
Database: small_bank_1
Question: What are the names of customers with accounts, and how many checking accounts do each of them have?
SQL: SELECT count(*) ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name
Database: small_bank_1
Question: Find the total saving balance for each account name.
SQL: SELECT sum(T2.balance) ,  T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name
Database: small_bank_1
Question: What are the names of customers with accounts, and what are the total savings balances for each?
SQL: SELECT sum(T2.balance) ,  T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid GROUP BY T1.name
Database: small_bank_1
Question: Find the name of accounts whose checking balance is below the average checking balance.
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT avg(balance) FROM checking)
Database: small_bank_1
Question: What are the names of customers with checking balances lower than the average checking balance?
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid WHERE T2.balance  <  (SELECT avg(balance) FROM checking)
Database: small_bank_1
Question: Find the saving balance of the account with the highest checking balance.
SQL: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance DESC LIMIT 1
Database: small_bank_1
Question: What is the savings balance of the account belonging to the customer with the highest checking balance?
SQL: SELECT T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance DESC LIMIT 1
Database: small_bank_1
Question: Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.
SQL: SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T1.balance + T2.balance
Database: small_bank_1
Question: What is the sum of checking and savings balances for all customers, ordered by the total balance?
SQL: SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T1.balance + T2.balance
Database: small_bank_1
Question: Find the name and checking balance of the account with the lowest saving balance.
SQL: SELECT T2.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
Database: small_bank_1
Question: What is the name and checking balance of the account which has the lowest savings balance?
SQL: SELECT T2.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T3.balance LIMIT 1
Database: small_bank_1
Question: Find the name, checking balance and saving balance of all accounts in the bank.
SQL: SELECT T2.balance ,  T3.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid
Database: small_bank_1
Question: What are the names, checking balances, and savings balances for all customers?
SQL: SELECT T2.balance ,  T3.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid
Database: small_bank_1
Question: Find the name, checking balance and savings balance of all accounts in the bank sorted by their total checking and savings balance in descending order.
SQL: SELECT T2.balance ,  T3.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance + T3.balance DESC
Database: small_bank_1
Question: What are the names, checking balances, and savings balances of customers, ordered by the total of checking and savings balances descending?
SQL: SELECT T2.balance ,  T3.balance ,  T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid ORDER BY T2.balance + T3.balance DESC
Database: small_bank_1
Question: Find the name of accounts whose checking balance is higher than corresponding saving balance.
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T2.balance  >  T3.balance
Database: small_bank_1
Question: What are the names of customers with a higher checking balance than savings balance?
SQL: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T2.balance  >  T3.balance
Database: small_bank_1
Question: Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.
SQL: SELECT T1.name ,  T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  <  T2.balance
Database: small_bank_1
Question: What are the names of customers who have a savings balance lower than their checking balance, and what is the total of their checking and savings balances?
SQL: SELECT T1.name ,  T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  <  T2.balance
Database: small_bank_1
Question: Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.
SQL: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T2.balance DESC LIMIT 3
Database: small_bank_1
Question: What are names and savings balances of the three accounts with the highest savings balances?
SQL: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T2.balance DESC LIMIT 3
Database: browser_web
Question: How many main stream browsers whose market share is at least 5 exist?
SQL: SELECT count(*) FROM browser WHERE market_share  >=  5
Database: browser_web
Question: List the name of browsers in descending order by market share.
SQL: SELECT name FROM browser ORDER BY market_share DESC
Database: browser_web
Question: List the ids, names and market shares of all browsers.
SQL: SELECT id ,  name ,  market_share FROM browser
Database: browser_web
Question: What is the maximum, minimum and average market share of the listed browsers?
SQL: SELECT max(market_share) ,  min(market_share) ,  avg(market_share) FROM browser
Database: browser_web
Question: What is the id and market share of the browser Safari?
SQL: SELECT id ,  market_share FROM browser WHERE name  =  'Safari'
Database: browser_web
Question: What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
SQL: SELECT name ,  operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband'
Database: browser_web
Question: What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?
SQL: SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id  =  T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id  =  T3.id WHERE T3.name  =  'CProxy' AND T2.compatible_since_year  >  1998
Database: browser_web
Question: What are the ids and names of the web accelerators that are compatible with two or more browsers?
SQL: SELECT T1.id ,  T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2
Database: browser_web
Question: What is the id and name of the browser that is compatible with the most web accelerators?
SQL: SELECT T1.id ,  T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id  =  T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Database: browser_web
Question: When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
SQL: SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id  =  T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id  =  T3.id WHERE T3.name  =  'CACHEbox' AND T2.name  =  'Internet Explorer'
Database: browser_web
Question: How many different kinds of clients are supported by the web clients accelerators?
SQL: SELECT count(DISTINCT client) FROM web_client_accelerator
Database: browser_web
Question: List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
SQL: SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'Fasterfox'
Database: browser_web
Question: Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.
SQL: SELECT name ,  operating_system FROM web_client_accelerator EXCEPT SELECT T1.name ,  T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T3.name  =  'Opera'
Database: browser_web
Question: Which accelerator name contains substring "Opera"?
SQL: SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%"
Database: browser_web
Question: Find the number of web accelerators used for each Operating system.
SQL: SELECT Operating_system ,  count(*) FROM web_client_accelerator GROUP BY Operating_system
Database: browser_web
Question: give me names of all compatible browsers and accelerators in the descending order of compatible year
SQL: SELECT T2.name ,  T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id  =  T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id  =  T3.id ORDER BY T1.compatible_since_year DESC
Database: wrestler
Question: How many wrestlers are there?
SQL: SELECT count(*) FROM wrestler
Database: wrestler
Question: Count the number of wrestlers.
SQL: SELECT count(*) FROM wrestler
Database: wrestler
Question: List the names of wrestlers in descending order of days held.
SQL: SELECT Name FROM wrestler ORDER BY Days_held DESC
Database: wrestler
Question: What are the names of the wrestlers, ordered descending by days held?
SQL: SELECT Name FROM wrestler ORDER BY Days_held DESC
Database: wrestler
Question: What is the name of the wrestler with the fewest days held?
SQL: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1
Database: wrestler
Question: Return the name of the wrestler who had the lowest number of days held.
SQL: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1
Database: wrestler
Question: What are the distinct reigns of wrestlers whose location is not "Tokyo,Japan" ?
SQL: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"
Database: wrestler
Question: Give the different reigns of wrestlers who are not located in Tokyo, Japan.
SQL: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan"
Database: wrestler
Question: What are the names and location of the wrestlers?
SQL: SELECT Name ,  LOCATION FROM wrestler
Database: wrestler
Question: Give the names and locations of all wrestlers.
SQL: SELECT Name ,  LOCATION FROM wrestler
Database: wrestler
Question: What are the elimination moves of wrestlers whose team is "Team Orton"?
SQL: SELECT Elimination_Move FROM Elimination WHERE Team  =  "Team Orton"
Database: wrestler
Question: Return the elimination movies of wrestlers on Team Orton.
SQL: SELECT Elimination_Move FROM Elimination WHERE Team  =  "Team Orton"
Database: wrestler
Question: What are the names of wrestlers and the elimination moves?
SQL: SELECT T2.Name ,  T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID
Database: wrestler
Question: Give the names of wrestlers and their elimination moves.
SQL: SELECT T2.Name ,  T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID
Database: wrestler
Question: List the names of wrestlers and the teams in elimination in descending order of days held.
SQL: SELECT T2.Name ,  T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC
Database: wrestler
Question: What are the names of wrestlers and their teams in elimination, ordered descending by days held?
SQL: SELECT T2.Name ,  T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC
Database: wrestler
Question: List the time of elimination of the wrestlers with largest days held.
SQL: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1
Database: wrestler
Question: What is the time of elimination for the wrestler with the most days held?
SQL: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1
Database: wrestler
Question: Show times of elimination of wrestlers with days held more than 50.
SQL: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID WHERE T2.Days_held  >  50
Database: wrestler
Question: What are the times of elimination for wrestlers with over 50 days held?
SQL: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID WHERE T2.Days_held  >  50
Database: wrestler
Question: Show different teams in eliminations and the number of eliminations from each team.
SQL: SELECT Team ,  COUNT(*) FROM elimination GROUP BY Team
Database: wrestler
Question: How many eliminations did each team have?
SQL: SELECT Team ,  COUNT(*) FROM elimination GROUP BY Team
Database: wrestler
Question: Show teams that have suffered more than three eliminations.
SQL: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*)  >  3
Database: wrestler
Question: Which teams had more than 3 eliminations?
SQL: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*)  >  3
Database: wrestler
Question: Show the reign and days held of wrestlers.
SQL: SELECT Reign ,  Days_held FROM wrestler
Database: wrestler
Question: What are the reigns and days held of all wrestlers?
SQL: SELECT Reign ,  Days_held FROM wrestler
Database: wrestler
Question: What are the names of wrestlers days held less than 100?
SQL: SELECT Name FROM wrestler WHERE Days_held  <  100
Database: wrestler
Question: Return the names of wrestlers with fewer than 100 days held.
SQL: SELECT Name FROM wrestler WHERE Days_held  <  100
Database: wrestler
Question: Please show the most common reigns of wrestlers.
SQL: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1
Database: wrestler
Question: Which reign is the most common among wrestlers?
SQL: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1
Database: wrestler
Question: List the locations that are shared by more than two wrestlers.
SQL: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2
Database: wrestler
Question: Which locations are shared by more than two wrestlers?
SQL: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2
Database: wrestler
Question: List the names of wrestlers that have not been eliminated.
SQL: SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)
Database: wrestler
Question: What are the names of wrestlers who have never been eliminated?
SQL: SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination)
Database: wrestler
Question: Show the teams that have both wrestlers eliminated by "Orton" and wrestlers eliminated by "Benjamin".
SQL: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin"
Database: wrestler
Question: What are the teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin?
SQL: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin"
Database: wrestler
Question: What is the number of distinct teams that suffer elimination?
SQL: SELECT COUNT (DISTINCT team) FROM elimination
Database: wrestler
Question: How many different teams have had eliminated wrestlers?
SQL: SELECT COUNT (DISTINCT team) FROM elimination
Database: wrestler
Question: Show the times of elimination by "Punk" or "Orton".
SQL: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton"
Database: wrestler
Question: What are the times of elimination for any instances in which the elimination was done by Punk or Orton?
SQL: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton"
Database: school_finance
Question: How many schools are there?
SQL: SELECT count(*) FROM school
Database: school_finance
Question: Count the number of schools.
SQL: SELECT count(*) FROM school
Database: school_finance
Question: Show all school names in alphabetical order.
SQL: SELECT school_name FROM school ORDER BY school_name
Database: school_finance
Question: List the name, location, mascot for all schools.
SQL: SELECT school_name ,  LOCATION ,  mascot FROM school
Database: school_finance
Question: What are the total and average enrollment of all schools?
SQL: SELECT sum(enrollment) ,  avg(enrollment) FROM school
Database: school_finance
Question: What are the mascots for schools with enrollments above the average?
SQL: SELECT mascot FROM school WHERE enrollment  >  (SELECT avg(enrollment) FROM school)
Database: school_finance
Question: List the name of the school with the smallest enrollment.
SQL: SELECT school_name FROM school ORDER BY enrollment LIMIT 1
Database: school_finance
Question: Show the average, maximum, minimum enrollment of all schools.
SQL: SELECT avg(enrollment) ,  max(enrollment) ,  min(enrollment) FROM school
Database: school_finance
Question: Show each county along with the number of schools and total enrollment in each county.
SQL: SELECT county ,  count(*) ,  sum(enrollment) FROM school GROUP BY county
Database: school_finance
Question: How many donors have endowment for school named "Glenn"?
SQL: SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  "Glenn"
Database: school_finance
Question: List each donator name and the amount of endowment in descending order of the amount of endowment.
SQL: SELECT donator_name ,  sum(amount) FROM endowment GROUP BY donator_name ORDER BY sum(amount) DESC
Database: school_finance
Question: List the names of the schools without any endowment.
SQL: SELECT school_name FROM school WHERE school_id NOT IN (SELECT school_id FROM endowment)
Database: school_finance
Question: List all the names of schools with an endowment amount smaller than or equal to 10.
SQL: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount)  <=  10
Database: school_finance
Question: Show the names of donors who donated to both school "Glenn" and "Triton."
SQL: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Triton'
Database: school_finance
Question: Show the names of all the donors except those whose donation amount less than 9.
SQL: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount  <  9
Database: school_finance
Question: List the amount and donor name for the largest amount of donation.
SQL: SELECT amount ,  donator_name FROM endowment ORDER BY amount DESC LIMIT 1
Database: school_finance
Question: How many budgets are above 3000 in year 2001 or before?
SQL: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001
Database: school_finance
Question: Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000
SQL: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001
Database: school_finance
Question: Show each school name, its budgeted amount, and invested amount in year 2002 or after.
SQL: SELECT T2.school_name ,  T1.budgeted ,  T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.year  >=  2002
Database: school_finance
Question: Show all donor names.
SQL: SELECT DISTINCT donator_name FROM endowment
Database: school_finance
Question: How many budget record has a budget amount smaller than the invested amount?
SQL: SELECT count(*) FROM budget WHERE budgeted  <  invested
Database: school_finance
Question: What is the total budget amount for school "Glenn" in all years?
SQL: SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn'
Database: school_finance
Question: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.
SQL: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id JOIN endowment AS T3 ON T2.school_id  =  T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted)  >  100 OR sum(T3.amount)  >  10
Database: school_finance
Question: Find the names of schools that have more than one donator with donation amount above 8.5.
SQL: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.amount  >  8.5 GROUP BY T1.school_id HAVING count(*)  >  1
Database: school_finance
Question: Find the number of schools that have more than one donator whose donation amount is less than 8.5.
SQL: SELECT count(*) FROM (SELECT * FROM endowment WHERE amount  >  8.5 GROUP BY school_id HAVING count(*)  >  1)
Database: school_finance
Question: List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.
SQL: SELECT T1.School_name ,  T1.Mascot ,  T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id  =  T2.school_id WHERE Budgeted  >  6000 OR YEAR  <  2003 ORDER BY T2.total_budget_percent_invested ,  T2.total_budget_percent_budgeted
Database: protein_institute
Question: How many buildings are there?
SQL: SELECT count(*) FROM building
Database: protein_institute
Question: Show the name, street address, and number of floors for all buildings ordered by the number of floors.
SQL: SELECT name ,  street_address ,  floors FROM building ORDER BY floors
Database: protein_institute
Question: What is the name of the tallest building?
SQL: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1
Database: protein_institute
Question: What are the average, maximum, and minimum number of floors for all buildings?
SQL: SELECT avg(floors) ,  max(floors) ,  min(floors) FROM building
Database: protein_institute
Question: Show the number of buildings with a height above the average or a number of floors above the average.
SQL: SELECT count(*) FROM building WHERE height_feet  >  (SELECT avg(height_feet) FROM building) OR floors  >  (SELECT avg(floors) FROM building)
Database: protein_institute
Question: List the names of buildings with at least 200 feet of height and with at least 20 floors.
SQL: SELECT name FROM building WHERE height_feet  >=  200 AND floors  >=  20
Database: protein_institute
Question: Show the names and locations of institutions that are founded after 1990 and have the type "Private".
SQL: SELECT institution ,  LOCATION FROM institution WHERE founded  >  1990 AND TYPE  =  'Private'
Database: protein_institute
Question: Show institution types, along with the number of institutions and total enrollment for each type.
SQL: SELECT TYPE ,  count(*) ,  sum(enrollment) FROM institution GROUP BY TYPE
Database: protein_institute
Question: Show the institution type with the largest number of institutions.
SQL: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Database: protein_institute
Question: Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
SQL: SELECT TYPE FROM institution WHERE founded  >  1990 AND enrollment  >=  1000
Database: protein_institute
Question: Show the name of buildings that do not have any institution.
SQL: SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)
Database: protein_institute
Question: Show the names of buildings except for those having an institution founded in 2003.
SQL: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  =  2003
Database: protein_institute
Question: For each building, show the name of the building and the number of institutions in it.
SQL: SELECT T1.name ,  count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id GROUP BY T1.building_id
Database: protein_institute
Question: Show the names and heights of buildings with at least two institutions founded after 1880.
SQL: SELECT T1.name ,  T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  >  1880 GROUP BY T1.building_id HAVING count(*)  >=  2
Database: protein_institute
Question: Show all the distinct institution types.
SQL: SELECT DISTINCT TYPE FROM institution
Database: protein_institute
Question: Show institution names along with the number of proteins for each institution.
SQL: SELECT T1.institution ,  count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id GROUP BY T1.institution_id
Database: protein_institute
Question: How many proteins are associated with an institution founded after 1880 or an institution with type "Private"?
SQL: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id WHERE T1.founded  >  1880 OR T1.type  =  'Private'
Database: protein_institute
Question: Show the protein name and the institution name.
SQL: SELECT T2.protein_name ,  T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id
Database: protein_institute
Question: How many proteins are associated with an institution in a building with at least 20 floors?
SQL: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id JOIN building AS T3 ON T3.building_id  =  T1.building_id WHERE T3.floors  >=  20
Database: protein_institute
Question: How many institutions do not have an associated protein in our record?
SQL: SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein)
Database: cinema
Question: Show all the locations where no cinema has capacity over 800.
SQL: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity  >  800
Database: cinema
Question: Show all the locations where some cinemas were opened in both year 2010 and year 2011.
SQL: SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011
Database: cinema
Question: How many cinema do we have?
SQL: SELECT count(*) FROM cinema
Database: cinema
Question: Count the number of cinemas.
SQL: SELECT count(*) FROM cinema
Database: cinema
Question: Show name, opening year, and capacity for each cinema.
SQL: SELECT name ,  openning_year ,  capacity FROM cinema
Database: cinema
Question: Show the cinema name and location for cinemas with capacity above average.
SQL: SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema)
Database: cinema
Question: What are all the locations with a cinema?
SQL: SELECT DISTINCT LOCATION FROM cinema
Database: cinema
Question: Find the distinct locations that has a cinema.
SQL: SELECT DISTINCT LOCATION FROM cinema
Database: cinema
Question: Show all the cinema names and opening years in descending order of opening year.
SQL: SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC
Database: cinema
Question: What are the name and location of the cinema with the largest capacity?
SQL: SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
Database: cinema
Question: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.
SQL: SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011
Database: cinema
Question: Show each location and the number of cinemas there.
SQL: SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION
Database: cinema
Question: What is the location with the most cinemas opened in year 2010 or later?
SQL: SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
Database: cinema
Question: Show all the locations with at least two cinemas with capacity above 300.
SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
Database: cinema
Question: Which locations have 2 or more cinemas with capacity over 300?
SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
Database: cinema
Question: Show the title and director for all films.
SQL: SELECT title ,  directed_by FROM film
Database: cinema
Question: What are the title and director of each film?
SQL: SELECT title ,  directed_by FROM film
Database: cinema
Question: Show all directors.
SQL: SELECT DISTINCT directed_by FROM film
Database: cinema
Question: Who are all the directors?
SQL: SELECT DISTINCT directed_by FROM film
Database: cinema
Question: List all directors along with the number of films directed by each director.
SQL: SELECT directed_by ,  count(*) FROM film GROUP BY directed_by
Database: cinema
Question: What is total number of show times per dat for each cinema?
SQL: SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id
Database: cinema
Question: What are the title and maximum price of each film?
SQL: SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id
Database: cinema
Question: Give me the title and highest price for each film.
SQL: SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id
Database: cinema
Question: Show cinema name, film title, date, and price for each record in schedule.
SQL: SELECT T3.name ,  T2.title ,  T1.date ,  T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id JOIN cinema AS T3 ON T1.cinema_id  =  T3.cinema_id
Database: cinema
Question: What are the title and director of the films without any schedule?
SQL: SELECT title ,  directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)
Database: cinema
Question: Show director with the largest number of show times in total.
SQL: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1
Database: cinema
Question: Find the locations that have more than one movie theater with capacity above 300.
SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >  1
Database: cinema
Question: In which locations are there more than one movie theater with capacity above 300?
SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >  1
Database: cinema
Question: How many films have the word 'Dummy' in their titles?
SQL: SELECT count(*) FROM film WHERE title LIKE "%Dummy%"
Database: cinema
Question: Count the number of films whose title contains the word 'Dummy'.
SQL: SELECT count(*) FROM film WHERE title LIKE "%Dummy%"
Database: products_for_hire
Question: Are the customers holding coupons with amount 500 bad or good?
SQL: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.coupon_amount  =  500
Database: products_for_hire
Question: How many bookings did each customer make? List the customer id, first name, and the count.
SQL: SELECT T1.customer_id ,  T1.first_name ,  count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
Database: products_for_hire
Question: What is the maximum total amount paid by a customer? List the customer id and amount.
SQL: SELECT customer_id ,  sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) DESC LIMIT 1
Database: products_for_hire
Question: What are the id and the amount of refund of the booking that incurred the most times of payments?
SQL: SELECT T1.booking_id ,  T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id  =  T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) DESC LIMIT 1
Database: products_for_hire
Question: What is the id of the product that is booked for 3 times?
SQL: SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*)  =  3
Database: products_for_hire
Question: What is the product description of the product booked with an amount of 102.76?
SQL: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id  =  T2.product_id WHERE T1.booked_amount  =  102.76
Database: products_for_hire
Question: What are the start date and end date of the booking that has booked the product named 'Book collection A'?
SQL: SELECT T3.booking_start_date ,   T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id  =  T2.product_id JOIN bookings AS T3 ON T2.booking_id  =  T3.booking_id WHERE T1.product_name  =  'Book collection A'
Database: products_for_hire
Question: What are the names of products whose availability equals to 1?
SQL: SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id  =  T2.product_id WHERE T1.available_yn  =  1
Database: products_for_hire
Question: How many different product types are there?
SQL: SELECT count(DISTINCT product_type_code) FROM products_for_hire
Database: products_for_hire
Question: What are the first name, last name, and gender of all the good customers? Order by their last name.
SQL: SELECT first_name ,  last_name ,  gender_mf FROM customers WHERE good_or_bad_customer  =  'good' ORDER BY last_name
Database: products_for_hire
Question: What is the average amount due for all the payments?
SQL: SELECT avg(amount_due) FROM payments
Database: products_for_hire
Question: What are the maximum, minimum, and average booked count for the products booked?
SQL: SELECT max(booked_count) ,  min(booked_count) ,  avg(booked_count) FROM products_booked
Database: products_for_hire
Question: What are all the distinct payment types?
SQL: SELECT DISTINCT payment_type_code FROM payments
Database: products_for_hire
Question: What are the daily hire costs for the products with substring 'Book' in its name?
SQL: SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'
Database: products_for_hire
Question: How many products are never booked with amount higher than 200?
SQL: SELECT count(*) FROM Products_for_hire WHERE product_id NOT IN ( SELECT product_id FROM products_booked WHERE booked_amount  >  200 )
Database: products_for_hire
Question: What are the coupon amount of the coupons owned by both good and bad customers?
SQL: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.good_or_bad_customer  =  'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id  =  T2.coupon_id WHERE T2.good_or_bad_customer  =  'bad'
Database: products_for_hire
Question: What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check'
SQL: SELECT payment_date FROM payments WHERE amount_paid  >  300 OR payment_type_code  =  'Check'