prompt stringlengths 81 567 | completion stringlengths 18 557 |
|---|---|
Question: Show the names of players and names of their coaches.
Context: CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE coach (coach_name VARCHAR, Coach_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR)
Answer: | SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID |
Question: Show the names of players coached by the rank 1 coach.
Context: CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE coach (Coach_ID VARCHAR, Rank VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR)
Answer: | SELECT T3.Player_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T2.Rank = 1 |
Question: Show the names and genders of players with a coach starting after 2011.
Context: CREATE TABLE player (Player_name VARCHAR, gender VARCHAR, Player_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR, Starting_year INTEGER); CREATE TABLE coach (Coach_ID VARCHAR)
Answer: | SELECT T3.Player_name, T3.gender FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID WHERE T1.Starting_year > 2011 |
Question: Show the names of players and names of their coaches in descending order of the votes of players.
Context: CREATE TABLE coach (coach_name VARCHAR, Coach_ID VARCHAR); CREATE TABLE player_coach (Coach_ID VARCHAR, Player_ID VARCHAR); CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR, Votes VARCHAR)
Answer: | SELECT T3.Player_name, T2.coach_name FROM player_coach AS T1 JOIN coach AS T2 ON T1.Coach_ID = T2.Coach_ID JOIN player AS T3 ON T1.Player_ID = T3.Player_ID ORDER BY T3.Votes DESC |
Question: List the names of players that do not have coaches.
Context: CREATE TABLE player (Player_name VARCHAR, Player_ID VARCHAR); CREATE TABLE player_coach (Player_name VARCHAR, Player_ID VARCHAR)
Answer: | SELECT Player_name FROM player WHERE NOT Player_ID IN (SELECT Player_ID FROM player_coach) |
Question: Show the residences that have both a player of gender "M" and a player of gender "F".
Context: CREATE TABLE player (Residence VARCHAR, gender VARCHAR)
Answer: | SELECT Residence FROM player WHERE gender = "M" INTERSECT SELECT Residence FROM player WHERE gender = "F" |
Question: How many coaches does each club has? List the club id, name and the number of coaches.
Context: CREATE TABLE club (club_id VARCHAR, club_name VARCHAR); CREATE TABLE coach (club_id VARCHAR)
Answer: | SELECT T1.club_id, T1.club_name, COUNT(*) FROM club AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id |
Question: How many gold medals has the club with the most coaches won?
Context: CREATE TABLE match_result (club_id VARCHAR, gold VARCHAR); CREATE TABLE coach (club_id VARCHAR)
Answer: | SELECT T1.club_id, T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY COUNT(*) DESC LIMIT 1 |
Question: How many gymnasts are there?
Context: CREATE TABLE gymnast (Id VARCHAR)
Answer: | SELECT COUNT(*) FROM gymnast |
Question: List the total points of gymnasts in descending order.
Context: CREATE TABLE gymnast (Total_Points VARCHAR)
Answer: | SELECT Total_Points FROM gymnast ORDER BY Total_Points DESC |
Question: List the total points of gymnasts in descending order of floor exercise points.
Context: CREATE TABLE gymnast (Total_Points VARCHAR, Floor_Exercise_Points VARCHAR)
Answer: | SELECT Total_Points FROM gymnast ORDER BY Floor_Exercise_Points DESC |
Question: What is the average horizontal bar points for all gymnasts?
Context: CREATE TABLE gymnast (Horizontal_Bar_Points INTEGER)
Answer: | SELECT AVG(Horizontal_Bar_Points) FROM gymnast |
Question: What are the names of people in ascending alphabetical order?
Context: CREATE TABLE People (Name VARCHAR)
Answer: | SELECT Name FROM People ORDER BY Name |
Question: What are the names of gymnasts?
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
Answer: | SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID |
Question: What are the names of gymnasts whose hometown is not "Santo Domingo"?
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Hometown VARCHAR)
Answer: | SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID WHERE T2.Hometown <> "Santo Domingo" |
Question: What is the age of the tallest person?
Context: CREATE TABLE people (Age VARCHAR, Height VARCHAR)
Answer: | SELECT Age FROM people ORDER BY Height DESC LIMIT 1 |
Question: List the names of the top 5 oldest people.
Context: CREATE TABLE People (Name VARCHAR, Age VARCHAR)
Answer: | SELECT Name FROM People ORDER BY Age DESC LIMIT 5 |
Question: What is the total point count of the youngest gymnast?
Context: CREATE TABLE people (People_ID VARCHAR, Age VARCHAR); CREATE TABLE gymnast (Total_Points VARCHAR, Gymnast_ID VARCHAR)
Answer: | SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Age LIMIT 1 |
Question: What is the average age of all gymnasts?
Context: CREATE TABLE people (Age INTEGER, People_ID VARCHAR); CREATE TABLE gymnast (Gymnast_ID VARCHAR)
Answer: | SELECT AVG(T2.Age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID |
Question: What are the distinct hometowns of gymnasts with total points more than 57.5?
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR, Total_Points INTEGER); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)
Answer: | 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 |
Question: What are the hometowns of gymnasts and the corresponding number of gymnasts?
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)
Answer: | SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown |
Question: What is the most common hometown of gymnasts?
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)
Answer: | 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 |
Question: What are the hometowns that are shared by at least two gymnasts?
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR)
Answer: | 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 |
Question: List the names of gymnasts in ascending order by their heights.
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Height VARCHAR)
Answer: | SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height |
Question: List the distinct hometowns that are not associated with any gymnast.
Context: CREATE TABLE gymnast (Gymnast_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR, People_ID VARCHAR); CREATE TABLE people (Hometown VARCHAR)
Answer: | 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 |
Question: Show the hometowns shared by people older than 23 and younger than 20.
Context: CREATE TABLE people (Hometown VARCHAR, Age INTEGER)
Answer: | SELECT Hometown FROM people WHERE Age > 23 INTERSECT SELECT Hometown FROM people WHERE Age < 20 |
Question: How many distinct hometowns did these people have?
Context: CREATE TABLE people (Hometown VARCHAR)
Answer: | SELECT COUNT(DISTINCT Hometown) FROM people |
Question: Show the ages of gymnasts in descending order of total points.
Context: CREATE TABLE people (Age VARCHAR, People_ID VARCHAR); CREATE TABLE gymnast (Gymnast_ID VARCHAR, Total_Points VARCHAR)
Answer: | SELECT T2.Age FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T1.Total_Points DESC |
Question: Find the total savings balance of all accounts except the account with name ‘Brown’.
Context: CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR)
Answer: | SELECT SUM(T2.balance) FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T1.name <> 'Brown' |
Question: How many accounts are there in total?
Context: CREATE TABLE accounts (Id VARCHAR)
Answer: | SELECT COUNT(*) FROM accounts |
Question: What is the total checking balance in all accounts?
Context: CREATE TABLE checking (balance INTEGER)
Answer: | SELECT SUM(balance) FROM checking |
Question: Find the average checking balance.
Context: CREATE TABLE checking (balance INTEGER)
Answer: | SELECT AVG(balance) FROM checking |
Question: How many accounts have a savings balance above the average savings balance?
Context: CREATE TABLE savings (balance INTEGER)
Answer: | SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings) |
Question: Find the name and id of accounts whose checking balance is below the maximum checking balance.
Context: CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER)
Answer: | 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) |
Question: What is the checking balance of the account whose owner’s name contains the substring ‘ee’?
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (custid VARCHAR, name VARCHAR)
Answer: | SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%' |
Question: Find the checking balance and saving balance in the Brown’s account.
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR)
Answer: | 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' |
Question: Find the names of accounts whose checking balance is above the average checking balance, but savings balance is below the average savings balance.
Context: CREATE TABLE checking (custid VARCHAR, balance INTEGER); CREATE TABLE savings (custid VARCHAR, balance INTEGER); CREATE TABLE savings (balance INTEGER); CREATE TABLE checking (balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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) |
Question: Find the checking balance of the accounts whose savings balance is higher than the average savings balance.
Context: CREATE TABLE accounts (custid VARCHAR, name VARCHAR); CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER)
Answer: | 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)) |
Question: List all customers’ names in the alphabetical order.
Context: CREATE TABLE accounts (name VARCHAR)
Answer: | SELECT name FROM accounts ORDER BY name |
Question: Find the name of account that has the lowest total checking and saving balance.
Context: CREATE TABLE checking (custid VARCHAR, balance VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
Question: Find the names and total checking and savings balances of accounts whose savings balance is higher than the average savings balance.
Context: CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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) |
Question: Find the name and checking balance of the account with the lowest savings balance.
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
Question: Find the number of checking accounts for each account name.
Context: CREATE TABLE checking (custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | SELECT COUNT(*), T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid GROUP BY T1.name |
Question: Find the total saving balance for each account name.
Context: CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name |
Question: Find the name of accounts whose checking balance is below the average checking balance.
Context: CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (balance INTEGER); CREATE TABLE checking (custid VARCHAR, balance INTEGER)
Answer: | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking) |
Question: Find the saving balance of the account with the highest checking balance.
Context: CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE checking (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (custid VARCHAR)
Answer: | 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 |
Question: Find the total checking and saving balance of all accounts sorted by the total balance in ascending order.
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR)
Answer: | SELECT T1.balance + T2.balance FROM checking AS T1 JOIN savings AS T2 ON T1.custid = T2.custid ORDER BY T1.balance + T2.balance |
Question: Find the name and checking balance of the account with the lowest saving balance.
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (custid VARCHAR, balance VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
Question: Find the name, checking balance and saving balance of all accounts in the bank.
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
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.
Context: CREATE TABLE checking (balance VARCHAR, custid VARCHAR); CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
Question: Find the name of accounts whose checking balance is higher than corresponding saving balance.
Context: CREATE TABLE savings (custid VARCHAR, balance INTEGER); CREATE TABLE accounts (name VARCHAR, custid VARCHAR); CREATE TABLE checking (custid VARCHAR, balance INTEGER)
Answer: | 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 |
Question: Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance.
Context: CREATE TABLE checking (balance INTEGER, custid VARCHAR); CREATE TABLE savings (balance INTEGER, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
Question: Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order.
Context: CREATE TABLE savings (balance VARCHAR, custid VARCHAR); CREATE TABLE accounts (name VARCHAR, custid VARCHAR)
Answer: | 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 |
Question: How many main stream browsers whose market share is at least 5 exist?
Context: CREATE TABLE browser (market_share VARCHAR)
Answer: | SELECT COUNT(*) FROM browser WHERE market_share >= 5 |
Question: List the name of browsers in descending order by market share.
Context: CREATE TABLE browser (name VARCHAR, market_share VARCHAR)
Answer: | SELECT name FROM browser ORDER BY market_share DESC |
Question: List the ids, names and market shares of all browsers.
Context: CREATE TABLE browser (id VARCHAR, name VARCHAR, market_share VARCHAR)
Answer: | SELECT id, name, market_share FROM browser |
Question: What is the maximum, minimum and average market share of the listed browsers?
Context: CREATE TABLE browser (market_share INTEGER)
Answer: | SELECT MAX(market_share), MIN(market_share), AVG(market_share) FROM browser |
Question: What is the id and market share of the browser Safari?
Context: CREATE TABLE browser (id VARCHAR, market_share VARCHAR, name VARCHAR)
Answer: | SELECT id, market_share FROM browser WHERE name = 'Safari' |
Question: What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection?
Context: CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR, CONNECTION VARCHAR)
Answer: | SELECT name, operating_system FROM web_client_accelerator WHERE CONNECTION <> 'Broadband' |
Question: What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ?
Context: CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR, accelerator_id VARCHAR, compatible_since_year VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR)
Answer: | 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 |
Question: What are the ids and names of the web accelerators that are compatible with two or more browsers?
Context: CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, Name VARCHAR)
Answer: | 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 |
Question: What is the id and name of the browser that is compatible with the most web accelerators?
Context: CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR)
Answer: | 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 |
Question: When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible?
Context: CREATE TABLE accelerator_compatible_browser (compatible_since_year VARCHAR, browser_id VARCHAR, accelerator_id VARCHAR); CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR)
Answer: | 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' |
Question: How many different kinds of clients are supported by the web clients accelerators?
Context: CREATE TABLE web_client_accelerator (client VARCHAR)
Answer: | SELECT COUNT(DISTINCT client) FROM web_client_accelerator |
Question: How many accelerators are not compatible with the browsers listed ?
Context: CREATE TABLE accelerator_compatible_browser (id VARCHAR, accelerator_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, accelerator_id VARCHAR)
Answer: | SELECT COUNT(*) FROM web_client_accelerator WHERE NOT id IN (SELECT accelerator_id FROM accelerator_compatible_browser) |
Question: What distinct accelerator names are compatible with the browswers that have market share higher than 15?
Context: CREATE TABLE web_client_accelerator (name VARCHAR, id VARCHAR); CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE browser (id VARCHAR, market_share INTEGER)
Answer: | SELECT DISTINCT T1.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 T3.market_share > 15 |
Question: List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'.
Context: CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE web_client_accelerator (id VARCHAR, name VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR)
Answer: | 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' |
Question: Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'.
Context: CREATE TABLE browser (id VARCHAR, name VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR); CREATE TABLE accelerator_compatible_browser (accelerator_id VARCHAR, browser_id VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, operating_system VARCHAR, id VARCHAR)
Answer: | 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' |
Question: Which accelerator name contains substring "Opera"?
Context: CREATE TABLE web_client_accelerator (name VARCHAR)
Answer: | SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%" |
Question: Find the number of web accelerators used for each Operating system.
Context: CREATE TABLE web_client_accelerator (Operating_system VARCHAR)
Answer: | SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system |
Question: give me names of all compatible browsers and accelerators in the descending order of compatible year
Context: CREATE TABLE accelerator_compatible_browser (browser_id VARCHAR, accelerator_id VARCHAR, compatible_since_year VARCHAR); CREATE TABLE web_client_accelerator (name VARCHAR, id VARCHAR); CREATE TABLE browser (name VARCHAR, id VARCHAR)
Answer: | 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 |
Question: How many wrestlers are there?
Context: CREATE TABLE wrestler (Id VARCHAR)
Answer: | SELECT COUNT(*) FROM wrestler |
Question: List the names of wrestlers in descending order of days held.
Context: CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR)
Answer: | SELECT Name FROM wrestler ORDER BY Days_held DESC |
Question: What is the name of the wrestler with the fewest days held?
Context: CREATE TABLE wrestler (Name VARCHAR, Days_held VARCHAR)
Answer: | SELECT Name FROM wrestler ORDER BY Days_held LIMIT 1 |
Question: What are the distinct reigns of wrestlers whose location is not "Tokyo,Japan" ?
Context: CREATE TABLE wrestler (Reign VARCHAR, LOCATION VARCHAR)
Answer: | SELECT DISTINCT Reign FROM wrestler WHERE LOCATION <> "Tokyo , Japan" |
Question: What are the names and location of the wrestlers?
Context: CREATE TABLE wrestler (Name VARCHAR, LOCATION VARCHAR)
Answer: | SELECT Name, LOCATION FROM wrestler |
Question: What are the elimination moves of wrestlers whose team is "Team Orton"?
Context: CREATE TABLE Elimination (Elimination_Move VARCHAR, Team VARCHAR)
Answer: | SELECT Elimination_Move FROM Elimination WHERE Team = "Team Orton" |
Question: What are the names of wrestlers and the elimination moves?
Context: CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE elimination (Elimination_Move VARCHAR, Wrestler_ID VARCHAR)
Answer: | SELECT T2.Name, T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID |
Question: List the names of wrestlers and the teams in elimination in descending order of days held.
Context: CREATE TABLE elimination (Team VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR, Days_held VARCHAR)
Answer: | 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 |
Question: List the time of elimination of the wrestlers with largest days held.
Context: CREATE TABLE wrestler (Wrestler_ID VARCHAR, Days_held VARCHAR); CREATE TABLE elimination (Time VARCHAR, Wrestler_ID VARCHAR)
Answer: | 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 |
Question: Show times of elimination of wrestlers with days held more than 50.
Context: CREATE TABLE wrestler (Wrestler_ID VARCHAR, Days_held INTEGER); CREATE TABLE elimination (Time VARCHAR, Wrestler_ID VARCHAR)
Answer: | SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID = T2.Wrestler_ID WHERE T2.Days_held > 50 |
Question: Show different teams in eliminations and the number of eliminations from each team.
Context: CREATE TABLE elimination (Team VARCHAR)
Answer: | SELECT Team, COUNT(*) FROM elimination GROUP BY Team |
Question: Show teams that have suffered more than three eliminations.
Context: CREATE TABLE elimination (Team VARCHAR)
Answer: | SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*) > 3 |
Question: Show the reign and days held of wrestlers.
Context: CREATE TABLE wrestler (Reign VARCHAR, Days_held VARCHAR)
Answer: | SELECT Reign, Days_held FROM wrestler |
Question: What are the names of wrestlers days held less than 100?
Context: CREATE TABLE wrestler (Name VARCHAR, Days_held INTEGER)
Answer: | SELECT Name FROM wrestler WHERE Days_held < 100 |
Question: Please show the most common reigns of wrestlers.
Context: CREATE TABLE wrestler (Reign VARCHAR)
Answer: | SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1 |
Question: List the locations that are shared by more than two wrestlers.
Context: CREATE TABLE wrestler (LOCATION VARCHAR)
Answer: | SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*) > 2 |
Question: List the names of wrestlers that have not been eliminated.
Context: CREATE TABLE elimination (Name VARCHAR, Wrestler_ID VARCHAR); CREATE TABLE wrestler (Name VARCHAR, Wrestler_ID VARCHAR)
Answer: | SELECT Name FROM wrestler WHERE NOT Wrestler_ID IN (SELECT Wrestler_ID FROM elimination) |
Question: Show the teams that have both wrestlers eliminated by "Orton" and wrestlers eliminated by "Benjamin".
Context: CREATE TABLE Elimination (Team VARCHAR, Eliminated_By VARCHAR)
Answer: | SELECT Team FROM Elimination WHERE Eliminated_By = "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = "Benjamin" |
Question: What is the number of distinct teams that suffer elimination?
Context: CREATE TABLE elimination (team VARCHAR)
Answer: | SELECT COUNT(DISTINCT team) FROM elimination |
Question: Show the times of elimination by "Punk" or "Orton".
Context: CREATE TABLE elimination (TIME VARCHAR, Eliminated_By VARCHAR)
Answer: | SELECT TIME FROM elimination WHERE Eliminated_By = "Punk" OR Eliminated_By = "Orton" |
Question: How many schools are there?
Context: CREATE TABLE school (Id VARCHAR)
Answer: | SELECT COUNT(*) FROM school |
Question: Show all school names in alphabetical order.
Context: CREATE TABLE school (school_name VARCHAR)
Answer: | SELECT school_name FROM school ORDER BY school_name |
Question: List the name, location, mascot for all schools.
Context: CREATE TABLE school (school_name VARCHAR, LOCATION VARCHAR, mascot VARCHAR)
Answer: | SELECT school_name, LOCATION, mascot FROM school |
Question: What are the total and average enrollment of all schools?
Context: CREATE TABLE school (enrollment INTEGER)
Answer: | SELECT SUM(enrollment), AVG(enrollment) FROM school |
Question: What are the mascots for schools with enrollments above the average?
Context: CREATE TABLE school (mascot VARCHAR, enrollment INTEGER)
Answer: | SELECT mascot FROM school WHERE enrollment > (SELECT AVG(enrollment) FROM school) |
Question: List the name of the school with the smallest enrollment.
Context: CREATE TABLE school (school_name VARCHAR, enrollment VARCHAR)
Answer: | SELECT school_name FROM school ORDER BY enrollment LIMIT 1 |
Question: Show the average, maximum, minimum enrollment of all schools.
Context: CREATE TABLE school (enrollment INTEGER)
Answer: | SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school |
Question: Show each county along with the number of schools and total enrollment in each county.
Context: CREATE TABLE school (county VARCHAR, enrollment INTEGER)
Answer: | SELECT county, COUNT(*), SUM(enrollment) FROM school GROUP BY county |
Question: How many donors have endowment for school named "Glenn"?
Context: CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR)
Answer: | 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" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.