Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different types of vocals? [/INST]

Output: SELECT DISTINCT TYPE FROM vocals;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the albums produced in year 2010? [/INST]

Output: SELECT * FROM Albums WHERE YEAR  =  2010;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What information is there on albums from 2010? [/INST]

Output: SELECT * FROM Albums WHERE YEAR  =  2010;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Who performed the song named "Le Pop"? [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Le Pop";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What is the first and last name of artist who performed "Le Pop"? [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Le Pop";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What is the last name of the musician that have produced the most songs? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What is the last name of the artist who sang the most songs? [/INST]

Output: 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;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What instrument did the musician with last name "Heilo" use in the song "Badlands"? [/INST]

Output: SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId JOIN Instruments AS T4 ON T4.songid  =  T3.songid AND T4.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo" AND T3.title  =  "Badlands";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What instruments did the musician with the last name "Heilo" play in "Badlands"? [/INST]

Output: SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId JOIN Instruments AS T4 ON T4.songid  =  T3.songid AND T4.bandmateid  =  T2.id WHERE T2.lastname  =  "Heilo" AND T3.title  =  "Badlands";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: How many instruments does the song "Badlands" use? [/INST]

Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Badlands";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: How many different instruments are used in the song "Badlands"? [/INST]

Output: SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Badlands";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the vocal types used in song "Badlands"? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Badlands";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What types of vocals are used in the song "Badlands"? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Badlands";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Find the number of vocal types used in song "Le Pop" [/INST]

Output: SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Le Pop";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: How many vocal types are used in the song "Le Pop"? [/INST]

Output: SELECT count(*) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE title  =  "Le Pop";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: How many songs have a shared vocal? [/INST]

Output: SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE TYPE  =  "shared";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: How many different songs have shared vocals? [/INST]

Output: SELECT count(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid WHERE TYPE  =  "shared";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Find all the songs that do not have a back vocal. [/INST]

Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different names of all songs without back vocals? [/INST]

Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Which vocal type has the band mate with first name "Solveig" played the most? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id WHERE firstname  =  "Solveig" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the types of vocals that the band member with the first name "Solveig" played the most? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id WHERE firstname  =  "Solveig" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Which vocal type did the musician with last name "Heilo" played in the song with title "Der Kapitan"? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid JOIN band AS T3 ON T1.bandmate  =  T3.id WHERE T3.lastname  =  "Heilo" AND T2.title  =  "Der Kapitan";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the types of vocals that the musician with the last name "Heilo" played in "Der Kapitan"? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN songs AS T2 ON T1.songid  =  T2.songid JOIN band AS T3 ON T1.bandmate  =  T3.id WHERE T3.lastname  =  "Heilo" AND T2.title  =  "Der Kapitan";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Find the first name of the band mate that has performed in most songs. [/INST]

Output: SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate  =  t2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What is the first name of the band mate who perfomed in the most songs? [/INST]

Output: SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate  =  t2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId GROUP BY firstname ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Which vocal type has the band mate with first name "Marianne" played the most? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id WHERE firstname  =  "Marianne" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What is the vocal type of the band mate whose first name is "Marianne" played the most? [/INST]

Output: SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate  =  T2.id WHERE firstname  =  "Marianne" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Who is performing in the back stage position for the song "Der Kapitan"? Show the first name and last name. [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Der Kapitan" AND T1.StagePosition  =  "back";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What is the first and last name of the artist who performed back stage for the song "Der Kapitan"? [/INST]

Output: SELECT T2.firstname ,  T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate  =  T2.id JOIN Songs AS T3 ON T3.SongId  =  T1.SongId WHERE T3.Title  =  "Der Kapitan" AND T1.StagePosition  =  "back";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of songs that does not have a back vocal. [/INST]

Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of the songs that do not have back vocals? [/INST]

Output: SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid  =  t2.songid WHERE TYPE  =  "back";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the songs in album "A Kiss Before You Go: Live in Hamburg"? [/INST]

Output: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE T1.title  =  "A Kiss Before You Go: Live in Hamburg";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the song titles on the album "A Kiss Before You Go: Live in Hamburg"? [/INST]

Output: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE T1.title  =  "A Kiss Before You Go: Live in Hamburg";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are all the songs in albums under label "Universal Music Group"? [/INST]

Output: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE t1.label  =  "Universal Music Group";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of all the songs whose album is under the label of "Universal Music Group"? [/INST]

Output: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE t1.label  =  "Universal Music Group";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: Find the number of songs in all the studio albums. [/INST]

Output: SELECT count(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE t1.type  =  "Studio";


Input:
[INST] Here is a database schema:
Songs :
SongId [ INT ] primary_key
Title [ TEXT ]

Albums :
AId [ INT ] primary_key
Title [ TEXT ]
Year [ INT ]
Label [ TEXT ]
Type [ TEXT ]

Band :
Id [ INT ] primary_key
Firstname [ TEXT ]
Lastname [ TEXT ]

Instruments :
SongId [ INT ] primary_key Instruments.SongId = Songs.SongId
BandmateId [ INT ] Instruments.BandmateId = Band.Id
Instrument [ TEXT ]

Performance :
SongId [ INT ] primary_key Performance.SongId = Songs.SongId
Bandmate [ INT ] Performance.Bandmate = Band.Id
StagePosition [ TEXT ]

Tracklists :
AlbumId [ INT ] primary_key Tracklists.AlbumId = Albums.AId
Position [ INT ]
SongId [ INT ] Tracklists.SongId = Songs.SongId

Vocals :
SongId [ INT ] primary_key Vocals.SongId = Songs.SongId
Bandmate [ INT ] Vocals.Bandmate = Band.Id
Type [ TEXT ]

Please write me a SQL statement that answers the following question: How many songs appear in studio albums? [/INST]

Output: SELECT count(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid  =  T2.albumid JOIN songs AS T3 ON T2.songid  =  T3.songid WHERE t1.type  =  "Studio";


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Who is the founder of Sony? [/INST]

Output: SELECT founder FROM manufacturers WHERE name  =  'Sony';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Return the founder of Sony. [/INST]

Output: SELECT founder FROM manufacturers WHERE name  =  'Sony';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Where is the headquarter of the company founded by James? [/INST]

Output: SELECT headquarter FROM manufacturers WHERE founder  =  'James';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the headquarter of the company whose founder is James? [/INST]

Output: SELECT headquarter FROM manufacturers WHERE founder  =  'James';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first. [/INST]

Output: SELECT name ,  headquarter FROM manufacturers ORDER BY revenue DESC;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names and headquarters of all manufacturers, ordered by revenue descending? [/INST]

Output: SELECT name ,  headquarter FROM manufacturers ORDER BY revenue DESC;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the average, maximum and total revenues of all companies? [/INST]

Output: SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Return the average, maximum, and total revenues across all manufacturers. [/INST]

Output: SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: How many companies were created by Andy? [/INST]

Output: SELECT count(*) FROM manufacturers WHERE founder  =  'Andy';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Return the number of companies created by Andy. [/INST]

Output: SELECT count(*) FROM manufacturers WHERE founder  =  'Andy';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the total revenue created by the companies whose headquarter is located at Austin. [/INST]

Output: SELECT sum(revenue) FROM manufacturers WHERE headquarter  =  'Austin';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the sum of revenue from companies with headquarters in Austin? [/INST]

Output: SELECT sum(revenue) FROM manufacturers WHERE headquarter  =  'Austin';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the different cities listed? [/INST]

Output: SELECT DISTINCT headquarter FROM manufacturers;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Give the distinct headquarters of manufacturers. [/INST]

Output: SELECT DISTINCT headquarter FROM manufacturers;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the number of manufactures that are based in Tokyo or Beijing. [/INST]

Output: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: How many manufacturers have headquarters in either Tokyo or Beijing? [/INST]

Output: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the founder of the company whose name begins with the letter 'S'. [/INST]

Output: SELECT founder FROM manufacturers WHERE name LIKE 'S%';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Who is the founders of companies whose first letter is S? [/INST]

Output: SELECT founder FROM manufacturers WHERE name LIKE 'S%';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name of companies whose revenue is between 100 and 150. [/INST]

Output: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of companies with revenue between 100 and 150? [/INST]

Output: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the total revenue of all companies whose main office is at Tokyo or Taiwan? [/INST]

Output: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Return the total revenue of companies with headquarters in Tokyo or Taiwan. [/INST]

Output: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name of product that is produced by both companies Creative Labs and Sony. [/INST]

Output: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of products produced by both Creative Labs and Sony? [/INST]

Output: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name, headquarter and founder of the manufacturer that has the highest revenue. [/INST]

Output: SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names, headquarters and founders of the company with the highest revenue? [/INST]

Output: SELECT name ,  headquarter ,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order. [/INST]

Output: SELECT name ,  headquarter ,  revenue FROM manufacturers ORDER BY revenue DESC;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names, headquarters and revenues for manufacturers, sorted by revenue descending? [/INST]

Output: SELECT name ,  headquarter ,  revenue FROM manufacturers ORDER BY revenue DESC;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name of companies whose revenue is greater than the average revenue of all companies. [/INST]

Output: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers);


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of manufacturers with revenue greater than the average of all revenues? [/INST]

Output: SELECT name FROM manufacturers WHERE revenue  >  (SELECT avg(revenue) FROM manufacturers);


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin. [/INST]

Output: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin');


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin? [/INST]

Output: SELECT name FROM manufacturers WHERE revenue  <  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin');


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin. [/INST]

Output: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin');


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin? [/INST]

Output: SELECT sum(revenue) FROM manufacturers WHERE revenue  >  (SELECT min(revenue) FROM manufacturers WHERE headquarter  =  'Austin');


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the total revenue of companies of each founder. [/INST]

Output: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the total revenue of companies started by founder? [/INST]

Output: SELECT sum(revenue) ,  founder FROM manufacturers GROUP BY founder;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name and revenue of the company that earns the highest revenue in each city. [/INST]

Output: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names and revenues of the companies with the highest revenues in each headquarter city? [/INST]

Output: SELECT name ,  max(revenue) ,  Headquarter FROM manufacturers GROUP BY Headquarter;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the total revenue for each manufacturer. [/INST]

Output: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the total revenue of each manufacturer? [/INST]

Output: SELECT sum(revenue) ,  name FROM manufacturers GROUP BY name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the average prices of all products from each manufacture, and list each company's name. [/INST]

Output: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the average prices of products for each manufacturer? [/INST]

Output: SELECT avg(T1.price) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the number of different products that are produced by companies at different headquarter cities. [/INST]

Output: SELECT count(DISTINCT T1.name) ,  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: How many different products are produced in each headquarter city? [/INST]

Output: SELECT count(DISTINCT T1.name) ,  T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.Headquarter;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find number of products which Sony does not make. [/INST]

Output: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony');


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: How many products are not made by Sony? [/INST]

Output: SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony');


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the name of companies that do not make DVD drive. [/INST]

Output: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of companies that do not make DVD drives? [/INST]

Output: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T1.name  =  'DVD drive';


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find the number of products for each manufacturer, showing the name of each company. [/INST]

Output: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: How many products are there for each manufacturer? [/INST]

Output: SELECT count(*) ,  T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the names of all the products in the store. [/INST]

Output: SELECT Name FROM Products;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of all products? [/INST]

Output: SELECT Name FROM Products;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the names and the prices of all the products in the store. [/INST]

Output: SELECT name ,  price FROM products;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names and prices of all products in the store? [/INST]

Output: SELECT name ,  price FROM products;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the name of the products with a price less than or equal to $200. [/INST]

Output: SELECT name FROM products WHERE price  <=  200;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names of products with price at most 200? [/INST]

Output: SELECT name FROM products WHERE price  <=  200;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Find all information of all the products with a price between $60 and $120. [/INST]

Output: SELECT * FROM products WHERE price BETWEEN 60 AND 120;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is all the information of all the products that have a price between 60 and 120? [/INST]

Output: SELECT * FROM products WHERE price BETWEEN 60 AND 120;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Compute the average price of all the products. [/INST]

Output: SELECT avg(price) FROM products;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the average price across all products? [/INST]

Output: SELECT avg(price) FROM products;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Compute the average price of all products with manufacturer code equal to 2. [/INST]

Output: SELECT avg(price) FROM products WHERE Manufacturer  =  2;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the average price of products with manufacturer codes equal to 2? [/INST]

Output: SELECT avg(price) FROM products WHERE Manufacturer  =  2;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Compute the number of products with a price larger than or equal to $180. [/INST]

Output: SELECT count(*) FROM products WHERE price >= 180;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: How many products have prices of at least 180? [/INST]

Output: SELECT count(*) FROM products WHERE price >= 180;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name  (in ascending order). [/INST]

Output: SELECT name ,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending? [/INST]

Output: SELECT name ,  price FROM products WHERE price  >=  180 ORDER BY price DESC ,  name ASC;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select all the data from the products and each product's manufacturer. [/INST]

Output: SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is all the product data, as well as  each product's manufacturer? [/INST]

Output: SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the average price of each manufacturer's products, showing only the manufacturer's code. [/INST]

Output: SELECT AVG(Price) ,  Manufacturer FROM Products GROUP BY Manufacturer;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the average prices of products, grouped by manufacturer code? [/INST]

Output: SELECT AVG(Price) ,  Manufacturer FROM Products GROUP BY Manufacturer;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the average price of each manufacturer's products, showing the manufacturer's name. [/INST]

Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the average prices of products, grouped by manufacturer name? [/INST]

Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the names of manufacturer whose products have an average price higher than or equal to $150. [/INST]

Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the names and average prices of products for manufacturers whose products cost on average 150 or more? [/INST]

Output: SELECT avg(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the name and price of the cheapest product. [/INST]

Output: SELECT name ,  price FROM Products ORDER BY price ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What is the name and price of the cheapest product? [/INST]

Output: SELECT name ,  price FROM Products ORDER BY price ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the name of each manufacturer along with the name and price of its most expensive product. [/INST]

Output: SELECT T1.Name ,  max(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: For each manufacturer name, what are the names and prices of their most expensive product? [/INST]

Output: SELECT T1.Name ,  max(T1.Price) ,  T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer  =  T2.code GROUP BY T2.name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: Select the code of the product that is cheapest in each product category. [/INST]

Output: SELECT code ,  name ,  min(price) FROM products GROUP BY name;


Input:
[INST] Here is a database schema:
Manufacturers :
Code [ INT ] primary_key
Name [ TEXT ]
Headquarter [ TEXT ]
Founder [ TEXT ]
Revenue [ INT ]

Products :
Code [ INT ] primary_key
Name [ TEXT ]
Price [ INT ]
Manufacturer [ INT ] Products.Manufacturer = Manufacturers.Code

Please write me a SQL statement that answers the following question: What are the codes and names of the cheapest products in each category? [/INST]

Output: SELECT code ,  name ,  min(price) FROM products GROUP BY name;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the id of the problem log that is created most recently? [/INST]

Output: SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: Which problem log was created most recently? Give me the log id. [/INST]

Output: SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: What is the oldest log id and its corresponding problem id? [/INST]

Output: SELECT problem_log_id ,  problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: Find the oldest log id and its corresponding problem id. [/INST]

Output: SELECT problem_log_id ,  problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: Find all the ids and dates of the logs for the problem whose id is 10. [/INST]

Output: SELECT problem_log_id ,  log_entry_date FROM problem_log WHERE problem_id = 10;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: For the problem with id 10, return the ids and dates of its problem logs. [/INST]

Output: SELECT problem_log_id ,  log_entry_date FROM problem_log WHERE problem_id = 10;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: List all the log ids and their descriptions from the problem logs. [/INST]

Output: SELECT problem_log_id ,  log_entry_description FROM problem_log;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: What are the log id and entry description of each problem? [/INST]

Output: SELECT problem_log_id ,  log_entry_description FROM problem_log;


Input:
[INST] Here is a database schema:
Problem_Category_Codes :
problem_category_code [ TEXT ] primary_key
problem_category_description [ TEXT ]

Problem_Log :
problem_log_id [ INT ] primary_key
assigned_to_staff_id [ INT ] Problem_Log.assigned_to_staff_id = Staff.staff_id
problem_id [ INT ] Problem_Log.problem_id = Problems.problem_id
problem_category_code [ TEXT ] Problem_Log.problem_category_code = Problem_Category_Codes.problem_category_code
problem_status_code [ TEXT ] Problem_Log.problem_status_code = Problem_Status_Codes.problem_status_code
log_entry_date [ TEXT ]
log_entry_description [ TEXT ]
log_entry_fix [ TEXT ]
other_log_details [ TEXT ]

Problem_Status_Codes :
problem_status_code [ TEXT ] primary_key
problem_status_description [ TEXT ]

Product :
product_id [ INT ] primary_key
product_name [ TEXT ]
product_details [ TEXT ]

Staff :
staff_id [ INT ] primary_key
staff_first_name [ TEXT ]
staff_last_name [ TEXT ]
other_staff_details [ TEXT ]

Problems :
problem_id [ INT ] primary_key
product_id [ INT ] Problems.product_id = Product.product_id
closure_authorised_by_staff_id [ INT ] Problems.closure_authorised_by_staff_id = Staff.staff_id
reported_by_staff_id [ INT ] Problems.reported_by_staff_id = Staff.staff_id
date_problem_reported [ TEXT ]
date_problem_closed [ TEXT ]
problem_description [ TEXT ]
other_problem_details [ TEXT ]

Please write me a SQL statement that answers the following question: List the first and last names of all distinct staff members who are assigned to the problem whose id is 1. [/INST]

Output: SELECT DISTINCT staff_first_name ,  staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1;