Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the crime rates of counties in ascending order of number of police officers. [/INST]

Output: SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the crime rates of counties sorted by number of offices ascending? [/INST]

Output: SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers ASC;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

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

Output: SELECT Name FROM city ORDER BY Name ASC;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Return the names of cities, ordered alphabetically. [/INST]

Output: SELECT Name FROM city ORDER BY Name ASC;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the percentage of hispanics in cities with the black percentage higher than 10? [/INST]

Output: SELECT Hispanic FROM city WHERE Black  >  10;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Return the hispanic percentage for cities in which the black percentage is greater than 10. [/INST]

Output: SELECT Hispanic FROM city WHERE Black  >  10;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: List the name of the county with the largest population. [/INST]

Output: SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

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

Output: SELECT Name FROM county_public_safety ORDER BY Population DESC LIMIT 1;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: List the names of the city with the top 5 white percentages. [/INST]

Output: SELECT Name FROM city ORDER BY White DESC LIMIT 5;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the five cities with the greatest proportion of white people? [/INST]

Output: SELECT Name FROM city ORDER BY White DESC LIMIT 5;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

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

Output: SELECT T1.Name ,  T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the names of cities, as well as the names of the counties they correspond to? [/INST]

Output: SELECT T1.Name ,  T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show white percentages of cities and the crime rates of counties they are in. [/INST]

Output: SELECT T1.White ,  T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the white percentages of cities, and the corresponding crime rates of the counties they correspond to? [/INST]

Output: SELECT T1.White ,  T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the name of cities in the county that has the largest number of police officers. [/INST]

Output: SELECT name FROM city WHERE county_ID  =  (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the names of cities that are in the county with the most police officers? [/INST]

Output: SELECT name FROM city WHERE county_ID  =  (SELECT county_ID FROM county_public_safety ORDER BY Police_officers DESC LIMIT 1);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the number of cities in counties that have a population more than 20000. [/INST]

Output: SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population  >  20000);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: How many cities are in counties that have populations of over 20000? [/INST]

Output: SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population  >  20000);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the crime rate of counties with a city having white percentage more than 90. [/INST]

Output: SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID WHERE T1.White  >  90;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the crime rates of counties that contain cities that have white percentages of over 90? [/INST]

Output: SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID  =  T2.County_ID WHERE T1.White  >  90;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Please show the police forces and the number of counties with each police force. [/INST]

Output: SELECT Police_force ,  COUNT(*) FROM county_public_safety GROUP BY Police_force;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: How many counties correspond to each police force? [/INST]

Output: SELECT Police_force ,  COUNT(*) FROM county_public_safety GROUP BY Police_force;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What is the location shared by most counties? [/INST]

Output: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Which location has the most corresponding counties? [/INST]

Output: SELECT LOCATION FROM county_public_safety GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

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

Output: SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the names of counties that do not contain any cities? [/INST]

Output: SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the police force shared by counties with location on the east and west. [/INST]

Output: SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "West";


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Which police forces operate in both counties that are located in the East and in the West? [/INST]

Output: SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION  =  "West";


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the names of cities in counties that have a crime rate less than 100. [/INST]

Output: SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate  <  100);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the names of cities that are in counties that have a crime rate below 100? [/INST]

Output: SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate  <  100);


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: Show the case burden of counties in descending order of population. [/INST]

Output: SELECT Case_burden FROM county_public_safety ORDER BY Population DESC;


Input:
[INST] Here is a database schema:
county_public_safety :
County_ID [ INT ] primary_key
Name [ TEXT ]
Population [ INT ]
Police_officers [ INT ]
Residents_per_officer [ INT ]
Case_burden [ INT ]
Crime_rate [ INT ]
Police_force [ TEXT ]
Location [ TEXT ]

city :
City_ID [ INT ] primary_key
County_ID [ INT ] city.County_ID = county_public_safety.County_ID
Name [ TEXT ]
White [ INT ]
Black [ INT ]
Amerindian [ INT ]
Asian [ INT ]
Multiracial [ INT ]
Hispanic [ INT ]

Please write me a SQL statement that answers the following question: What are the case burdens of counties, ordered descending by population? [/INST]

