Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Find the team of the player of the highest age. [/INST]

Output: SELECT Team FROM player ORDER BY Age DESC LIMIT 1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Which team has the oldest player? [/INST]

Output: SELECT Team FROM player ORDER BY Age DESC LIMIT 1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: List the teams of the players with the top 5 largest ages. [/INST]

Output: SELECT Team FROM player ORDER BY Age DESC LIMIT 5;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What are the teams that have the 5 oldest players? [/INST]

Output: SELECT Team FROM player ORDER BY Age DESC LIMIT 5;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: For each player, show the team and the location of school they belong to. [/INST]

Output: SELECT T1.Team ,  T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What are the team and the location of school each player belongs to? [/INST]

Output: SELECT T1.Team ,  T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Show the locations of schools that have more than 1 player. [/INST]

Output: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Which schools have more than 1 player? Give me the school locations. [/INST]

Output: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Show the denomination of the school that has the most players. [/INST]

Output: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What is the denomination of the school the most players belong to? [/INST]

Output: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID  =  T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Show locations and nicknames of schools. [/INST]

Output: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What are the location and nickname of each school? [/INST]

Output: SELECT T1.Location ,  T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID  =  T2.School_ID;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Please show different denominations and the corresponding number of schools. [/INST]

Output: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: For each denomination, return the denomination and the count of schools with that denomination. [/INST]

Output: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Please show different denominations and the corresponding number of schools in descending order. [/INST]

Output: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Order denominations in descending order of the count of schools with the denomination. Return each denomination with the count of schools. [/INST]

Output: SELECT Denomination ,  COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: List the school color of the school that has the largest enrollment. [/INST]

Output: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What is the school color of the school with the largest enrollment? [/INST]

Output: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: List the locations of schools that do not have any player. [/INST]

Output: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player);


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Which schools do not have any player? Give me the school locations. [/INST]

Output: SELECT LOCATION FROM school WHERE School_ID NOT IN (SELECT School_ID FROM Player);


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Show the denomination shared by schools founded before 1890 and schools founded after 1900 [/INST]

Output: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What are the denominations used by both schools founded before 1890 and schools founded  after 1900? [/INST]

Output: SELECT Denomination FROM school WHERE Founded  <  1890 INTERSECT SELECT Denomination FROM school WHERE Founded  >  1900;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Show the nicknames of schools that are not in division 1. [/INST]

Output: SELECT Nickname FROM school_details WHERE Division != "Division 1";


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What are the nicknames of schools whose division is not 1? [/INST]

Output: SELECT Nickname FROM school_details WHERE Division != "Division 1";


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: Show the denomination shared by more than one school. [/INST]

Output: SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
school :
School_ID [ INT ] primary_key
School [ TEXT ]
Location [ TEXT ]
Enrollment [ INT ]
Founded [ INT ]
Denomination [ TEXT ]
Boys_or_Girls [ TEXT ]
Day_or_Boarding [ TEXT ]
Year_Entered_Competition [ INT ]
School_Colors [ TEXT ]

school_details :
School_ID [ INT ] primary_key school_details.School_ID = school.School_ID
Nickname [ TEXT ]
Colors [ TEXT ]
League [ TEXT ]
Class [ TEXT ]
Division [ TEXT ]

school_performance :
School_Id [ INT ] primary_key school_performance.School_Id = school.School_ID
School_Year [ TEXT ]
Class_A [ TEXT ]
Class_AA [ TEXT ]

player :
Player_ID [ INT ] primary_key
Player [ TEXT ]
Team [ TEXT ]
Age [ INT ]
Position [ TEXT ]
School_ID [ INT ] player.School_ID = school.School_ID

Please write me a SQL statement that answers the following question: What are the denomination more than one school have? [/INST]

Output: SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find all the distinct district names ordered by city area in descending. [/INST]

Output: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

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

Output: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the list of page size which have more than 3 product listed [/INST]

Output: SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*)  >  3;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the maximum page size for everything that has more than 3 products listed? [/INST]

Output: SELECT max_page_size FROM product GROUP BY max_page_size HAVING count(*)  >  3;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the name and population of district with population between 200000 and 2000000 [/INST]

Output: SELECT District_name ,  City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the district names and city populations for all districts that between 200,000 and 2,000,000 residents? [/INST]

