aherntech/sparc huggingface dataset:
Database: device
Question sequence:
List all the shop names.
Which shop has the least quantity of devices, show the shop name.
What about the largest quantity one?
SQL query sequence:
SELECT Shop_Name FROM shop
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID  =  T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) ASC LIMIT 1
SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID  =  T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1
Final question: Show the name of the shop that have the largest quantity of devices in stock.
Final SQL: SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID  =  T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1
Database: device
Question sequence:
Show all the software platforms
How many for each?
SQL query sequence:
SELECT Software_Platform FROM device
SELECT Software_Platform, count(*) FROM device GROUP BY Software_Platform
Final question: Please show different software platforms and the corresponding number of devices using each.
Final SQL: SELECT Software_Platform ,  COUNT(*) FROM device GROUP BY Software_Platform
Database: device
Question sequence:
Show all the software platforms
How many device for each?
Order the software platforms by popularity, from the most to the least?
SQL query sequence:
SELECT Software_Platform FROM device
SELECT Software_Platform, count(*) FROM device GROUP BY Software_Platform
SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
Final question: Please show the software platforms of devices in descending order of the count.
Final SQL: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
Database: device
Question sequence:
Show all the software platforms
How many for each?
Which two are the most popular software platform?
What about top 1?
SQL query sequence:
SELECT Software_Platform FROM device
SELECT Software_Platform, count(*) FROM device GROUP BY Software_Platform
SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 2
SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1
Final question: List the software platform shared by the greatest number of devices.
Final SQL: SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1
Database: device
Question sequence:
What are the names of the shops?
Which shop has some devices in stock?
What about no device at all?
SQL query sequence:
SELECT Shop_Name FROM shop
SELECT Shop_Name FROM shop WHERE Shop_ID IN (SELECT Shop_ID FROM stock)
SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)
Final question: List the names of shops that have no devices in stock.
Final SQL: SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)
Database: device
Question sequence:
Show all the shop names and the location
Keep those shops which opened in January.
Keep the locations shared by shops with open year later than 2012 and shops with open year before 2008.
SQL query sequence:
SELECT Shop_name, LOCATION FROM shop
SELECT Shop_name, LOCATION FROM shop WHERE Open_Date like "%Jan%"
SELECT LOCATION FROM shop WHERE Open_Year  >  2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year  <  2008
Final question: Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.
Final SQL: SELECT LOCATION FROM shop WHERE Open_Year  >  2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year  <  2008
Database: device
Question sequence:
List all the carriers
Show all the unique carriers of the devices in the stock.
Which carriers have no devices in stock?
SQL query sequence:
SELECT Carrier FROM device
SELECT DISTINCT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID  =  T2.Device_ID
SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)
Final question: List the carriers of devices that have no devices in stock.
Final SQL: SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)
Database: musical
Question sequence:
List all the actors.
How many are there?
SQL query sequence:
SELECT * FROM actor
SELECT count(*) FROM actor
Final question: How many actors are there?
Final SQL: SELECT count(*) FROM actor
Database: musical
Question sequence:
Show all the names of the actors.
List them in ascending alphabetical order.
SQL query sequence:
SELECT Name FROM actor
SELECT Name FROM actor ORDER BY Name ASC
Final question: List the name of actors in ascending alphabetical order.
Final SQL: SELECT Name FROM actor ORDER BY Name ASC
Database: musical
Question sequence:
List all the actors.
How many in total?
What are the characters and duration of them?
SQL query sequence:
SELECT * FROM actor
SELECT count(*) FROM actor
SELECT Character ,  Duration FROM actor
Final question: What are the characters and duration of actors?
Final SQL: SELECT Character ,  Duration FROM actor
Database: musical
Question sequence:
List all the names and ages.
Keep the names who are younger than 21.
What about the names of actors whose age is not 20.
SQL query sequence:
SELECT Name, Age FROM actor
SELECT Name FROM actor WHERE Age < 21
SELECT Name FROM actor WHERE Age != 20
Final question: List the name of actors whose age is not 20.
Final SQL: SELECT Name FROM actor WHERE Age != 20
Database: musical
Question sequence:
Show the characters of actors.
List them in descending order of age.
SQL query sequence:
SELECT Character FROM actor
SELECT Character FROM actor ORDER BY age DESC
Final question: What are the characters of actors in descending order of age?
Final SQL: SELECT Character FROM actor ORDER BY age DESC
Database: musical
Question sequence:
List the durations of all actors.
What is the duration of 'Lynne McGranger'?
What about the oldest actor?
SQL query sequence:
SELECT Duration FROM actor
SELECT Duration FROM actor WHERE Name = 'Lynne McGranger'
SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
Final question: What is the duration of the oldest actor?
Final SQL: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1
Database: musical
Question sequence:
Show all the musical names information.
Which of them has the award of 'Tony Award'?
What about having the nominee of "Bob Fosse"?
SQL query sequence:
SELECT Name FROM musical
SELECT Name FROM musical WHERE Award = 'Tony Award'
SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
Final question: What are the names of musicals with nominee "Bob Fosse"?
Final SQL: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
Database: musical
Question sequence:
Show all the musical names information.
Which of them has the nominee of "Bob Fosse"?
How about the award of 'Tony Award'?
What about the distinct nominees of the musicals with the award that is not that award?
SQL query sequence:
SELECT Name FROM musical
SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse"
SELECT Name FROM musical WHERE Award = 'Tony Award'
SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award"
Final question: What are the distinct nominees of the musicals with the award that is not "Tony Award"?
Final SQL: SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award"
Database: musical
Question sequence:
List all the names of actors.
Show the names of actors and their corresponding musical names.
SQL query sequence:
SELECT * FROM actor
SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
Final question: Show names of actors and names of musicals they are in.
Final SQL: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
Database: musical
Question sequence:
Which actors appeared in musical with name "Wicked"?
What about "The Phantom of the Opera"?
SQL query sequence:
SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "Wicked"
SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "The Phantom of the Opera"
Final question: Show names of actors that have appeared in musical with name "The Phantom of the Opera".
Final SQL: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "The Phantom of the Opera"
Database: musical
Question sequence:
List the names of actors and their musical names.
Order the names of actors in in descending order of the year their musical is awarded.
SQL query sequence:
SELECT T1.Name,T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID ORDER BY T2.Year DESC
Final question: Show names of actors in descending order of the year their musical is awarded.
Final SQL: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID ORDER BY T2.Year DESC
Database: musical
Question sequence:
Which musical name has two actors?
Show each musical name and the number of actors.
SQL query sequence:
SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID having count(*) = 2
SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
Final question: Show names of musicals and the number of actors who have appeared in the musicals.
Final SQL: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID
Database: musical
Question sequence:
List the names of actors and their musical names.
What are the musical names that have two actors?
What about at least three actors?
SQL query sequence:
SELECT T1.Name,T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID
SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  =  2
SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3
Final question: Show names of musicals which have at least three actors.
Final SQL: SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3
Database: musical
Question sequence:
List all the nominee names.
Count how many musicals for each.
SQL query sequence:
SELECT Nominee  FROM musical
SELECT Nominee, count(*) FROM musical GROUP BY Nominee
Final question: Show different nominees and the number of musicals they have been nominated.
Final SQL: SELECT Nominee ,  COUNT(*) FROM musical GROUP BY Nominee
Database: musical
Question sequence:
Count how many musicals for each one.
Which nominee has 2 musicals?
Who has been nominated the greatest number of times?
SQL query sequence:
SELECT Nominee, count(*) FROM musical GROUP BY Nominee
SELECT Nominee FROM musical GROUP BY Nominee having count(*) = 2
SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1
Final question: Please show the nominee who has been nominated the greatest number of times.
Final SQL: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1
Database: musical
Question sequence:
List all the results from the musicals.
How many are there for each result type?
Which one is the most popular result?
SQL query sequence:
SELECT RESULT FROM musical
SELECT RESULT, count(*) FROM musical GROUP BY RESULT
SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
Final question: List the most common result of the musicals.
Final SQL: SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
Database: musical
Question sequence:
Show all the nominees.
Count how many musicals for each one.
Which nominee has 5 musicals?
How about more than two musicals?
SQL query sequence:
SELECT Nominee FROM musical
SELECT Nominee, count(*) FROM musical GROUP BY Nominee
SELECT Nominee FROM musical GROUP BY Nominee having count(*) = 5
SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2
Final question: List the nominees that have been nominated more than two musicals.
Final SQL: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2
Database: musical
Question sequence:
List all the information about musicals.
Show all the names of musicals which have actors.
What about having no actors?
SQL query sequence:
SELECT * FROM musical
SELECT Name FROM musical WHERE Musical_ID IN (SELECT Musical_ID FROM actor)
SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)
Final question: List the name of musicals that do not have actors.
Final SQL: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor)
Database: musical
Question sequence:
Show all the information about the musical that has the award of 'Tony Award'?
What are the nominees with award "Bob Fosse" or "Cleavant Derricks"?
What about both "Tony Award" and "Drama Desk Award"?
SQL query sequence:
SELECT * FROM musical WHERE Award = 'Tony Award'
SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks"
SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award"
Final question: Show the nominees that have nominated musicals for both "Tony Award" and "Drama Desk Award".
Final SQL: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award"