Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top? [/INST]

Output: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  >  2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T2.Weeks_on_Top  <  2;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"? [/INST]

Output: SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded";


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the dates of ceremony corresponding to music festivals that had the category "Best Song" and result "Awarded". [/INST]

Output: SELECT Date_of_ceremony FROM music_festival WHERE Category  =  "Best Song" AND RESULT  =  "Awarded";


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: What is the issue date of the volume with the minimum weeks on top? [/INST]

Output: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the issue date of the volume that has spent the fewest weeks on top. [/INST]

Output: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top ASC LIMIT 1;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: How many distinct artists have volumes? [/INST]

Output: SELECT COUNT(DISTINCT Artist_ID) FROM volume;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of artists who have had volumes. [/INST]

Output: SELECT COUNT(DISTINCT Artist_ID) FROM volume;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: Please show the results of music festivals and the number of music festivals that have had each, ordered by this count. [/INST]

Output: SELECT RESULT ,  COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: How many music festivals have had each kind of result, ordered descending by count? [/INST]

Output: SELECT RESULT ,  COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: What are the issue dates of volumes associated with the artist aged 23 or younger? [/INST]

Output: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23;


Input:
[INST] Here is a database schema:
artist :
Artist_ID [ INT ] primary_key
Artist [ TEXT ]
Age [ INT ]
Famous_Title [ TEXT ]
Famous_Release_date [ TEXT ]

volume :
Volume_ID [ INT ] primary_key
Volume_Issue [ TEXT ]
Issue_Date [ TEXT ]
Weeks_on_Top [ INT ]
Song [ TEXT ]
Artist_ID [ INT ] volume.Artist_ID = artist.Artist_ID

music_festival :
ID [ INT ] primary_key
Music_Festival [ TEXT ]
Date_of_ceremony [ TEXT ]
Category [ TEXT ]
Volume [ INT ] music_festival.Volume = volume.Volume_ID
Result [ TEXT ]

Please write me a SQL statement that answers the following question: Return the issue dates of volumes by artists who are at most 23 years old? [/INST]

Output: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID  =  T2.Artist_ID WHERE T1.age  <=  23;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: How many roller coasters are there? [/INST]

Output: SELECT count(*) FROM roller_coaster;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of roller coasters by ascending order of length. [/INST]

Output: SELECT Name FROM roller_coaster ORDER BY LENGTH ASC;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: What are the lengths and heights of roller coasters? [/INST]

Output: SELECT LENGTH ,  Height FROM roller_coaster;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of countries whose language is not "German". [/INST]

Output: SELECT Name FROM country WHERE Languages != "German";


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the statuses of roller coasters longer than 3300 or higher than 100. [/INST]

Output: SELECT Status FROM roller_coaster WHERE LENGTH  >  3300 OR Height  >  100;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: What are the speeds of the longest roller coaster? [/INST]

Output: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average speed of roller coasters? [/INST]

Output: SELECT avg(Speed) FROM roller_coaster;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the different statuses and the numbers of roller coasters for each status. [/INST]

Output: SELECT Status ,  COUNT(*) FROM roller_coaster GROUP BY Status;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Please show the most common status of roller coasters. [/INST]

Output: SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: List the status shared by more than two roller coaster. [/INST]

Output: SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the park of the roller coaster with the highest speed. [/INST]

Output: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the names of roller coasters and names of country they are in. [/INST]

Output: SELECT T2.Name ,  T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the names of countries that have more than one roller coaster. [/INST]

Output: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the name and population of the country that has the highest roller coaster. [/INST]

Output: SELECT T1.Name ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID ORDER BY T2.Height DESC LIMIT 1;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: Show the names of countries and the average speed of roller coasters from each country. [/INST]