Output: SELECT District_name ,  City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the name all districts with city area greater than 10 or population larger than 100000 [/INST]

Output: SELECT district_name FROM district WHERE city_area  >  10 OR City_Population  >  100000;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the names of all districts with a city area greater than 10 or have more than 100000 people living there? [/INST]

Output: SELECT district_name FROM district WHERE city_area  >  10 OR City_Population  >  100000;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Which district has the largest population? [/INST]

Output: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the name of the district with the most residents? [/INST]

Output: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Which district has the least area? [/INST]

Output: SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the name of the district with the smallest area? [/INST]

Output: SELECT district_name FROM district ORDER BY city_area ASC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the total population of the top 3 districts with the largest area. [/INST]

Output: SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the total number of residents for the districts with the 3 largest areas? [/INST]

Output: SELECT sum(city_population) FROM district ORDER BY city_area DESC LIMIT 3;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find all types of store and number of them. [/INST]

Output: SELECT TYPE ,  count(*) FROM store GROUP BY TYPE;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: For each type of store, how many of them are there? [/INST]

Output: SELECT TYPE ,  count(*) FROM store GROUP BY TYPE;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the names of all stores in Khanewal District. [/INST]

Output: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t3.district_name  =  "Khanewal District";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the names of all the stores located in Khanewal District? [/INST]

Output: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t3.district_name  =  "Khanewal District";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find all the stores in the district with the most population. [/INST]

Output: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id WHERE district_id  =  (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1);


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the names of all the stores in the largest district by population? [/INST]

Output: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id WHERE district_id  =  (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1);


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Which city is the headquarter of the store named "Blackville" in? [/INST]

Output: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.store_name  =  "Blackville";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What city is the headquarter of the store Blackville? [/INST]

Output: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.store_name  =  "Blackville";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the number of stores in each city. [/INST]

Output: SELECT t3.headquartered_city ,  count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id GROUP BY t3.headquartered_city;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

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

Output: SELECT t3.headquartered_city ,  count(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id GROUP BY t3.headquartered_city;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the city with the most number of stores. [/INST]

Output: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the city with the most number of flagship stores? [/INST]

Output: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id GROUP BY t3.headquartered_city ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the average pages per minute color? [/INST]

Output: SELECT avg(pages_per_minute_color) FROM product;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the average number of pages per minute color? [/INST]

Output: SELECT avg(pages_per_minute_color) FROM product;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What products are available at store named "Miramichi"? [/INST]

Output: SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id  =  t2.product_id JOIN store AS t3 ON t2.store_id  =  t3.store_id WHERE t3.store_name  =  "Miramichi";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What products are sold at the store named Miramichi? [/INST]

Output: SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id  =  t2.product_id JOIN store AS t3 ON t2.store_id  =  t3.store_id WHERE t3.store_name  =  "Miramichi";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find products with max page size as "A4" and pages per minute color smaller than 5. [/INST]

Output: SELECT product FROM product WHERE max_page_size  =  "A4" AND pages_per_minute_color  <  5;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the products with the maximum page size A4 that also have a pages per minute color smaller than 5? [/INST]

Output: SELECT product FROM product WHERE max_page_size  =  "A4" AND pages_per_minute_color  <  5;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find products with max page size as "A4" or pages per minute color smaller than 5. [/INST]

Output: SELECT product FROM product WHERE max_page_size  =  "A4" OR pages_per_minute_color  <  5;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the products with the maximum page size eqal to A4 or a pages per minute color less than 5? [/INST]

Output: SELECT product FROM product WHERE max_page_size  =  "A4" OR pages_per_minute_color  <  5;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find all the product whose name contains the word "Scanner". [/INST]

Output: SELECT product FROM product WHERE product LIKE "%Scanner%";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are all of the products whose name includes the substring "Scanner"? [/INST]

Output: SELECT product FROM product WHERE product LIKE "%Scanner%";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the most prominent max page size among all the products. [/INST]

Output: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the most common maximum page size? [/INST]

Output: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the name of the products that are not using the most frequently-used max page size. [/INST]

Output: SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1);


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the names of all products that are not the most frequently-used maximum page size? [/INST]

Output: SELECT product FROM product WHERE product != (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY count(*) DESC LIMIT 1);


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the total population of the districts where the area is bigger than the average city area. [/INST]

