human
Schema:
genre (g_name, rating, most_popular_in)
artist (artist_name, country, gender, preferred_genre)
files (f_id, artist_name, file_size, duration, formats)
song (song_name, artist_name, country, f_id, genre_is, rating, languages, releasedate, resolution)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of the top 3 artists with the largest number of songs?
assistant
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY COUNT( * ) DESC LIMIT 3;
human
What about the top 3 artists with the largest number of songs whose language is Bangla?
assistant
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'bangla' GROUP BY T2.artist_name ORDER BY COUNT( * ) DESC LIMIT 3;
human
What are their preferred genres?
assistant
SELECT T1.preferred_genre FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'bangla' GROUP BY T2.artist_name ORDER BY COUNT( * ) DESC LIMIT 3;
human
Could you list the names of all artists that prefer the genre folk and speak the language Bangla?
assistant
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'bangla' AND T1.preferred_genre = 'folk';
human
How about the names of all artists that prefer the genre folk?
assistant
SELECT artist_name FROM artist WHERE preferred_genre = "folk" ;