human
Schema:
Songs (SongId, Title)
Albums (AId, Title, Year, Label, Type)
Band (Id, Firstname, Lastname)
Instruments (SongId, BandmateId, Instrument)
Performance (SongId, Bandmate, StagePosition)
Tracklists (AlbumId, Position, SongId)
Vocals (SongId, Bandmate, Type)
Please answer with SQL.
assistant
Sure, I understand.
human
What is the most used instrument?
assistant
SELECT instrument FROM instruments GROUP BY instrument ORDER BY count(*) DESC LIMIT 1
human
What is the last name of the musician that have produced the most number of songs?
assistant
SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1
human
What are all the instruments used?
assistant
SELECT DISTINCT instrument FROM Instruments
human
How many instruments does the song 'Le Pop' use?
assistant
SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Le Pop'
human
How many instruments does the song 'Badlands' use?
assistant
SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = 'Badlands'
human
How many songs use drums as an instrument?
assistant
SELECT COUNT( * ) FROM instruments WHERE instrument = "drums" ;