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
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 shortest duration and lowest rating of songs grouped by genre and ordered by genre?
assistant
SELECT min(T1.duration) , min(T2.rating) , T2.genre_is FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY T2.genre_is ORDER BY T2.genre_is
human
List the id, genre and artist name of English songs ordered by rating.
assistant
SELECT f_id , genre_is , artist_name FROM song WHERE languages = 'english' ORDER BY rating
human
What are the names of the songs whose rating is below the rating of all songs in English?
assistant
SELECT song_name FROM song WHERE rating < (SELECT min(rating) FROM song WHERE languages = 'english')
human
What are the names of the songs that have a lower rating than at least one blues song?
assistant
SELECT song_name FROM song WHERE rating < ( SELECT MAX( rating ) FROM song WHERE genre_is = "blues" ) ;