Output: SELECT T1.Name ,  avg(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID GROUP BY T1.Name;


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: How many countries do not have an roller coaster longer than 3000? [/INST]

Output: SELECT count(*) FROM country WHERE country_id NOT IN ( SELECT country_id FROM roller_coaster WHERE LENGTH  >  3000 );


Input:
[INST] Here is a database schema:
roller_coaster :
Roller_Coaster_ID [ INT ] primary_key
Name [ TEXT ]
Park [ TEXT ]
Country_ID [ INT ] roller_coaster.Country_ID = country.Country_ID
Length [ INT ]
Height [ INT ]
Speed [ TEXT ]
Opened [ TEXT ]
Status [ TEXT ]

country :
Country_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Area [ INT ]
Languages [ TEXT ]

Please write me a SQL statement that answers the following question: What are the country names, area and population which has both roller coasters with speed higher [/INST]

Output: SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  >  60 INTERSECT SELECT T1.name ,  T1.area ,  T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID  =  T2.Country_ID WHERE T2.speed  <  55;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: How many different captain ranks are there? [/INST]

Output: SELECT count(DISTINCT rank) FROM captain;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of different ranks of captain. [/INST]

Output: SELECT count(DISTINCT rank) FROM captain;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: How many captains are in each rank? [/INST]

Output: SELECT count(*) ,  rank FROM captain GROUP BY rank;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of captains that have each rank. [/INST]

Output: SELECT count(*) ,  rank FROM captain GROUP BY rank;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: How many captains with younger than 50 are in each rank? [/INST]

Output: SELECT count(*) ,  rank FROM captain WHERE age  <  50 GROUP BY rank;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of captains younger than 50 of each rank. [/INST]

Output: SELECT count(*) ,  rank FROM captain WHERE age  <  50 GROUP BY rank;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Sort all captain names by their ages from old to young. [/INST]

Output: SELECT name FROM captain ORDER BY age DESC;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of captains, sorted by age descending? [/INST]

Output: SELECT name FROM captain ORDER BY age DESC;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name, class and rank of all captains. [/INST]

Output: SELECT name ,  CLASS ,  rank FROM captain;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names, classes, and ranks of all captains? [/INST]

Output: SELECT name ,  CLASS ,  rank FROM captain;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Which rank is the most common among captains? [/INST]

Output: SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Return the rank for which there are the fewest captains. [/INST]

Output: SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Which classes have more than two captains? [/INST]

Output: SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*)  >  2;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Give the classes that have more than two captains. [/INST]

Output: SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*)  >  2;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of captains whose rank are either Midshipman or Lieutenant. [/INST]

Output: SELECT name FROM captain WHERE rank  =  'Midshipman' OR rank  =  'Lieutenant';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of captains that have either the rank Midshipman or Lieutenant? [/INST]

Output: SELECT name FROM captain WHERE rank  =  'Midshipman' OR rank  =  'Lieutenant';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the average and minimum age of captains in different class? [/INST]

Output: SELECT avg(age) ,  min(age) ,  CLASS FROM captain GROUP BY CLASS;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Return the average and minimum age of captains in each class. [/INST]

Output: SELECT avg(age) ,  min(age) ,  CLASS FROM captain GROUP BY CLASS;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the captain rank that has some captains in both Cutter and Armed schooner classes. [/INST]

Output: SELECT rank FROM captain WHERE CLASS  =  'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS  =  'Armed schooner';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ranks of captains that are both in the Cutter and Armed schooner classes? [/INST]

Output: SELECT rank FROM captain WHERE CLASS  =  'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS  =  'Armed schooner';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the captain rank that has no captain in Third-rate ship of the line class. [/INST]

Output: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS  =  'Third-rate ship of the line';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the ranks of captains that have no captain that are in the Third-rate ship of the line class? [/INST]

Output: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS  =  'Third-rate ship of the line';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the youngest captain? [/INST]

Output: SELECT name FROM captain ORDER BY age LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Return the name of the youngest captain. [/INST]

Output: SELECT name FROM captain ORDER BY age LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: how many ships are there? [/INST]

Output: SELECT count(*) FROM ship;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of ships. [/INST]

Output: SELECT count(*) FROM ship;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name, type, and flag of the ship that is built in the most recent year. [/INST]

Output: SELECT name ,  TYPE ,  flag FROM ship ORDER BY built_year DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name, type, and flag of the ship that was built in the most recent year? [/INST]

Output: SELECT name ,  TYPE ,  flag FROM ship ORDER BY built_year DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Group by ships by flag, and return number of ships that have each flag. [/INST]

Output: SELECT count(*) ,  flag FROM ship GROUP BY flag;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different ship flags, and how many ships have each? [/INST]

Output: SELECT count(*) ,  flag FROM ship GROUP BY flag;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Which flag is most widely used among all ships? [/INST]

Output: SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Return the flag that is most common among all ships. [/INST]

Output: SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: List all ship names in the order of built year and class. [/INST]

Output: SELECT name FROM ship ORDER BY built_year ,  CLASS;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of ships, ordered by year they were built and their class? [/INST]

Output: SELECT name FROM ship ORDER BY built_year ,  CLASS;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the ship type that are used by both ships with Panama and Malta flags. [/INST]

Output: SELECT TYPE FROM ship WHERE flag  =  'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag  =  'Malta';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What types of ships have both ships that have Panama Flags and Malta flags? [/INST]

Output: SELECT TYPE FROM ship WHERE flag  =  'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag  =  'Malta';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: In which year were most of ships built? [/INST]

Output: SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What is the year in which most ships were built? [/INST]

Output: SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of the ships that have more than one captain. [/INST]

Output: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id GROUP BY t2.ship_id HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of ships that have more than one captain? [/INST]

Output: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id GROUP BY t2.ship_id HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: what are the names and classes of the ships that do not have any captain yet? [/INST]

