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 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
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 is the number of artists for each gender?
assistant
SELECT count(*) , gender FROM artist GROUP BY gender
human
What are the average rating and resolution of songs that are in Bangla?
assistant
SELECT avg(rating) , avg(resolution) FROM song WHERE languages = 'bangla'
human
What is the average rating of songs for each language?
assistant
SELECT avg(rating) , languages FROM song GROUP BY languages
human
What is the average rating of songs produced by female artists?
assistant
SELECT avg ( T2.rating ) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" ;