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
How many artists are from Bangladesh?
assistant
SELECT count(*) FROM artist WHERE country = 'Bangladesh'
human
What is the language used most often in the songs?
assistant
SELECT languages FROM song GROUP BY languages ORDER BY count(*) DESC LIMIT 1
human
Find the names and number of works of the three artists who have produced the most songs.
assistant
SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T2.artist_name ORDER BY count(*) DESC LIMIT 3
human
What is the country of origin of the artist who is female and produced a song in Bangla?
assistant
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = 'Female' AND T2.languages = 'bangla'
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 are the top 3 artists with the largest number of songs in the language Bangla?
assistant
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "bangla" GROUP BY T2.artist_name ORDER BY COUNT( * ) DESC LIMIT 3 ;