Output: SELECT name ,  CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain);


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Return the names and classes of ships that do not have a captain? [/INST]

Output: SELECT name ,  CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain);


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of the ship that is steered by the youngest captain. [/INST]

Output: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id ORDER BY t2.age LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the ship that is commanded by the youngest captain? [/INST]

Output: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id ORDER BY t2.age LIMIT 1;


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name and flag of ships that are not steered by any captain with Midshipman rank. [/INST]

Output: SELECT name ,  flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank  =  'Midshipman');


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names and flags of ships that do not have a captain with the rank of Midshipman? [/INST]

Output: SELECT name ,  flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank  =  'Midshipman');


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank. [/INST]

Output: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id WHERE t2.rank  =  'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id WHERE t2.rank  =  'Lieutenant';


Input:
[INST] Here is a database schema:
captain :
Captain_ID [ INT ] primary_key
Name [ TEXT ]
Ship_ID [ INT ] captain.Ship_ID = Ship.Ship_ID
age [ TEXT ]
Class [ TEXT ]
Rank [ TEXT ]

Ship :
Ship_ID [ INT ] primary_key
Name [ TEXT ]
Type [ TEXT ]
Built_Year [ INT ]
Class [ TEXT ]
Flag [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant? [/INST]

Output: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id WHERE t2.rank  =  'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id  =  t2.ship_id WHERE t2.rank  =  'Lieutenant';


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What is id of the city that hosted events in the most recent year? [/INST]

Output: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the city that hosted some events in the most recent year. What is the id of this city? [/INST]

Output: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"? [/INST]

Output: SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What is the match id of the competition called "1994 FIFA World Cup qualification"? [/INST]

Output: SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the cities which were once a host city after 2010? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year  >  2010;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities served as a host city after 2010? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year  >  2010;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which city has hosted the most events? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the city that hosted the most events. [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"? [/INST]

Output: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )". [/INST]

Output: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Give me the temperature of Shanghai in January. [/INST]

Output: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What is the temperature of "Shanghai" city in January? [/INST]

Output: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What is the host year of city "Taizhou ( Zhejiang )"? [/INST]

Output: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city WHERE T1.city  =  "Taizhou ( Zhejiang )";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: IN which year did city "Taizhou ( Zhejiang )" serve as a host city? [/INST]

Output: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city WHERE T1.city  =  "Taizhou ( Zhejiang )";


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which three cities have the largest regional population? [/INST]

Output: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What are the three largest cities in terms of regional population? [/INST]

Output: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which city has the lowest GDP? Please list the city name and its GDP. [/INST]

Output: SELECT city ,  GDP FROM city ORDER BY GDP LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What is the city with the smallest GDP? Return the city and its GDP. [/INST]

Output: SELECT city ,  GDP FROM city ORDER BY GDP LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which city has the highest temperature in February? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id ORDER BY T2.Feb DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: In February, which city marks the highest temperature? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id ORDER BY T2.Feb DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul OR T2.Mar  >  T2.Oct;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities' temperature in March is lower than that in July or higher than that in Oct? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul OR T2.Mar  >  T2.Oct;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities have lower temperature in March than in July and have been once host cities? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities. [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities have lower temperature in March than in Dec and have never served as host cities? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Mar  <  T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities have higher temperature in Feb than in Jun or have once served as host cities? [/INST]

Output: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id  =  T2.city_id WHERE T2.Feb  >  T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id  =  T4.host_city;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Please give me a list of cities whose regional population is over 10000000. [/INST]

Output: SELECT city FROM city WHERE regional_population  >  10000000;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities have regional population above 10000000? [/INST]

Output: SELECT city FROM city WHERE regional_population  >  10000000;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Please give me a list of cities whose regional population is over 8000000 or under 5000000. [/INST]

Output: SELECT city FROM city WHERE regional_population  >  10000000 UNION SELECT city FROM city WHERE regional_population  <  5000000;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities have regional population above 8000000 or below 5000000? [/INST]

Output: SELECT city FROM city WHERE regional_population  >  10000000 UNION SELECT city FROM city WHERE regional_population  <  5000000;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the number of matches in different competitions. [/INST]

Output: SELECT count(*) ,  Competition FROM MATCH GROUP BY Competition;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: For each competition, count the number of matches. [/INST]

Output: SELECT count(*) ,  Competition FROM MATCH GROUP BY Competition;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: List venues of all matches in the order of their dates starting from the most recent one. [/INST]

Output: SELECT venue FROM MATCH ORDER BY date DESC;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What are the venues of all the matches? Sort them in the descending order of match date. [/INST]

Output: SELECT venue FROM MATCH ORDER BY date DESC;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: what is the GDP of the city with the largest population. [/INST]

Output: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Find the GDP of the city with the largest regional population. [/INST]

Output: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: What are the GDP and population of the city that already served as a host more than once? [/INST]

Output: SELECT t1.gdp ,  t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY t2.Host_City HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
city :
City_ID [ INT ] primary_key
City [ TEXT ]
Hanzi [ TEXT ]
Hanyu_Pinyin [ TEXT ]
Regional_Population [ INT ]
GDP [ INT ]

match :
Match_ID [ INT ] primary_key
Date [ TEXT ]
Venue [ TEXT ]
Score [ TEXT ]
Result [ TEXT ]
Competition [ TEXT ]

temperature :
City_ID [ INT ] primary_key temperature.City_ID = city.City_ID
Jan [ INT ]
Feb [ INT ]
Mar [ INT ]
Apr [ INT ]
Jun [ INT ]
Jul [ INT ]
Aug [ INT ]
Sep [ INT ]
Oct [ INT ]
Nov [ INT ]
Dec [ INT ]

hosting_city :
Year [ INT ] primary_key
Match_ID [ INT ] hosting_city.Match_ID = match.Match_ID
Host_City [ TEXT ] hosting_city.Host_City = city.City_ID

Please write me a SQL statement that answers the following question: Which cities have served as host cities more than once? Return me their GDP and population. [/INST]

Output: SELECT t1.gdp ,  t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id  =  T2.host_city GROUP BY t2.Host_City HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: List every individual's first name, middle name and last name in alphabetical order by last name. [/INST]

Output: SELECT individual_first_name ,  individual_middle_name ,  individual_last_name FROM individuals ORDER BY individual_last_name;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: What are the first, middle, and last names of all individuals, ordered by last name? [/INST]

Output: SELECT individual_first_name ,  individual_middle_name ,  individual_last_name FROM individuals ORDER BY individual_last_name;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: List all the types of forms. [/INST]

Output: SELECT DISTINCT form_type_code FROM forms;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

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

Output: SELECT DISTINCT form_type_code FROM forms;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of the most popular party form. [/INST]

Output: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id  =  t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the party form that is most common? [/INST]

Output: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id  =  t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: Find the payment method and phone of the party with email "enrico09@example.com". [/INST]

Output: SELECT payment_method_code ,  party_phone FROM parties WHERE party_email  =  "enrico09@example.com";


Input:
[INST] Here is a database schema:
Addresses :
address_id [ INT ] primary_key
line_1_number_building [ TEXT ]
town_city [ TEXT ]
zip_postcode [ TEXT ]
state_province_county [ TEXT ]
country [ TEXT ]

Services :
service_id [ INT ] primary_key
service_type_code [ TEXT ]
service_name [ TEXT ]
service_descriptio [ TEXT ]

Forms :
form_id [ INT ] primary_key
form_type_code [ TEXT ]
service_id [ INT ] Forms.service_id = Services.service_id
form_number [ TEXT ]
form_name [ TEXT ]
form_description [ TEXT ]

Individuals :
individual_id [ INT ] primary_key
individual_first_name [ TEXT ]
individual_middle_name [ TEXT ]
inidividual_phone [ TEXT ]
individual_email [ TEXT ]
individual_address [ TEXT ]
individual_last_name [ TEXT ]

Organizations :
organization_id [ INT ] primary_key
date_formed [ TEXT ]
organization_name [ TEXT ]
uk_vat_number [ TEXT ]

Parties :
party_id [ INT ] primary_key
payment_method_code [ TEXT ]
party_phone [ TEXT ]
party_email [ TEXT ]

Organization_Contact_Individuals :
individual_id [ INT ] primary_key Organization_Contact_Individuals.individual_id = Individuals.individual_id
organization_id [ INT ] Organization_Contact_Individuals.organization_id = Organizations.organization_id
date_contact_from [ TEXT ]
date_contact_to [ TEXT ]

Party_Addresses :
party_id [ INT ] primary_key Party_Addresses.party_id = Parties.party_id
address_id [ INT ] Party_Addresses.address_id = Addresses.address_id
date_address_from [ TEXT ]
address_type_code [ TEXT ]
date_address_to [ TEXT ]

Party_Forms :
party_id [ INT ] primary_key Party_Forms.party_id = Parties.party_id
form_id [ INT ] Party_Forms.form_id = Forms.form_id
date_completion_started [ TEXT ]
form_status_code [ TEXT ]
date_fully_completed [ TEXT ]

Party_Services :
booking_id [ INT ]
customer_id [ INT ] Party_Services.customer_id = Parties.party_id
service_id [ INT ] Party_Services.service_id = Services.service_id
service_datetime [ TEXT ]
booking_made_date [ TEXT ]

Please write me a SQL statement that answers the following question: What is the payment method code and party phone of the party with the email 'enrico09@example.com'? [/INST]

Output: SELECT payment_method_code ,  party_phone FROM parties WHERE party_email  =  "enrico09@example.com";