database_id
stringlengths 4
31
| query
stringlengths 22
577
| question
stringlengths 19
224
|
---|---|---|
device | SELECT avg(Quantity) FROM stock | What is the average quantity of stocks? |
device | SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC | What are the names and location of the shops in ascending alphabetical order of name. |
device | SELECT count(DISTINCT Software_Platform) FROM device | How many different software platforms are there for devices? |
device | SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple" | List the open date of open year of the shop named "Apple". |
device | SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1 | List the name of the shop with the latest open year. |
device | SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID | Show names of shops and the carriers of devices they have in stock. |
device | SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1 | Show names of shops that have more than one kind of device in stock. |
device | 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 COUNT(*) DESC LIMIT 1 | Show the name of the shop that has the most kind of devices in stock. |
device | 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 | Show the name of the shop that have the largest quantity of devices in stock. |
device | SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform | Please show different software platforms and the corresponding number of devices using each. |
device | SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC | Please show the software platforms of devices in descending order of the count. |
device | SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1 | List the software platform shared by the greatest number of devices. |
device | SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock) | List the names of shops that have no devices in stock. |
device | SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008 | Show the locations shared by shops with open year later than 2012 and shops with open year before 2008. |
device | SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock) | List the carriers of devices that have no devices in stock. |
musical | SELECT count(*) FROM actor | How many actors are there? |
musical | SELECT Name FROM actor ORDER BY Name ASC | List the name of actors in ascending alphabetical order. |
musical | SELECT Character , Duration FROM actor | What are the characters and duration of actors? |
musical | SELECT Name FROM actor WHERE Age != 20 | List the name of actors whose age is not 20. |
musical | SELECT Character FROM actor ORDER BY age DESC | What are the characters of actors in descending order of age? |
musical | SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1 | What is the duration of the oldest actor? |
musical | SELECT Name FROM musical WHERE Nominee = "Bob Fosse" | What are the names of musicals with nominee "Bob Fosse"? |
musical | SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award" | What are the distinct nominees of the musicals with the award that is not "Tony Award"? |
musical | SELECT T1.Name , T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID | Show names of actors and names of musicals they are in. |
musical | 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" | Show names of actors that have appeared in musical with name "The Phantom of the Opera". |
musical | SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID ORDER BY T2.Year DESC | Show names of actors in descending order of the year their musical is awarded. |
musical | SELECT T2.Name , COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID | Show names of musicals and the number of actors who have appeared in the musicals. |
musical | 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 | Show names of musicals which have at least three actors. |
musical | SELECT Nominee , COUNT(*) FROM musical GROUP BY Nominee | Show different nominees and the number of musicals they have been nominated. |
musical | SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1 | Please show the nominee who has been nominated the greatest number of times. |
musical | SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1 | List the most common result of the musicals. |
musical | SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*) > 2 | List the nominees that have been nominated more than two musicals. |
musical | SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor) | List the name of musicals that do not have actors. |
musical | SELECT Nominee FROM musical WHERE Award = "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award = "Drama Desk Award" | Show the nominees that have nominated musicals for both "Tony Award" and "Drama Desk Award". |