lianghsun/spider-text2sql-bench huggingface dataset:
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
How many distinct artists do the volumes associate to?

### SQL
SELECT COUNT(DISTINCT Artist_ID) FROM volume
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Count the number of distinct artists who have volumes.

### SQL
SELECT COUNT(DISTINCT Artist_ID) FROM volume
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Please show the date of ceremony of the volumes that last more than 2 weeks on top.

### SQL
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T2.Weeks_on_Top  >  2
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the dates of ceremony at music festivals corresponding to volumes that lasted more than 2 weeks on top?

### SQL
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T2.Weeks_on_Top  >  2
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Please show the songs that have result "nominated" at music festivals.

### SQL
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T1.Result  =  "Nominated"
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the songs in volumes that have resulted in a nomination at music festivals?

### SQL
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume  =  T2.Volume_ID WHERE T1.Result  =  "Nominated"
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the issue dates of volumes associated with the artist "Gorgoroth"?

### SQL
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.Artist  =  "Gorgoroth"
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the issue dates of volumes that are by the artist named Gorgoroth.

### SQL
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.Artist  =  "Gorgoroth"
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the songs in volumes associated with the artist aged 32 or older?

### SQL
SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  >=  32
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return names of songs in volumes that are by artists that are at least 32 years old.

### SQL
SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  >=  32
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What is the average weeks on top of volumes associated with the artist aged 25 or younger?

### SQL
SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  25
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the average number of weeks on top for volumes by artists that are at most 25 years old.

### SQL
SELECT avg(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  25
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the famous title of the artists associated with volumes with more than 2 weeks on top?

### SQL
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the famous titles for artists that have volumes that lasted more than 2 weeks on top.

### SQL
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Please list the age and famous title of artists in descending order of age.

### SQL
SELECT Famous_Title ,  Age FROM artist ORDER BY Age DESC
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the famous titles and ages of each artist, listed in descending order by age?

### SQL
SELECT Famous_Title ,  Age FROM artist ORDER BY Age DESC
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What is the famous release date of the artist with the oldest age?

### SQL
SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the famous release date for the oldest artist.

### SQL
SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Please show the categories of the music festivals and the count.

### SQL
SELECT Category ,  COUNT(*) FROM music_festival GROUP BY Category
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the number of music festivals of each category.

### SQL
SELECT Category ,  COUNT(*) FROM music_festival GROUP BY Category
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What is the most common result of the music festival?

### SQL
SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the result that is most frequent at music festivals.

### SQL
SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Please show the categories of the music festivals with count more than 1.

### SQL
SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*)  >  1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the categories of music festivals for which there have been more than 1 music festival?

### SQL
SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*)  >  1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What is the song in the volume with the maximum weeks on top?

### SQL
SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the song in the volume that has spent the most weeks on top?

### SQL
SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Find the famous titles of artists that do not have any volume.

### SQL
SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the famous titles of artists who do not have any volumes?

### SQL
SELECT Famous_Title FROM artist WHERE Artist_ID NOT IN(SELECT Artist_ID FROM volume)
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.

### SQL
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top?

### SQL
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"?

### SQL
SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the dates of ceremony corresponding to music festivals that had the category "Best Song" and result "Awarded".

### SQL
SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded"
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What is the issue date of the volume with the minimum weeks on top?

### SQL
SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the issue date of the volume that has spent the fewest weeks on top.

### SQL
SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
How many distinct artists have volumes?

### SQL
SELECT COUNT(DISTINCT Artist_ID) FROM volume
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Count the number of artists who have had volumes.

### SQL
SELECT COUNT(DISTINCT Artist_ID) FROM volume
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.

### SQL
SELECT RESULT ,  COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
How many music festivals have had each kind of result, ordered descending by count?

### SQL
SELECT RESULT ,  COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
What are the issue dates of volumes associated with the artist aged 23 or younger?

### SQL
SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23
### Database Schema
CREATE TABLE "artist" (
    "Artist_ID" int,
    "Artist" text,
    "Age" int,
    "Famous_Title" text,
    "Famous_Release_date" text,
    PRIMARY KEY ("Artist_ID")
)

CREATE TABLE "volume" (
    "Volume_ID" int,
    "Volume_Issue" text,
    "Issue_Date" text,
    "Weeks_on_Top" real,
    "Song" text,
    "Artist_ID" int,
    PRIMARY KEY ("Volume_ID"),
    FOREIGN KEY (`Artist_ID`) REFERENCES `artist`(`Artist_ID`)
)

