Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Show the most common position of players in match seasons. [/INST]

Output: SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: What is the position that is most common among players in match seasons? [/INST]

Output: SELECT POSITION FROM match_season GROUP BY POSITION ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Show the top 3 most common colleges of players in match seasons. [/INST]

Output: SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: What are the three colleges from which the most players are from? [/INST]

Output: SELECT College FROM match_season GROUP BY College ORDER BY count(*) DESC LIMIT 3;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Show the name of colleges that have at least two players. [/INST]

Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: What are the names of all colleges that have two or more players? [/INST]

Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Show the name of colleges that have at least two players in descending alphabetical order. [/INST]

Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: What are the names of colleges that have two or more players, listed in descending alphabetical order? [/INST]

Output: SELECT College FROM match_season GROUP BY College HAVING count(*)  >=  2 ORDER BY College DESC;


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: What are the names of teams that do no have match season record? [/INST]

Output: SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season);


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Return the names of teams that have no match season record. [/INST]

Output: SELECT Name FROM team WHERE Team_id NOT IN (SELECT Team FROM match_season);


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: What are the names of countries that have both players with position forward and players with position defender? [/INST]

Output: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender";


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Return the names of countries that have players that play the Forward position, as well as players who play the Defender position. [/INST]

Output: SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Forward" INTERSECT SELECT T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id  =  T2.Country WHERE T2.Position  =  "Defender";


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Which college have both players with position midfielder and players with position defender? [/INST]

Output: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender";


Input:
[INST] Here is a database schema:
country :
Country_id [ INT ] primary_key
Country_name [ TEXT ]
Capital [ TEXT ]
Official_native_language [ TEXT ]

team :
Team_id [ INT ] primary_key
Name [ TEXT ]

match_season :
Season [ INT ] primary_key
Player [ TEXT ]
Position [ TEXT ]
Country [ INT ] match_season.Country = country.Country_id
Team [ INT ] match_season.Team = team.Team_id
Draft_Pick_Number [ INT ]
Draft_Class [ TEXT ]
College [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Years_Played [ TEXT ]
Total_WL [ TEXT ]
Singles_WL [ TEXT ]
Doubles_WL [ TEXT ]
Team [ INT ] player.Team = team.Team_id

Please write me a SQL statement that answers the following question: Return the colleges that have players who play the Midfielder position, as well as players who play the Defender position. [/INST]

Output: SELECT College FROM match_season WHERE POSITION  =  "Midfielder" INTERSECT SELECT College FROM match_season WHERE POSITION  =  "Defender";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

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

Output: SELECT count(*) FROM climber;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

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

Output: SELECT count(*) FROM climber;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: List the names of climbers in descending order of points. [/INST]

Output: SELECT Name FROM climber ORDER BY Points DESC;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

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

Output: SELECT Name FROM climber ORDER BY Points DESC;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: List the names of climbers whose country is not Switzerland. [/INST]

Output: SELECT Name FROM climber WHERE Country != "Switzerland";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the names of climbers who are not from the country of Switzerland? [/INST]

Output: SELECT Name FROM climber WHERE Country != "Switzerland";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What is the maximum point for climbers whose country is United Kingdom? [/INST]

Output: SELECT max(Points) FROM climber WHERE Country  =  "United Kingdom";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Return the maximum number of points for climbers from the United Kingdom. [/INST]

Output: SELECT max(Points) FROM climber WHERE Country  =  "United Kingdom";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: How many distinct countries are the climbers from? [/INST]

Output: SELECT COUNT(DISTINCT Country) FROM climber;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Count the number of different countries that climbers are from. [/INST]

Output: SELECT COUNT(DISTINCT Country) FROM climber;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the names of mountains in ascending alphabetical order? [/INST]

Output: SELECT Name FROM mountain ORDER BY Name ASC;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Give the names of mountains in alphabetical order. [/INST]

Output: SELECT Name FROM mountain ORDER BY Name ASC;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the countries of mountains with height bigger than 5000? [/INST]

Output: SELECT Country FROM mountain WHERE Height  >  5000;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Return the countries of the mountains that have a height larger than 5000. [/INST]

Output: SELECT Country FROM mountain WHERE Height  >  5000;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

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

Output: SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Return the name of the mountain with the greatest height. [/INST]

Output: SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: List the distinct ranges of the mountains with the top 3 prominence. [/INST]

Output: SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the different ranges of the 3 mountains with the highest prominence? [/INST]

Output: SELECT DISTINCT Range FROM mountain ORDER BY Prominence DESC LIMIT 3;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show names of climbers and the names of mountains they climb. [/INST]

Output: SELECT T1.Name ,  T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the names of climbers and the corresponding names of mountains that they climb? [/INST]

Output: SELECT T1.Name ,  T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the names of climbers and the heights of mountains they climb. [/INST]

Output: SELECT T1.Name ,  T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the names of climbers and the corresponding heights of the mountains that they climb? [/INST]

Output: SELECT T1.Name ,  T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the height of the mountain climbed by the climber with the maximum points. [/INST]

Output: SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What is the height of the mountain climbined by the climbing who had the most points? [/INST]

Output: SELECT T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID ORDER BY T1.Points DESC LIMIT 1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the distinct names of mountains climbed by climbers from country "West Germany". [/INST]

Output: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T1.Country  =  "West Germany";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the different names of mountains ascended by climbers from the country of West Germany? [/INST]

Output: SELECT DISTINCT T2.Name FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T1.Country  =  "West Germany";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the times used by climbers to climb mountains in Country Uganda. [/INST]

Output: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T2.Country  =  "Uganda";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the times used by climbers who climbed mountains in the country of Uganda? [/INST]

Output: SELECT T1.Time FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID  =  T2.Mountain_ID WHERE T2.Country  =  "Uganda";


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Please show the countries and the number of climbers from each country. [/INST]

Output: SELECT Country ,  COUNT(*) FROM climber GROUP BY Country;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: How many climbers are from each country? [/INST]

Output: SELECT Country ,  COUNT(*) FROM climber GROUP BY Country;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: List the countries that have more than one mountain. [/INST]

Output: SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Which countries have more than one mountain? [/INST]

Output: SELECT Country FROM mountain GROUP BY Country HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: List the names of mountains that do not have any climber. [/INST]

Output: SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber);


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the names of countains that no climber has climbed? [/INST]

