Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: What are the names of the technicians by ascending order of quality rank for the machine they are assigned? [/INST]

Output: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id  =  T2.machine_id JOIN technician AS T3 ON T1.technician_ID  =  T3.technician_ID ORDER BY T2.quality_rank;


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: Show names of technicians who are assigned to repair machines with value point more than 70. [/INST]

Output: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id  =  T2.machine_id JOIN technician AS T3 ON T1.technician_ID  =  T3.technician_ID WHERE T2.value_points  >  70;


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: What are the names of the technicians that are assigned to repair machines with more point values than 70? [/INST]

Output: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id  =  T2.machine_id JOIN technician AS T3 ON T1.technician_ID  =  T3.technician_ID WHERE T2.value_points  >  70;


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: Show names of technicians and the number of machines they are assigned to repair. [/INST]

Output: SELECT T2.Name ,  COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID  =  T2.technician_ID GROUP BY T2.Name;


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: What are the names of the technicians  and how many machines are they assigned to repair? [/INST]

Output: SELECT T2.Name ,  COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID  =  T2.technician_ID GROUP BY T2.Name;


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: List the names of technicians who have not been assigned to repair machines. [/INST]

Output: SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment);


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: What are the names of the technicians that have not been assigned to repair machines? [/INST]

Output: SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment);


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: Show the starting years shared by technicians from team "CLE" and "CWS". [/INST]

Output: SELECT Starting_Year FROM technician WHERE Team  =  "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team  =  "CWS";


Input:
[INST] Here is a database schema:
repair :
repair_ID [ INT ] primary_key
name [ TEXT ]
Launch_Date [ TEXT ]
Notes [ TEXT ]

machine :
Machine_ID [ INT ] primary_key
Making_Year [ INT ]
Class [ TEXT ]
Team [ TEXT ]
Machine_series [ TEXT ]
value_points [ INT ]
quality_rank [ INT ]

technician :
technician_id [ INT ] primary_key
Name [ TEXT ]
Team [ TEXT ]
Starting_Year [ INT ]
Age [ INT ]

repair_assignment :
technician_id [ INT ] primary_key repair_assignment.technician_id = technician.technician_id
repair_ID [ INT ] repair_assignment.repair_ID = repair.repair_ID
Machine_ID [ INT ] repair_assignment.Machine_ID = machine.Machine_ID

Please write me a SQL statement that answers the following question: What are the starting years shared by the technicians from the team "CLE" or "CWS"? [/INST]

Output: SELECT Starting_Year FROM technician WHERE Team  =  "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team  =  "CWS";


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

Output: SELECT count(*) FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

Output: SELECT count(*) FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: List the companies of entrepreneurs in descending order of money requested. [/INST]

Output: SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the companies of entrepreneurs, ordered descending by amount of money requested? [/INST]

Output: SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: List the companies and the investors of entrepreneurs. [/INST]

Output: SELECT Company ,  Investor FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the companies and investors that correspond to each entrepreneur? [/INST]

Output: SELECT Company ,  Investor FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average money requested by all entrepreneurs? [/INST]

Output: SELECT avg(Money_Requested) FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the average money requested across all entrepreneurs. [/INST]

Output: SELECT avg(Money_Requested) FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

Output: SELECT Name FROM People ORDER BY Weight ASC;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the names of people, ordered by weight ascending. [/INST]

Output: SELECT Name FROM People ORDER BY Weight ASC;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

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


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

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


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"? [/INST]

Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor != "Rachel Elnaugh";


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the names of entrepreneurs do no not have the investor Rachel Elnaugh. [/INST]

Output: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor != "Rachel Elnaugh";


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What is the weight of the shortest person? [/INST]

Output: SELECT Weight FROM people ORDER BY Height ASC LIMIT 1;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the weight of the shortest person. [/INST]

Output: SELECT Weight FROM people ORDER BY Height ASC LIMIT 1;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

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


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

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


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What is the total money requested by entrepreneurs with height more than 1.85? [/INST]

Output: SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Height  >  1.85;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Give the total money requested by entrepreneurs who are taller than 1.85. [/INST]

Output: SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Height  >  1.85;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"? [/INST]

Output: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor  =  "Simon Woodroffe" OR T1.Investor  =  "Peter Jones";


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones. [/INST]

Output: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Investor  =  "Simon Woodroffe" OR T1.Investor  =  "Peter Jones";


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the weights of entrepreneurs in descending order of money requested? [/INST]

Output: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested DESC;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the weights of entrepreneurs, ordered descending by amount of money requested. [/INST]

Output: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested DESC;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor? [/INST]

Output: SELECT Investor ,  COUNT(*) FROM entrepreneur GROUP BY Investor;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

