human
Schema:
artist (Artist_ID, Artist, Age, Famous_Title, Famous_Release_date)
volume (Volume_ID, Volume_Issue, Issue_Date, Weeks_on_Top, Song, Artist_ID)
music_festival (ID, Music_Festival, Date_of_ceremony, Category, Volume, Result)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the maximum weeks on top in the table?
assistant
SELECT Weeks_on_Top FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1;
human
Which volume id has the maximum weeks on top?
assistant
SELECT distinct ( Volume_ID ) FROM volume WHERE Weeks_On_Top = ( SELECT Weeks_on_Top FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1 );
human
Hmm, I want to know what is the song in the volume with the maximum weeks on top please.
assistant
SELECT distinct ( Song ) FROM volume WHERE Weeks_On_Top = ( SELECT Weeks_on_Top FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1 ) ;