Output: SELECT Case_burden FROM county_public_safety ORDER BY Population DESC;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the names of all modern rooms with a base price below $160 and two beds. [/INST]

Output: SELECT roomName FROM Rooms WHERE basePrice  <  160 AND beds =  2 AND decor  =  'modern';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the names of modern rooms that have a base price lower than $160 and two beds. [/INST]

Output: SELECT roomName FROM Rooms WHERE basePrice  <  160 AND beds =  2 AND decor  =  'modern';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids. [/INST]

Output: SELECT roomName ,  RoomId FROM Rooms WHERE basePrice  >  160 AND maxOccupancy  >  2;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people. [/INST]

Output: SELECT roomName ,  RoomId FROM Rooms WHERE basePrice  >  160 AND maxOccupancy  >  2;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations. [/INST]

Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Which room has the largest number of reservations? [/INST]

Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many kids stay in the rooms reserved by ROY SWEAZY? [/INST]

Output: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ. [/INST]

Output: SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many times does ROY SWEAZY has reserved a room. [/INST]

Output: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of times ROY SWEAZY has reserved a room. [/INST]

Output: SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName  =  "SWEAZY";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Which room has the highest rate? List the room's full name, rate, check in and check out date. [/INST]

Output: SELECT T2.roomName ,  T1.Rate ,  T1.CheckIn ,  T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Return the name, rate, check in and check out date for the room with the highest rate. [/INST]

Output: SELECT T2.roomName ,  T1.Rate ,  T1.CheckIn ,  T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010? [/INST]

Output: SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010. [/INST]

Output: SELECT Adults FROM Reservations WHERE CheckIn  =  "2010-10-23" AND FirstName  =  "CONRAD" AND LastName  =  "SELBIG";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010? [/INST]

Output: SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on  Sep 21, 2010. [/INST]

Output: SELECT Kids FROM Reservations WHERE CheckIn  =  "2010-09-21" AND FirstName  =  "DAMIEN" AND LastName  =  "TRACHSEL";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

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

Output: SELECT sum(beds) FROM Rooms WHERE bedtype  =  'King';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the total number of king beds available. [/INST]

Output: SELECT sum(beds) FROM Rooms WHERE bedtype  =  'King';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: List the names and decor of rooms that have a king bed. Sort the list by their price. [/INST]

Output: SELECT roomName ,  decor FROM Rooms WHERE bedtype  =  'King' ORDER BY basePrice;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the names and decor of rooms with a king bed? Sort them by their price [/INST]

Output: SELECT roomName ,  decor FROM Rooms WHERE bedtype  =  'King' ORDER BY basePrice;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Which room has cheapest base price? List the room's name and the base price. [/INST]

Output: SELECT roomName ,  basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the room name and base price of the room with the lowest base price? [/INST]

Output: SELECT roomName ,  basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the decor of room Recluse and defiance? [/INST]

Output: SELECT decor FROM Rooms WHERE roomName  =  "Recluse and defiance";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Return the decor of the room named "Recluse and defiance". [/INST]

Output: SELECT decor FROM Rooms WHERE roomName  =  "Recluse and defiance";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the average base price of different bed type? List bed type and average base price. [/INST]

Output: SELECT bedType ,  avg(basePrice) FROM Rooms GROUP BY bedType;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: For each bed type, find the average base price of different bed type. [/INST]

Output: SELECT bedType ,  avg(basePrice) FROM Rooms GROUP BY bedType;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the total number of people who could stay in the modern rooms in this inn? [/INST]

Output: SELECT sum(maxOccupancy) FROM Rooms WHERE decor  =  'modern';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many people in total can stay in the modern rooms of this inn? [/INST]

Output: SELECT sum(maxOccupancy) FROM Rooms WHERE decor  =  'modern';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What kind of decor has the least number of reservations? [/INST]

Output: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the least popular kind of decor? [/INST]

Output: SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids. [/INST]

Output: SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T2.maxOccupancy  =  T1.Adults + T1.Kids;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many times the number of adults and kids staying in a room reached the maximum capacity of the room? [/INST]