Output: SELECT Investor ,  COUNT(*) FROM entrepreneur GROUP BY Investor;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What is the investor that has invested in the most number of entrepreneurs? [/INST]

Output: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the investor who have invested in the greatest number of entrepreneurs. [/INST]

Output: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the investors that have invested in at least two entrepreneurs? [/INST]

Output: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Return the investors who have invested in two or more entrepreneurs. [/INST]

Output: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of entrepreneurs and their companies in descending order of money requested? [/INST]

Output: SELECT T2.Name ,  T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount of money requested? [/INST]

Output: SELECT T2.Name ,  T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Money_Requested;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of people that are not entrepreneurs. [/INST]

Output: SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur);


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of people who are not entrepreneurs? [/INST]

Output: SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur);


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000. [/INST]

Output: SELECT Investor FROM entrepreneur WHERE Money_Requested  >  140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested  <  120000;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000? [/INST]

Output: SELECT Investor FROM entrepreneur WHERE Money_Requested  >  140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested  <  120000;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

Output: SELECT count(DISTINCT Company) FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

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

Output: SELECT count(DISTINCT Company) FROM entrepreneur;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Show the company of the tallest entrepreneur. [/INST]

Output: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Height DESC LIMIT 1;


Input:
[INST] Here is a database schema:
entrepreneur :
Entrepreneur_ID [ INT ] primary_key
People_ID [ INT ] entrepreneur.People_ID = people.People_ID
Company [ TEXT ]
Money_Requested [ INT ]
Investor [ TEXT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Date_of_Birth [ TEXT ]

Please write me a SQL statement that answers the following question: Which company was started by the entrepreneur with the greatest height? [/INST]

Output: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Height DESC LIMIT 1;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

Output: SELECT count(*) FROM perpetrator;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: List the date of perpetrators in descending order of the number of people killed. [/INST]

Output: SELECT Date FROM perpetrator ORDER BY Killed DESC;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: List the number of people injured by perpetrators in ascending order. [/INST]

Output: SELECT Injured FROM perpetrator ORDER BY Injured ASC;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What is the average number of people injured by all perpetrators? [/INST]

Output: SELECT avg(Injured) FROM perpetrator;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What is the location of the perpetrator with the largest kills. [/INST]

Output: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

Output: SELECT Name FROM People ORDER BY Height ASC;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

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


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Country != "China";


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the perpetrator with the biggest weight. [/INST]

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


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What is the total kills of the perpetrators with height more than 1.84. [/INST]

Output: SELECT sum(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T1.Height  >  1.84;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of perpetrators in country "China" or "Japan"? [/INST]

Output: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID WHERE T2.Country  =  "China" OR T2.Country  =  "Japan";


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What are the heights of perpetrators in descending order of the number of people they injured? [/INST]

Output: SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Injured DESC;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. [/INST]

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


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: What is the country that has the most perpetrators? [/INST]

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


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

Output: SELECT Country ,  COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*)  >=  2;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

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


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of people that are not perpetrators. [/INST]

Output: SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM perpetrator);


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20. [/INST]

Output: SELECT Country FROM perpetrator WHERE Injured  >  50 INTERSECT SELECT Country FROM perpetrator WHERE Injured  <  20;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

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

Output: SELECT count(DISTINCT LOCATION) FROM perpetrator;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: Show the date of the tallest perpetrator. [/INST]

Output: SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T1.Height DESC LIMIT 1;


Input:
[INST] Here is a database schema:
perpetrator :
Perpetrator_ID [ INT ] primary_key
People_ID [ INT ] perpetrator.People_ID = people.People_ID
Date [ TEXT ]
Year [ INT ]
Location [ TEXT ]
Country [ TEXT ]
Killed [ INT ]
Injured [ INT ]

people :
People_ID [ INT ] primary_key
Name [ TEXT ]
Height [ INT ]
Weight [ INT ]
Home Town [ TEXT ]

Please write me a SQL statement that answers the following question: In which year did the most recent crime happen? [/INST]

Output: SELECT max(YEAR) FROM perpetrator;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Report the name of all campuses in Los Angeles county. [/INST]

Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses are located in the county of Los Angeles? [/INST]

Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

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

Output: SELECT campus FROM campuses WHERE LOCATION  =  "Chico";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses are located in Chico? [/INST]

Output: SELECT campus FROM campuses WHERE LOCATION  =  "Chico";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find all the campuses opened in 1958. [/INST]

Output: SELECT campus FROM campuses WHERE YEAR  =  1958;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What are the campuses that opened in 1958? [/INST]

Output: SELECT campus FROM campuses WHERE YEAR  =  1958;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the campuses opened before 1800. [/INST]

Output: SELECT campus FROM campuses WHERE YEAR  <  1800;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses opened before 1800? [/INST]

