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 are the names of all artists?
assistant
SELECT DISTINCT artist FROM Artist;
human
Which of them have released volumes?
assistant
SELECT DISTINCT T1.artist FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID;
human
Only show those whose volumes spent more than 2 weeks on top.
assistant
SELECT DISTINCT T1.artist FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2;
human
List the famous titles of these artists.
assistant
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 ;