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 names of all English songs.
assistant
SELECT song_name FROM song WHERE languages = 'english'
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 names of songs whose genre is modern or language is English.
assistant
SELECT song_name FROM song WHERE genre_is = 'modern' OR languages = 'english'
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 language that was used most often in songs with resolution above 500?
assistant
SELECT artist_name FROM song WHERE resolution > 500 GROUP BY languages ORDER BY count(*) DESC LIMIT 1
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 ;