Output: SELECT campus FROM campuses WHERE YEAR  <  1800;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Which campus was opened between 1935 and 1939? [/INST]

Output: SELECT campus FROM campuses WHERE YEAR  >=  1935 AND YEAR  <=  1939;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses opened between 1935 and 1939? [/INST]

Output: SELECT campus FROM campuses WHERE YEAR  >=  1935 AND YEAR  <=  1939;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco. [/INST]

Output: SELECT campus FROM campuses WHERE LOCATION  =  "Northridge" AND county  =  "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION  =  "San Francisco" AND county  =  "San Francisco";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses are located in Northridge, Los Angeles or in San Francisco, San Francisco? [/INST]

Output: SELECT campus FROM campuses WHERE LOCATION  =  "Northridge" AND county  =  "Los Angeles" UNION SELECT campus FROM campuses WHERE LOCATION  =  "San Francisco" AND county  =  "San Francisco";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the campus fee of "San Jose State University" in year 1996? [/INST]

Output: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id  =  t2.campus WHERE t1.campus  =  "San Jose State University" AND T2.year  =  1996;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the campus fee for San Jose State University in 1996? [/INST]

Output: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id  =  t2.campus WHERE t1.campus  =  "San Jose State University" AND T2.year  =  1996;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the campus fee of "San Francisco State University" in year 1996? [/INST]

Output: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id  =  t2.campus WHERE t1.campus  =  "San Francisco State University" AND T2.year  =  1996;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the campus fee for San Francisco State University in 1996? [/INST]

Output: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id  =  t2.campus WHERE t1.campus  =  "San Francisco State University" AND T2.year  =  1996;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find the count of universities whose campus fee is greater than the average campus fee. [/INST]

Output: SELECT count(*) FROM csu_fees WHERE campusfee  >  (SELECT avg(campusfee) FROM csu_fees);


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many universities have a campus fee higher than average? [/INST]

Output: SELECT count(*) FROM csu_fees WHERE campusfee  >  (SELECT avg(campusfee) FROM csu_fees);


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find the count of universities whose campus fee is greater than the average campus fee. [/INST]

Output: SELECT count(*) FROM csu_fees WHERE campusfee  >  (SELECT avg(campusfee) FROM csu_fees);


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many universities have a campus fee greater than the average? [/INST]

Output: SELECT count(*) FROM csu_fees WHERE campusfee  >  (SELECT avg(campusfee) FROM csu_fees);


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Which university is in Los Angeles county and opened after 1950? [/INST]

Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles" AND YEAR  >  1950;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses are located in Los Angeles county and opened after 1950? [/INST]

Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles" AND YEAR  >  1950;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Which year has the most degrees conferred? [/INST]

Output: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY sum(degrees) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: In what year was the most degrees conferred? [/INST]

Output: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY sum(degrees) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Which campus has the most degrees conferred in all times? [/INST]

Output: SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campus has the most degrees  conferrred over its entire existence? [/INST]

Output: SELECT campus FROM degrees GROUP BY campus ORDER BY sum(degrees) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Which campus has the most faculties in year 2003? [/INST]

Output: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2003 ORDER BY T2.faculty DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campus has the most faculties in 2003? [/INST]

Output: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2003 ORDER BY T2.faculty DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find the average fee on a CSU campus in 1996 [/INST]

Output: SELECT avg(campusfee) FROM csu_fees WHERE YEAR  =  1996;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the average fee for a CSU campus in the year of 1996? [/INST]

Output: SELECT avg(campusfee) FROM csu_fees WHERE YEAR  =  1996;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the average fee on a CSU campus in 2005? [/INST]

Output: SELECT avg(campusfee) FROM csu_fees WHERE YEAR  =  2005;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the average fee for a CSU campus in the year of 2005? [/INST]

Output: SELECT avg(campusfee) FROM csu_fees WHERE YEAR  =  2005;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: report the total number of degrees granted between 1998 and 2002. [/INST]

Output: SELECT T1.campus ,  sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id  =  T2.campus WHERE T2.year  >=  1998 AND T2.year  <=  2002 GROUP BY T1.campus;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: how many degrees were conferred between 1998 and 2002? [/INST]

Output: SELECT T1.campus ,  sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id  =  T2.campus WHERE T2.year  >=  1998 AND T2.year  <=  2002 GROUP BY T1.campus;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: For each Orange county campus, report the number of degrees granted after 2000. [/INST]

Output: SELECT T1.campus ,  sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id  =  T2.campus WHERE T1.county  =  "Orange" AND T2.year  >=  2000 GROUP BY T1.campus;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the total number of degrees granted after 2000 for each Orange county campus? [/INST]

Output: SELECT T1.campus ,  sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id  =  T2.campus WHERE T1.county  =  "Orange" AND T2.year  >=  2000 GROUP BY T1.campus;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: Find the names of the campus which has more faculties in 2002 than every campus in Orange county. [/INST]