Output: SELECT Name FROM mountain WHERE Mountain_ID NOT IN (SELECT Mountain_ID FROM climber);


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the countries that have mountains with height more than 5600 stories and mountains with height less than 5200. [/INST]

Output: SELECT Country FROM mountain WHERE Height  >  5600 INTERSECT SELECT Country FROM mountain WHERE Height  <  5200;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the countries that have both mountains that are higher than 5600 and lower than 5200? [/INST]

Output: SELECT Country FROM mountain WHERE Height  >  5600 INTERSECT SELECT Country FROM mountain WHERE Height  <  5200;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the range that has the most number of mountains. [/INST]

Output: SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Which range contains the most mountains? [/INST]

Output: SELECT Range FROM mountain GROUP BY Range ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: Show the names of mountains with height more than 5000 or prominence more than 1000. [/INST]

Output: SELECT Name FROM mountain WHERE Height  >  5000 OR Prominence  >  1000;


Input:
[INST] Here is a database schema:
mountain :
Mountain_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Prominence [ INT ]
Range [ TEXT ]
Country [ TEXT ]

climber :
Climber_ID [ INT ] primary_key
Name [ TEXT ]
Country [ TEXT ]
Time [ TEXT ]
Points [ INT ]
Mountain_ID [ INT ] climber.Mountain_ID = mountain.Mountain_ID

Please write me a SQL statement that answers the following question: What are the names of mountains that have a height of over 5000 or a prominence of over 1000? [/INST]

Output: SELECT Name FROM mountain WHERE Height  >  5000 OR Prominence  >  1000;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

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

Output: SELECT count(*) FROM body_builder;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: List the total scores of body builders in ascending order. [/INST]

Output: SELECT Total FROM body_builder ORDER BY Total ASC;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: List the snatch score and clean jerk score of body builders in ascending order of snatch score. [/INST]

Output: SELECT Snatch ,  Clean_Jerk FROM body_builder ORDER BY Snatch ASC;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average snatch score of body builders? [/INST]

Output: SELECT avg(Snatch) FROM body_builder;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the clean and jerk score of the body builder with the highest total score? [/INST]

Output: SELECT Clean_Jerk FROM body_builder ORDER BY Total DESC LIMIT 1;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the birthdays of people in ascending order of height? [/INST]

Output: SELECT Birth_Date FROM People ORDER BY Height ASC;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

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

Output: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of body builders whose total score is higher than 300? [/INST]

Output: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Total  >  300;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the body builder with the greatest body weight? [/INST]

Output: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Weight DESC LIMIT 1;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the birth date and birth place of the body builder with the highest total points? [/INST]

Output: SELECT T2.Birth_Date ,  T2.Birth_Place FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Total DESC LIMIT 1;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the heights of body builders with total score smaller than 315? [/INST]

Output: SELECT T2.Height FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Total  <  315;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average total score of body builders with height bigger than 200? [/INST]

Output: SELECT avg(T1.Total) FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Height  >  200;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of body builders in descending order of total scores? [/INST]

Output: SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Total DESC;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: List each birth place along with the number of people from there. [/INST]

