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
List the duration, file size and format of songs whose genre is pop, ordered by title?
assistant
SELECT T1.duration , T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = 'pop' ORDER BY T2.song_name
human
What are the maximum and minimum resolution of songs whose duration is 3 minutes?
assistant
SELECT max(T2.resolution) , min(T2.resolution) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE '3:%'
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
Find the names of all English songs.
assistant
SELECT song_name FROM song WHERE languages = 'english'
human
How many songs have 4 minute duration?
assistant
SELECT count(*) FROM files WHERE duration LIKE '4:%'
human
List the names of all songs that have 4 minute duration or are in English.
assistant
SELECT T2.song_name FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.duration LIKE "4:%" UNION SELECT song_name FROM song WHERE languages = "english" ;