Output: SELECT sum(city_population) FROM district WHERE city_area  >  (SELECT avg(city_area) FROM district);


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What is the total population for all the districts that have an area larger tahn the average city area? [/INST]

Output: SELECT sum(city_population) FROM district WHERE city_area  >  (SELECT avg(city_area) FROM district);


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: Find the names of districts where have both city mall and village store type stores. [/INST]

Output: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.Type  =  "City Mall" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.Type  =  "Village Store";


Input:
[INST] Here is a database schema:
product :
product_id [ INT ] primary_key
product [ TEXT ]
dimensions [ TEXT ]
dpi [ INT ]
pages_per_minute_color [ INT ]
max_page_size [ TEXT ]
interface [ TEXT ]

store :
Store_ID [ INT ] primary_key
Store_Name [ TEXT ]
Type [ TEXT ]
Area_size [ INT ]
Number_of_product_category [ INT ]
Ranking [ INT ]

district :
District_ID [ INT ] primary_key
District_name [ TEXT ]
Headquartered_City [ TEXT ]
City_Population [ INT ]
City_Area [ INT ]

store_product :
Store_ID [ INT ] primary_key store_product.Store_ID = store.Store_ID
Product_ID [ INT ]

store_district :
Store_ID [ INT ] primary_key store_district.Store_ID = store.Store_ID
District_ID [ INT ] store_district.District_ID = district.District_ID

Please write me a SQL statement that answers the following question: What are the names of the districts that have both mall and village store style shops? [/INST]

Output: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.Type  =  "City Mall" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id  =  t2.store_id JOIN district AS t3 ON t2.district_id  =  t3.district_id WHERE t1.Type  =  "Village Store";


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the total enrollment number of all colleges? [/INST]

Output: SELECT sum(enr) FROM College;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many students are enrolled in college? [/INST]

Output: SELECT sum(enr) FROM College;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

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

Output: SELECT avg(enr) FROM College;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many students, on average, does each college have enrolled? [/INST]

Output: SELECT avg(enr) FROM College;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

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

Output: SELECT count(*) FROM College;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

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

Output: SELECT count(*) FROM College;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many players have more than 1000 hours of training? [/INST]

Output: SELECT count(*) FROM Player WHERE HS  >  1000;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many different players trained for more than 1000 hours? [/INST]

Output: SELECT count(*) FROM Player WHERE HS  >  1000;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many colleges has more than 15000 students? [/INST]

Output: SELECT count(*) FROM College WHERE enr  >  15000;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the number of colleges with a student population greater than 15000? [/INST]

Output: SELECT count(*) FROM College WHERE enr  >  15000;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average training hours of all players? [/INST]

Output: SELECT avg(HS) FROM Player;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many hours do the players train on average? [/INST]

Output: SELECT avg(HS) FROM Player;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name and training hours of players whose hours are below 1500. [/INST]

Output: SELECT pName ,  HS FROM Player WHERE HS  <  1500;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names and number of hours spent training for each player who trains for less than 1500 hours? [/INST]

Output: SELECT pName ,  HS FROM Player WHERE HS  <  1500;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many different colleges do attend the tryout test? [/INST]

Output: SELECT count(DISTINCT cName) FROM tryout;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many different colleges were represented at tryouts? [/INST]

Output: SELECT count(DISTINCT cName) FROM tryout;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the unique types of player positions in the tryout? [/INST]

Output: SELECT count(DISTINCT pPos) FROM tryout;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

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

Output: SELECT count(DISTINCT pPos) FROM tryout;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many students got accepted after the tryout? [/INST]

Output: SELECT count(*) FROM tryout WHERE decision  =  'yes';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many students received a yes from tryouts? [/INST]

Output: SELECT count(*) FROM tryout WHERE decision  =  'yes';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many students whose are playing the role of goalie? [/INST]

Output: SELECT count(*) FROM tryout WHERE pPos  =  'goalie';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the number of students playing as a goalie? [/INST]

Output: SELECT count(*) FROM tryout WHERE pPos  =  'goalie';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the max, average and min training hours of all players. [/INST]

Output: SELECT avg(HS) ,  max(HS) ,  min(HS) FROM Player;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average, maximum, and minimum for the number of hours spent training? [/INST]