Output: SELECT Birth_Place ,  COUNT(*) FROM people GROUP BY Birth_Place;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What is the most common birth place of people? [/INST]

Output: SELECT Birth_Place FROM people GROUP BY Birth_Place ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the birth places that are shared by at least two people? [/INST]

Output: SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: List the height and weight of people in descending order of height. [/INST]

Output: SELECT Height ,  Weight FROM people ORDER BY Height DESC;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: Show all information about each body builder. [/INST]

Output: SELECT * FROM body_builder;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: List the names and origins of people who are not body builders. [/INST]

Output: SELECT Name ,  birth_place FROM people EXCEPT SELECT T1.Name ,  T1.birth_place FROM people AS T1 JOIN body_builder AS T2 ON T1.people_id  =  T2.people_id;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

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

Output: SELECT count(DISTINCT Birth_Place) FROM people;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: How many persons are not body builders? [/INST]

Output: SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder);


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: List the weight of the body builders who have snatch score higher than 140 or have the height greater than 200. [/INST]

Output: SELECT T2.weight FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id  =  T2.people_id WHERE T1.snatch  >  140 OR T2.height  >  200;


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What are the total scores of the body builders whose birthday contains the string "January" ? [/INST]

Output: SELECT T1.total FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id  =  T2.people_id WHERE T2.Birth_Date LIKE "%January%";


Input:
[INST] Here is a database schema:
body_builder :
Body_Builder_ID [ INT ] primary_key
People_ID [ INT ] body_builder.People_ID = people.People_ID
Snatch [ INT ]
Clean_Jerk [ INT ]
Total [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Birth_Date [ TEXT ]
Birth_Place [ TEXT ]

Please write me a SQL statement that answers the following question: What is the minimum snatch score? [/INST]

Output: SELECT min(snatch) FROM body_builder;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

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

Output: SELECT count(*) FROM election;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: List the votes of elections in descending order. [/INST]

Output: SELECT Votes FROM election ORDER BY Votes DESC;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: List the dates and vote percents of elections. [/INST]

Output: SELECT Date ,  Vote_Percent FROM election;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the minimum and maximum vote percents of elections? [/INST]

Output: SELECT min(Vote_Percent) ,  max(Vote_Percent) FROM election;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

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

Output: SELECT Name ,  Party FROM representative;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of representatives whose party is not "Republican"? [/INST]

Output: SELECT Name FROM Representative WHERE Party != "Republican";


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the life spans of representatives from New York state or Indiana state? [/INST]

Output: SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana";


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of representatives and the dates of elections they participated in. [/INST]

Output: SELECT T2.Name ,  T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of representatives with more than 10000 votes in election? [/INST]

Output: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE Votes  >  10000;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of representatives in descending order of votes? [/INST]

Output: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes DESC;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What is the party of the representative that has the smallest number of votes. [/INST]

Output: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes ASC LIMIT 1;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the lifespans of representatives in descending order of vote percent? [/INST]

Output: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY Vote_Percent DESC;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average number of votes of representatives from party "Republican"? [/INST]

Output: SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican";


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different parties of representative? Show the party name and the number of representatives in each party. [/INST]

Output: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What is the party that has the largest number of representatives? [/INST]

Output: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What parties have at least three representatives? [/INST]

Output: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*)  >=  3;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: What states have at least two representatives? [/INST]

Output: SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of representatives that have not participated in elections listed here. [/INST]

Output: SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election);


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: Show the parties that have both representatives in New York state and representatives in Pennsylvania state. [/INST]

Output: SELECT Party FROM representative WHERE State  =  "New York" INTERSECT SELECT Party FROM representative WHERE State  =  "Pennsylvania";


Input:
[INST] Here is a database schema:
election :
Election_ID [ INT ] primary_key
Representative_ID [ INT ] election.Representative_ID = representative.Representative_ID
Date [ TEXT ]
Votes [ INT ]
Vote_Percent [ INT ]
Seats [ INT ]
Place [ INT ]

representative :
Representative_ID [ INT ] primary_key
Name [ TEXT ]
State [ TEXT ]
Party [ TEXT ]
Lifespan [ TEXT ]

Please write me a SQL statement that answers the following question: How many distinct parties are there for representatives? [/INST]

Output: SELECT count(DISTINCT Party) FROM representative;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: How many apartment bookings are there in total? [/INST]

Output: SELECT count(*) FROM Apartment_Bookings;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

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

Output: SELECT count(*) FROM Apartment_Bookings;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Show the start dates and end dates of all the apartment bookings. [/INST]

Output: SELECT booking_start_date ,  booking_end_date FROM Apartment_Bookings;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What are the start date and end date of each apartment booking? [/INST]