Output: SELECT count(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T2.maxOccupancy  =  T1.Adults + T1.Kids;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the first and last names of people who payed more than the rooms' base prices. [/INST]

Output: SELECT T1.firstname ,  T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T1.Rate - T2.basePrice  >  0;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the first and last names of people who payed more than the rooms' base prices? [/INST]

Output: SELECT T1.firstname ,  T1.lastname FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE T1.Rate - T2.basePrice  >  0;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

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

Output: SELECT count(*) FROM Rooms;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the total number of rooms available in this inn? [/INST]

Output: SELECT count(*) FROM Rooms;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of rooms with a king bed. [/INST]

Output: SELECT count(*) FROM Rooms WHERE bedType  =  "King";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many rooms have a king bed? [/INST]

Output: SELECT count(*) FROM Rooms WHERE bedType  =  "King";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of rooms for each bed type. [/INST]

Output: SELECT bedType ,  count(*) FROM Rooms GROUP BY bedType;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the number of rooms for each bed type? [/INST]

Output: SELECT bedType ,  count(*) FROM Rooms GROUP BY bedType;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the room with the maximum occupancy. [/INST]

Output: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the room that can accommodate the most people? [/INST]

Output: SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the id and name of the most expensive base price room. [/INST]

Output: SELECT RoomId ,  roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Which room has the highest base price? [/INST]

Output: SELECT RoomId ,  roomName FROM Rooms ORDER BY basePrice DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: List the type of bed and name of all traditional rooms. [/INST]

Output: SELECT roomName ,  bedType FROM Rooms WHERE decor = "traditional";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the bed type and name of all the rooms with traditional decor? [/INST]

Output: SELECT roomName ,  bedType FROM Rooms WHERE decor = "traditional";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of rooms with king bed for each decor type. [/INST]

Output: SELECT decor ,  count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many rooms have king beds? Report the number for each decor type. [/INST]

Output: SELECT decor ,  count(*) FROM Rooms WHERE bedType = "King" GROUP BY decor;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the average and minimum price of the rooms in different decor. [/INST]

Output: SELECT decor , avg(basePrice) ,  min(basePrice) FROM Rooms GROUP BY decor;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the average minimum and price of the rooms for each different decor. [/INST]

Output: SELECT decor , avg(basePrice) ,  min(basePrice) FROM Rooms GROUP BY decor;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: List the name of all rooms sorted by their prices. [/INST]

Output: SELECT roomName FROM Rooms ORDER BY basePrice;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Sort all the rooms according to the price. Just report the room names. [/INST]

Output: SELECT roomName FROM Rooms ORDER BY basePrice;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of rooms with price higher than 120 for different decor. [/INST]

Output: SELECT decor , count(*) FROM Rooms WHERE basePrice  >  120 GROUP BY decor;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many rooms cost more than 120, for each different decor? [/INST]

Output: SELECT decor , count(*) FROM Rooms WHERE basePrice  >  120 GROUP BY decor;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: For each bed type, find the average room price. [/INST]

Output: SELECT bedType ,  avg(basePrice) FROM Rooms GROUP BY bedType;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What is the average base price of rooms, for each bed type? [/INST]

Output: SELECT bedType ,  avg(basePrice) FROM Rooms GROUP BY bedType;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: List the name of rooms with king or queen bed. [/INST]

Output: SELECT roomName FROM Rooms WHERE bedType  =  "King" OR bedType  =  "Queen";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the names of rooms that have either king or queen bed? [/INST]

Output: SELECT roomName FROM Rooms WHERE bedType  =  "King" OR bedType  =  "Queen";


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

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

Output: SELECT count(DISTINCT bedType) FROM Rooms;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of distinct bed types available in this inn. [/INST]

Output: SELECT count(DISTINCT bedType) FROM Rooms;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the name and id of the top 3 expensive rooms. [/INST]

Output: SELECT RoomId ,  roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the name and id of the three highest priced rooms? [/INST]

Output: SELECT RoomId ,  roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the name of rooms whose price is higher than the average price. [/INST]

Output: SELECT roomName FROM Rooms WHERE basePrice  >  ( SELECT avg(basePrice) FROM Rooms );


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the name of rooms that cost more than the average. [/INST]

Output: SELECT roomName FROM Rooms WHERE basePrice  >  ( SELECT avg(basePrice) FROM Rooms );


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the number of rooms that do not have any reservation. [/INST]

Output: SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations);


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: How many rooms have not had any reservation yet? [/INST]