CREATE TABLE "music_festival" (
    "ID" int,
    "Music_Festival" text,
    "Date_of_ceremony" text,
    "Category" text,
    "Volume" int,
    "Result" text,
    PRIMARY KEY (`ID`),
    FOREIGN KEY (`Volume`) REFERENCES `volume`(`Volume_ID`)
)

### Question
Return the issue dates of volumes by artists who are at most 23 years old?

### SQL
SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
How many roller coasters are there?

### SQL
SELECT count(*) FROM roller_coaster
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
List the names of roller coasters by ascending order of length.

### SQL
SELECT Name FROM roller_coaster ORDER BY LENGTH ASC
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
What are the lengths and heights of roller coasters?

### SQL
SELECT LENGTH ,  Height FROM roller_coaster
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
List the names of countries whose language is not "German".

### SQL
SELECT Name FROM country WHERE Languages != "German"
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the statuses of roller coasters longer than 3300 or higher than 100.

### SQL
SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  100
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
What are the speeds of the longest roller coaster?

### SQL
SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
What is the average speed of roller coasters?

### SQL
SELECT avg(Speed) FROM roller_coaster
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the different statuses and the numbers of roller coasters for each status.

### SQL
SELECT Status ,  COUNT(*) FROM roller_coaster GROUP BY Status
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Please show the most common status of roller coasters.

### SQL
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
List the status shared by more than two roller coaster.

### SQL
SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*)  >  2
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the park of the roller coaster with the highest speed.

### SQL
SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the names of roller coasters and names of country they are in.

### SQL
SELECT T2.Name ,  T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the names of countries that have more than one roller coaster.

### SQL
SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name HAVING COUNT(*)  >  1
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the name and population of the country that has the highest roller coaster.

### SQL
SELECT T1.Name ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
Show the names of countries and the average speed of roller coasters from each country.

### SQL
SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
How many countries do not have an roller coaster longer than 3000?

### SQL
SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 )
### Database Schema
CREATE TABLE "roller_coaster" (
"Roller_Coaster_ID" int,
"Name" text,
"Park" text,
"Country_ID" int,
"Length" real,
"Height" real,
"Speed" text,
"Opened" text,
"Status" text,
PRIMARY KEY ("Roller_Coaster_ID"),
FOREIGN KEY ("Country_ID") REFERENCES `country`("Country_ID")
)

CREATE TABLE "country" (
"Country_ID" int,
"Name" text,
"Population" int,
"Area" int,
"Languages" text,
PRIMARY KEY ("Country_ID")
)

### Question
What are the country names, area and population which has both roller coasters with speed higher

### SQL
SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  >  60 INTERSECT SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  <  55
### Database Schema
CREATE TABLE "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
)

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
)

### Question
How many different captain ranks are there?

### SQL
SELECT count(DISTINCT rank) FROM captain
### Database Schema
CREATE TABLE "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
)

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
)

### Question
Count the number of different ranks of captain.

### SQL
SELECT count(DISTINCT rank) FROM captain
### Database Schema
CREATE TABLE "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
)

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
)

### Question
How many captains are in each rank?

### SQL
SELECT count(*) ,  rank FROM captain GROUP BY rank
### Database Schema
CREATE TABLE "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
)

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
)

### Question
Count the number of captains that have each rank.

### SQL
SELECT count(*) ,  rank FROM captain GROUP BY rank
### Database Schema
CREATE TABLE "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
)

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
)

### Question
How many captains with younger than 50 are in each rank?

### SQL
SELECT count(*) ,  rank FROM captain WHERE age  <  50 GROUP BY rank
### Database Schema
CREATE TABLE "captain" (
"Captain_ID" int,
"Name" text,
"Ship_ID" int,
"age" text,
"Class" text,
"Rank" text,
PRIMARY KEY ("Captain_ID"),
FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID")
)

CREATE TABLE "Ship" (
"Ship_ID" int,
"Name" text,
"Type" text,
"Built_Year" real,
"Class" text,
"Flag" text,
PRIMARY KEY ("Ship_ID")
)

### Question
Count the number of captains younger than 50 of each rank.

### SQL
SELECT count(*) ,  rank FROM captain WHERE age  <  50 GROUP BY rank