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
Find the top 3 artists who have the largest number of songs works whose language is 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
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 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 is the number of artists for each gender?
assistant
SELECT count(*) , gender FROM artist GROUP BY gender
human
Find the names of the artists who are from Bangladesh and have never received rating higher than 7.
assistant
SELECT DISTINCT artist_name FROM artist WHERE country = 'Bangladesh' EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7
human
How many artists are from Bangladesh?
assistant
SELECT COUNT( * ) FROM artist WHERE country = "Bangladesh" ;