Output: SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations);


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

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

Output: SELECT T2.roomName ,  count(*) ,  T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: For each room, find its name and the number of times reservations were made for it. [/INST]

Output: SELECT T2.roomName ,  count(*) ,  T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the names of rooms that have been reserved for more than 60 times. [/INST]

Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room HAVING count(*)  >  60;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the names of rooms whose reservation frequency exceeds 60 times? [/INST]

Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId GROUP BY T1.Room HAVING count(*)  >  60;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the name of rooms whose base price is between 120 and 150. [/INST]

Output: SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Which rooms cost between 120 and 150? Give me the room names. [/INST]

Output: SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150;


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: Find the name of rooms booked by some customers whose first name contains ROY. [/INST]

Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE firstname LIKE '%ROY%';


Input:
[INST] Here is a database schema:
Rooms :
RoomId [ TEXT ] primary_key
roomName [ TEXT ]
beds [ INT ]
bedType [ TEXT ]
maxOccupancy [ INT ]
basePrice [ INT ]
decor [ TEXT ]

Reservations :
Code [ INT ] primary_key
Room [ TEXT ] Reservations.Room = Rooms.RoomId
CheckIn [ TEXT ]
CheckOut [ TEXT ]
Rate [ INT ]
LastName [ TEXT ]
FirstName [ TEXT ]
Adults [ INT ]
Kids [ INT ]

Please write me a SQL statement that answers the following question: What are the name of rooms booked by customers whose first name has "ROY" in part? [/INST]

Output: SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room  =  T2.RoomId WHERE firstname LIKE '%ROY%';


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: what are the details of the cmi masters that have the cross reference code 'Tax'? [/INST]

Output: SELECT T1.cmi_details FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id  =  T2.master_customer_id WHERE T2.source_system_code  =  'Tax';


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: What is the cmi cross reference id that is related to at least one council tax entry? List the cross reference id and source system code. [/INST]

Output: SELECT T1.cmi_cross_ref_id ,  T1.source_system_code FROM CMI_Cross_References AS T1 JOIN Council_Tax AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id GROUP BY T1.cmi_cross_ref_id HAVING count(*)  >=  1;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: How many business rates are related to each cmi cross reference? List cross reference id, master customer id and the n [/INST]

Output: SELECT T2.cmi_cross_ref_id ,  T2.master_customer_id ,  count(*) FROM Business_Rates AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id GROUP BY T2.cmi_cross_ref_id;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: What is the tax source system code related to the benefits and overpayments? List the code and the benifit id, order by benifit id. [/INST]

Output: SELECT T1.source_system_code ,  T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Benefits_Overpayments AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id ORDER BY T2.council_tax_id;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: Wat is the tax source system code and master customer id of the taxes related to each parking fine id? [/INST]

Output: SELECT T1.source_system_code ,  T1.master_customer_id ,  T2.council_tax_id FROM CMI_Cross_References AS T1 JOIN Parking_Fines AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: What are the renting arrears tax ids related to the customer master index whose detail is not 'Schmidt, Kertzmann and Lubowitz'? [/INST]

Output: SELECT T1.council_tax_id FROM Rent_Arrears AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id JOIN Customer_Master_Index AS T3 ON T3.master_customer_id  =  T2.master_customer_id WHERE T3.cmi_details != 'Schmidt ,  Kertzmann and Lubowitz';


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? [/INST]

Output: SELECT T1.electoral_register_id FROM Electoral_Register AS T1 JOIN CMI_Cross_References AS T2 ON T1.cmi_cross_ref_id  =  T2.cmi_cross_ref_id WHERE T2.source_system_code  =  'Electoral' OR T2.source_system_code  =  'Tax';


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: How many different source system code for the cmi cross references are there? [/INST]

Output: SELECT count(DISTINCT source_system_code) FROM CMI_cross_references;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: List all information about customer master index, and sort them by details in descending order. [/INST]

Output: SELECT * FROM customer_master_index ORDER BY cmi_details DESC;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: List the council tax ids and their related cmi cross references of all the parking fines. [/INST]