Output: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2002 AND faculty  >  (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2002 AND T1.county  =  "Orange");


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county? [/INST]

Output: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2002 AND faculty  >  (SELECT max(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  T2.campus WHERE T2.year  =  2002 AND T1.county  =  "Orange");


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956? [/INST]

Output: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id  =  t2.campus WHERE t2.year  =  1956 AND totalenrollment_ay  >  400 AND FTE_AY  >  200;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled? [/INST]

Output: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id  =  t2.campus WHERE t2.year  =  1956 AND totalenrollment_ay  >  400 AND FTE_AY  >  200;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many campuses are there in Los Angeles county? [/INST]

Output: SELECT count(*) FROM campuses WHERE county  =  "Los Angeles";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many campuses exist are in the county of LA? [/INST]

Output: SELECT count(*) FROM campuses WHERE county  =  "Los Angeles";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: List the campuses in Los Angeles county. [/INST]

Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What campuses are in Los Angeles county? [/INST]

Output: SELECT campus FROM campuses WHERE county  =  "Los Angeles";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many degrees were conferred in "San Jose State University" in 2000? [/INST]

Output: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id  =  t2.campus WHERE t1.campus  =  "San Jose State University" AND t2.year  =  2000;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many degrees were conferred at San Jose State University in 2000? [/INST]

Output: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id  =  t2.campus WHERE t1.campus  =  "San Jose State University" AND t2.year  =  2000;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What are the degrees conferred in "San Francisco State University" in 2001. [/INST]

Output: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id  =  t2.campus WHERE t1.campus  =  "San Francisco State University" AND t2.year  =  2001;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What degrees were conferred in San Francisco State University in the year 2001? [/INST]

Output: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id  =  t2.campus WHERE t1.campus  =  "San Francisco State University" AND t2.year  =  2001;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many faculty is there in total in the year of 2002? [/INST]

Output: SELECT sum(faculty) FROM faculty WHERE YEAR  =  2002;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many faculty, in total, are there in the year 2002? [/INST]

Output: SELECT sum(faculty) FROM faculty WHERE YEAR  =  2002;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the number of faculty lines in campus "Long Beach State University" in 2002? [/INST]

Output: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus  =  T2.id WHERE T1.year  =  2002 AND T2.campus  =  "Long Beach State University";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What is the number of faculty at Long Beach State University in 2002? [/INST]

Output: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus  =  T2.id WHERE T1.year  =  2002 AND T2.campus  =  "Long Beach State University";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many faculty lines are there in "San Francisco State University" in year 2004? [/INST]

Output: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus  =  T2.id WHERE T1.year  =  2004 AND T2.campus  =  "San Francisco State University";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many faculty lines are there at San Francisco State University in 2004? [/INST]

Output: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus  =  T2.id WHERE T1.year  =  2004 AND T2.campus  =  "San Francisco State University";


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: List the campus that have between 600 and 1000 faculty lines in year 2004. [/INST]

Output: SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id  =  t2.campus WHERE t2.faculty  >=  600 AND t2.faculty  <=  1000 AND T1.year  =  2004;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: What are the campuses that had between 600 and 1000 faculty members in 2004? [/INST]

Output: SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id  =  t2.campus WHERE t2.faculty  >=  600 AND t2.faculty  <=  1000 AND T1.year  =  2004;


Input:
[INST] Here is a database schema:
Campuses :
Id [ INT ] primary_key
Campus [ TEXT ]
Location [ TEXT ]
County [ TEXT ]
Year [ INT ]

csu_fees :
Campus [ INT ] primary_key csu_fees.Campus = Campuses.Id
Year [ INT ]
CampusFee [ INT ]

degrees :
Year [ INT ] primary_key
Campus [ INT ] degrees.Campus = Campuses.Id
Degrees [ INT ]

discipline_enrollments :
Campus [ INT ] primary_key discipline_enrollments.Campus = Campuses.Id
Discipline [ INT ]
Year [ INT ]
Undergraduate [ INT ]
Graduate [ INT ]

enrollments :
Campus [ INT ] primary_key enrollments.Campus = Campuses.Id
Year [ INT ]
TotalEnrollment_AY [ INT ]
FTE_AY [ INT ]

faculty :
Campus [ INT ] faculty.Campus = Campuses.Id
Year [ INT ]
Faculty [ INT ]

Please write me a SQL statement that answers the following question: How many faculty lines are there in the university that conferred the most number of degrees in year 2002? [/INST]

Output: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id  =  t2.campus JOIN degrees AS T3 ON T1.id  =  t3.campus AND t2.year  =  t3.year WHERE t2.year  =  2002 ORDER BY t3.degrees DESC LIMIT 1;