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 average rating and resolution of songs that are in Bangla?
assistant
SELECT avg(rating) , avg(resolution) FROM song WHERE languages = 'bangla'
human
Find the country of origin for the artist who made the least number of songs?
assistant
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) LIMIT 1
human
What are the names and countries of origin for the artists who produced the top three highly rated songs.
assistant
SELECT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3
human
Find the names of the artists who have produced English songs but have never received rating higher than 8.
assistant
SELECT DISTINCT artist_name FROM song WHERE languages = 'english' EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 8
human
How many artists are from Bangladesh?
assistant
SELECT count(*) FROM artist WHERE country = 'Bangladesh'
human
What are the names of the different artists from Bangladesh who never received a rating higher than a 7?
assistant
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7 ;