Output: SELECT booking_start_date ,  booking_end_date FROM Apartment_Bookings;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Show all distinct building descriptions. [/INST]

Output: SELECT DISTINCT building_description FROM Apartment_Buildings;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Give me a list of all the distinct building descriptions. [/INST]

Output: SELECT DISTINCT building_description FROM Apartment_Buildings;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Show the short names of the buildings managed by "Emma". [/INST]

Output: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager	 =  "Emma";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Which buildings does "Emma" manage? Give me the short names of the buildings. [/INST]

Output: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager	 =  "Emma";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Show the addresses and phones of all the buildings managed by "Brenden". [/INST]

Output: SELECT building_address ,  building_phone FROM Apartment_Buildings WHERE building_manager	 =  "Brenden";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What are the address and phone number of the buildings managed by "Brenden"? [/INST]

Output: SELECT building_address ,  building_phone FROM Apartment_Buildings WHERE building_manager	 =  "Brenden";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What are the building full names that contain the word "court"? [/INST]

Output: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Find all the building full names containing the word "court". [/INST]

Output: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What is the minimum and maximum number of bathrooms of all the apartments? [/INST]

Output: SELECT min(bathroom_count) ,  max(bathroom_count) FROM Apartments;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Give me the minimum and maximum bathroom count among all the apartments. [/INST]

Output: SELECT min(bathroom_count) ,  max(bathroom_count) FROM Apartments;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average number of bedrooms of all apartments? [/INST]

Output: SELECT avg(bedroom_count) FROM Apartments;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Find the average number of bedrooms of all the apartments. [/INST]

Output: SELECT avg(bedroom_count) FROM Apartments;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Return the apartment number and the number of rooms for each apartment. [/INST]

Output: SELECT apt_number ,  room_count FROM Apartments;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What are the apartment number and the room count of each apartment? [/INST]

Output: SELECT apt_number ,  room_count FROM Apartments;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average number of rooms of apartments with type code "Studio"? [/INST]

Output: SELECT avg(room_count) FROM Apartments WHERE apt_type_code  =  "Studio";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Find the average room count of the apartments that have the "Studio" type code. [/INST]

Output: SELECT avg(room_count) FROM Apartments WHERE apt_type_code  =  "Studio";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Return the apartment numbers of the apartments with type code "Flat". [/INST]

Output: SELECT apt_number FROM Apartments WHERE apt_type_code  =  "Flat";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Which apartments have type code "Flat"? Give me their apartment numbers. [/INST]

Output: SELECT apt_number FROM Apartments WHERE apt_type_code  =  "Flat";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Return the first names and last names of all guests [/INST]

Output: SELECT guest_first_name ,  guest_last_name FROM Guests;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

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

Output: SELECT guest_first_name ,  guest_last_name FROM Guests;


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: Return the date of birth for all the guests with gender code "Male". [/INST]

Output: SELECT date_of_birth FROM Guests WHERE gender_code  =  "Male";


Input:
[INST] Here is a database schema:
Apartment_Buildings :
building_id [ INT ] primary_key
building_short_name [ TEXT ]
building_full_name [ TEXT ]
building_description [ TEXT ]
building_address [ TEXT ]
building_manager [ TEXT ]
building_phone [ TEXT ]

Apartments :
apt_id [ INT ] primary_key
building_id [ INT ] Apartments.building_id = Apartment_Buildings.building_id
apt_type_code [ TEXT ]
apt_number [ TEXT ]
bathroom_count [ INT ]
bedroom_count [ INT ]
room_count [ TEXT ]

Apartment_Facilities :
apt_id [ INT ] primary_key Apartment_Facilities.apt_id = Apartments.apt_id
facility_code [ TEXT ]

Guests :
guest_id [ INT ] primary_key
gender_code [ TEXT ]
guest_first_name [ TEXT ]
guest_last_name [ TEXT ]
date_of_birth [ TEXT ]

Apartment_Bookings :
apt_booking_id [ INT ] primary_key
apt_id [ INT ] Apartment_Bookings.apt_id = Apartments.apt_id
guest_id [ INT ] Apartment_Bookings.guest_id = Guests.guest_id
booking_status_code [ TEXT ]
booking_start_date [ TEXT ]
booking_end_date [ TEXT ]

View_Unit_Status :
apt_id [ INT ] View_Unit_Status.apt_id = Apartments.apt_id
apt_booking_id [ INT ] View_Unit_Status.apt_booking_id = Apartment_Bookings.apt_booking_id
status_date [ TEXT ] primary_key
available_yn [ TEXT ]

Please write me a SQL statement that answers the following question: What are dates of birth of all the guests whose gender is "Male"? [/INST]

Output: SELECT date_of_birth FROM Guests WHERE gender_code  =  "Male";