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
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
Find all the instruments ever used by the musician with last name 'Heilo'?
assistant
SELECT instrument FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo'
human
How many songs have used the instrument 'drums'?
assistant
SELECT count(*) FROM instruments WHERE instrument = 'drums'
human
How many instrument does the musician with last name 'Heilo' use?
assistant
SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN Band AS T2 ON T1.bandmateid = T2.id WHERE T2.lastname = 'Heilo'
human
What are all the instruments used?
assistant
SELECT DISTINCT instrument FROM Instruments
human
What instrument is used the most?
assistant
SELECT instrument FROM instruments GROUP BY instrument ORDER BY COUNT( * ) DESC LIMIT 1 ;