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 is ids of the songs whose resolution is higher than the average resolution of songs in modern genre?
assistant
SELECT f_id FROM song WHERE resolution > (SELECT avg(resolution) FROM song WHERE genre_is = 'modern')
human
Return the names of songs for which format is mp3 and resolution is below 1000.
assistant
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = 'mp3' INTERSECT SELECT song_name FROM song WHERE resolution < 1000
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 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
Find the names of all English songs.
assistant
SELECT song_name FROM song WHERE languages = 'english'
human
Find the distinct names of all songs that have a higher resolution than some songs in English.
assistant
SELECT DISTINCT song_name FROM song WHERE resolution > ( SELECT MIN( resolution ) FROM song WHERE languages = "english" ) ;