Output: SELECT council_tax_id ,  cmi_cross_ref_id FROM parking_fines;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: How many council taxes are collected for renting arrears ? [/INST]

Output: SELECT count(*) FROM rent_arrears;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'? [/INST]

Output: SELECT DISTINCT T2.source_system_code FROM customer_master_index AS T1 JOIN cmi_cross_references AS T2 ON T1.master_customer_id  =  T2.master_customer_id WHERE T1.cmi_details  =  'Gottlieb ,  Becker and Wyman';


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: Which cmi cross reference id is not related to any parking taxes? [/INST]

Output: SELECT cmi_cross_ref_id FROM cmi_cross_references EXCEPT SELECT cmi_cross_ref_id FROM parking_fines;


Input:
[INST] Here is a database schema:
Customer_Master_Index :
master_customer_id [ INT ] primary_key
cmi_details [ TEXT ]

CMI_Cross_References :
cmi_cross_ref_id [ INT ] primary_key
master_customer_id [ INT ] CMI_Cross_References.master_customer_id = Customer_Master_Index.master_customer_id
source_system_code [ TEXT ]

Council_Tax :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Council_Tax.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Business_Rates :
business_rates_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Business_Rates.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Benefits_Overpayments :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Benefits_Overpayments.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Parking_Fines :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Parking_Fines.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Rent_Arrears :
council_tax_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Rent_Arrears.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Electoral_Register :
electoral_register_id [ INT ] primary_key
cmi_cross_ref_id [ INT ] Electoral_Register.cmi_cross_ref_id = CMI_Cross_References.cmi_cross_ref_id

Please write me a SQL statement that answers the following question: Which distinct source system code includes the substring 'en'? [/INST]

Output: SELECT DISTINCT source_system_code FROM cmi_cross_references WHERE source_system_code LIKE '%en%';


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

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

Output: SELECT count(*) FROM party;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

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

Output: SELECT count(*) FROM party;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: List the themes of parties in ascending order of number of hosts. [/INST]

Output: SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: What are the themes of parties ordered by the number of hosts in ascending manner? [/INST]

Output: SELECT Party_Theme FROM party ORDER BY Number_of_hosts ASC;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

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

Output: SELECT Party_Theme ,  LOCATION FROM party;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: Give me the theme and location of each party. [/INST]

Output: SELECT Party_Theme ,  LOCATION FROM party;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: Show the first year and last year of parties with theme "Spring" or "Teqnology". [/INST]

Output: SELECT First_year ,  Last_year FROM party WHERE Party_Theme  =  "Spring" OR Party_Theme  =  "Teqnology";


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: What are the first year and last year of the parties whose theme is "Spring" or "Teqnology"? [/INST]

Output: SELECT First_year ,  Last_year FROM party WHERE Party_Theme  =  "Spring" OR Party_Theme  =  "Teqnology";


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: What is the average number of hosts for parties? [/INST]

Output: SELECT avg(Number_of_hosts) FROM party;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: Compute the average number of hosts for parties. [/INST]

Output: SELECT avg(Number_of_hosts) FROM party;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: What is the location of the party with the most hosts? [/INST]

Output: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: Which party had the most hosts? Give me the party location. [/INST]

Output: SELECT LOCATION FROM party ORDER BY Number_of_hosts DESC LIMIT 1;


Input:
[INST] Here is a database schema:
party :
Party_ID [ INT ] primary_key
Party_Theme [ TEXT ]
Location [ TEXT ]
First_year [ TEXT ]
Last_year [ TEXT ]
Number_of_hosts [ INT ]

host :
Host_ID [ INT ] primary_key
Name [ TEXT ]
Nationality [ TEXT ]
Age [ TEXT ]

party_host :
Party_ID [ INT ] primary_key party_host.Party_ID = party.Party_ID
Host_ID [ INT ] party_host.Host_ID = host.Host_ID
Is_Main_in_Charge [ bool ]

Please write me a SQL statement that answers the following question: Show different nationalities along with the number of hosts of each nationality. [/INST]

Output: SELECT Nationality ,  COUNT(*) FROM HOST GROUP BY Nationality;