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
List the name and country of origin for all singers who have produced songs with rating above 9.
assistant
SELECT DISTINCT T1.artist_name , T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.rating > 9
human
Find the names of all English songs.
assistant
SELECT song_name FROM song WHERE languages = 'english'
human
Find the names and number of works of all artists who have at least one English songs.
assistant
SELECT T1.artist_name , count(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = 'english' GROUP BY T2.artist_name HAVING count(*) >= 1
human
What are the names of artists who are Male and are from UK?
assistant
SELECT artist_name FROM artist WHERE country = 'UK' AND gender = 'Male'
human
Find the names of the artists who are from UK and have produced English songs.
assistant
SELECT artist_name FROM artist WHERE country = 'UK' INTERSECT SELECT artist_name FROM song WHERE languages = 'english'
human
What are the names of all singers that are from the UK and released a song in English?
assistant
SELECT artist_name FROM artist WHERE country = "UK" INTERSECT SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english" ;