Output: SELECT avg(HS) ,  max(HS) ,  min(HS) FROM Player;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is average enrollment of colleges in the state FL? [/INST]

Output: SELECT avg(enr) FROM College WHERE state  =  'FL';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is average number of students enrolled in Florida colleges? [/INST]

Output: SELECT avg(enr) FROM College WHERE state  =  'FL';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of players whose training hours is between 500 and 1500? [/INST]

Output: SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of players who train between 500 and 1500 hours? [/INST]

Output: SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the players whose names contain letter 'a'. [/INST]

Output: SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Who are the players that have names containing the letter a? [/INST]

Output: SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%';


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA. [/INST]

Output: SELECT cName ,  enr FROM College WHERE enr  >  10000 AND state = "LA";


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names and enrollment numbers for colleges that have more than 10000 enrolled and are located in Louisiana? [/INST]

Output: SELECT cName ,  enr FROM College WHERE enr  >  10000 AND state = "LA";


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: List all information about college sorted by enrollment number in the ascending order. [/INST]

Output: SELECT * FROM College ORDER BY enr;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What information do you have on colleges sorted by increasing enrollment numbers? [/INST]

Output: SELECT * FROM College ORDER BY enr;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: List the name of the colleges whose enrollment is greater 18000 sorted by the college's name. [/INST]

Output: SELECT cName FROM College WHERE enr  >  18000 ORDER BY cName;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of every college in alphabetical order that has more than 18000 students enrolled? [/INST]

Output: SELECT cName FROM College WHERE enr  >  18000 ORDER BY cName;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of players whose card is yes in the descending order of training hours. [/INST]

Output: SELECT pName FROM Player WHERE yCard  =  'yes' ORDER BY HS DESC;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the name of the players who received a card in descending order of the hours of training? [/INST]

Output: SELECT pName FROM Player WHERE yCard  =  'yes' ORDER BY HS DESC;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name of different colleges involved in the tryout in alphabetical order. [/INST]

Output: SELECT DISTINCT cName FROM tryout ORDER BY cName;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

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

Output: SELECT DISTINCT cName FROM tryout ORDER BY cName;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Which position is most popular among players in the tryout? [/INST]

Output: SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What was the most popular position at tryouts? [/INST]

Output: SELECT pPos FROM tryout GROUP BY pPos ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the number of students who participate in the tryout for each college ordered by descending count. [/INST]

Output: SELECT count(*) ,  cName FROM tryout GROUP BY cName ORDER BY count(*) DESC;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: How many students participated in tryouts for each college by descennding count? [/INST]

Output: SELECT count(*) ,  cName FROM tryout GROUP BY cName ORDER BY count(*) DESC;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is minimum hours of the students playing in different position? [/INST]

Output: SELECT min(T2.HS) ,   T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID  =  T2.pID GROUP BY T1.pPos;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: For each position, what is the minimum time students spent practicing? [/INST]

Output: SELECT min(T2.HS) ,   T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID  =  T2.pID GROUP BY T1.pPos;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of schools with the top 3 largest size? [/INST]

Output: SELECT cName FROM college ORDER BY enr DESC LIMIT 3;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of the schools with the top 3 largest class sizes? [/INST]

Output: SELECT cName FROM college ORDER BY enr DESC LIMIT 3;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of school that has the smallest enrollment in each state? [/INST]

Output: SELECT cName ,  state ,  min(enr) FROM college GROUP BY state;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the school with smallest enrollment size per state? [/INST]

Output: SELECT cName ,  state ,  min(enr) FROM college GROUP BY state;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the states where have some college students in tryout. [/INST]

Output: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: What are the different states that have students trying out? [/INST]

Output: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName;


Input:
[INST] Here is a database schema:
College :
cName [ TEXT ] primary_key
state [ TEXT ]
enr [ INT ]

Player :
pID [ INT ] primary_key
pName [ TEXT ]
yCard [ TEXT ]
HS [ INT ]

Tryout :
pID [ INT ] primary_key Tryout.pID = Player.pID
cName [ TEXT ] Tryout.cName = College.cName
pPos [ TEXT ]
decision [ TEXT ]

Please write me a SQL statement that answers the following question: Find the states where have some college students in tryout and their decisions are yes. [/INST]

Output: SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName  =  T2.cName WHERE T2.decision  =  'yes';