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
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 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')
human
List the file size and format for all songs that have resolution lower than 800.
assistant
SELECT DISTINCT T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.resolution < 800
human
What are the ids of songs that are available in either mp4 format or have resolution above 720?
assistant
SELECT f_id FROM files WHERE formats = 'mp4' UNION SELECT f_id FROM song WHERE resolution > 720
human
What is ids of the songs whose resolution is higher than the resolution of any songs with rating lower than 8?
assistant
SELECT f_id FROM song WHERE resolution > (SELECT max(resolution) FROM song WHERE rating < 8)
human
What are the ids of all songs that have higher resolution of the average resolution in the modern genre?
assistant
SELECT f_id FROM song WHERE resolution > ( SELECT avg ( resolution ) FROM song WHERE genre_is = "modern" ) ;