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 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
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
What are all the labels?
assistant
SELECT DISTINCT label FROM Albums
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
What is the most used instrument?
assistant
SELECT instrument FROM instruments GROUP BY instrument ORDER BY count(*) DESC LIMIT 1
human
What are the different instruments listed in the database?
assistant
SELECT DISTINCT instrument FROM Instruments ;