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
Find the name and country of origin for all artists who have release at least one song of resolution above 900.
assistant
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.resolution > 900 GROUP BY T2.artist_name HAVING count(*) >= 1
human
Find the names and number of works of all artists who have at least one English songs.
assistant
SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english' GROUP BY T2.artist_name HAVING count(*) >= 1
human
For each file format, return the number of artists who released songs in that format.
assistant
SELECT count(*) , formats FROM files GROUP BY formats
human
Give me a list of the names of all songs ordered by their resolution.
assistant
SELECT song_name FROM song ORDER BY resolution
human
Find the names and number of works of the three artists who have produced the most songs.
assistant
SELECT T1.artist_name , count(*) 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
List the name and gender for all artists who released songs in March.
assistant
SELECT T1.artist_name , T1.gender FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.releasedate LIKE "%Mar%" ;