Database: music_1

Question: What is the name of the song that was released in the most recent year?
SQL: SELECT song_name ,  releasedate FROM song ORDER BY releasedate DESC LIMIT 1

Question: What is the id of the longest song?
SQL: SELECT f_id FROM files ORDER BY duration DESC LIMIT 1

Question: List the name and country of origin for all singers who have produced songs with rating above 9.
SQL: 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

Question: List the file size and format for all songs that have resolution lower than 800.
SQL: SELECT DISTINCT T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.resolution  <  800

Question: What is the name of the artist who produced the shortest song?
SQL: SELECT T1.artist_name FROM song AS T1 JOIN files AS T2 ON T1.f_id  =  T2.f_id ORDER BY T2.duration LIMIT 1

Question: What are the names and countries of origin for the artists who produced the top three highly rated songs.
SQL: 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

Question: How many songs have 4 minute duration?
SQL: SELECT count(*) FROM files WHERE duration LIKE "4:%"

Question: What is the average rating of songs produced by female artists?
SQL: SELECT avg(T2.rating) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name WHERE T1.gender  =  "Female"

Question: What is the most popular file format?
SQL: SELECT formats FROM files GROUP BY formats ORDER BY COUNT (*) DESC LIMIT 1

Question: Find the names of the artists who are from UK and have produced English songs.
SQL: SELECT artist_name FROM artist WHERE country  =  "UK" INTERSECT SELECT artist_name FROM song WHERE languages  =  "english"

Question: Find the id of songs that are available in mp4 format and have resolution lower than 1000.
SQL: SELECT f_id FROM files WHERE formats  =  "mp4" INTERSECT SELECT f_id FROM song WHERE resolution  <  1000

Question: What is the country of origin of the artist who is female and produced a song in Bangla?
SQL: 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"

Question: What is the average duration of songs that have mp3 format and resolution below 800?
SQL: SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T1.formats  =  "mp3" AND T2.resolution   <  800

Question: Return the gender and name of artist who produced the song with the lowest resolution.
SQL: SELECT T1.gender ,  T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name  =  T2.artist_name ORDER BY T2.resolution LIMIT 1

Question: Find the distinct names of all songs that have a higher resolution than some songs in English.
SQL: SELECT DISTINCT song_name FROM song WHERE resolution  >  (SELECT min(resolution) FROM song WHERE languages  =  "english")