Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of catalog entries with level number 8? [/INST]

Output: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.catalog_level_number  =  "8";


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Find the names of the products with length smaller than 3 or height greater than 5. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH  <  3 OR width  >  5;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Which catalog contents have length below 3 or above 5? Find the catalog entry names. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH  <  3 OR width  >  5;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name and attribute ID of the attribute definitions with attribute value 0. [/INST]

Output: SELECT t1.attribute_name ,  t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id  =  t2.attribute_id WHERE t2.attribute_value  =  0;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID. [/INST]

Output: SELECT t1.attribute_name ,  t1.attribute_id FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id  =  t2.attribute_id WHERE t2.attribute_value  =  0;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Find the name and capacity of products with price greater than 700 (in USD). [/INST]

Output: SELECT catalog_entry_name ,  capacity FROM Catalog_Contents WHERE price_in_dollars  >  700;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities. [/INST]

Output: SELECT catalog_entry_name ,  capacity FROM Catalog_Contents WHERE price_in_dollars  >  700;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Find the dates on which more than one revisions were made. [/INST]

Output: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: On which days more than one revisions were made on catalogs. [/INST]

Output: SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

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

Output: SELECT count(*) FROM catalog_contents;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

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

Output: SELECT count(*) FROM catalog_contents;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: Name all the products with next entry ID greater than 8. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id  >  8;


Input:
[INST] Here is a database schema:
Attribute_Definitions :
attribute_id [ INT ] primary_key
attribute_name [ TEXT ]
attribute_data_type [ TEXT ]

Catalogs :
catalog_id [ INT ] primary_key
catalog_name [ TEXT ]
catalog_publisher [ TEXT ]
date_of_publication [ TEXT ]
date_of_latest_revision [ TEXT ]

Catalog_Structure :
catalog_level_number [ INT ] primary_key
catalog_id [ INT ] Catalog_Structure.catalog_id = Catalogs.catalog_id
catalog_level_name [ TEXT ]

Catalog_Contents :
catalog_entry_id [ INT ] primary_key
catalog_level_number [ INT ] Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
parent_entry_id [ INT ]
previous_entry_id [ INT ]
next_entry_id [ INT ]
catalog_entry_name [ TEXT ]
product_stock_number [ TEXT ]
price_in_dollars [ INT ]
price_in_euros [ INT ]
price_in_pounds [ INT ]
capacity [ TEXT ]
length [ TEXT ]
height [ TEXT ]
width [ TEXT ]

Catalog_Contents_Additional_Attributes :
catalog_entry_id [ INT ] Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
catalog_level_number [ INT ] Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
attribute_id [ INT ]
attribute_value [ TEXT ]

Please write me a SQL statement that answers the following question: What are the catalog entry names of the products with next entry ID above 8? [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id  >  8;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: How many aircrafts do we have? [/INST]

Output: SELECT count(*) FROM Aircraft;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

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

Output: SELECT count(*) FROM Aircraft;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show name and distance for all aircrafts. [/INST]

Output: SELECT name ,  distance FROM Aircraft;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names and distances for all airplanes? [/INST]

Output: SELECT name ,  distance FROM Aircraft;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show ids for all aircrafts with more than 1000 distance. [/INST]

Output: SELECT aid FROM Aircraft WHERE distance  >  1000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the ids of all aircrafts that can cover a distance of more than 1000? [/INST]

Output: SELECT aid FROM Aircraft WHERE distance  >  1000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: How many aircrafts have distance between 1000 and 5000? [/INST]

Output: SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the count of aircrafts that have a distance between 1000 and 5000? [/INST]

Output: SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name and distance for aircraft with id 12? [/INST]

Output: SELECT name ,  distance FROM Aircraft WHERE aid  =  12;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name and distance for the aircraft that has an id of 12? [/INST]

Output: SELECT name ,  distance FROM Aircraft WHERE aid  =  12;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the minimum, average, and maximum distance of all aircrafts. [/INST]

Output: SELECT min(distance) ,  avg(distance) ,  max(distance) FROM Aircraft;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Return the minimum, average and maximum distances traveled across all aircrafts. [/INST]

Output: SELECT min(distance) ,  avg(distance) ,  max(distance) FROM Aircraft;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the id and name of the aircraft with the maximum distance. [/INST]

Output: SELECT aid ,  name FROM Aircraft ORDER BY distance DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the id and name of the aircraft that can cover the maximum distance? [/INST]

Output: SELECT aid ,  name FROM Aircraft ORDER BY distance DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the name of aircrafts with top three lowest distances. [/INST]

Output: SELECT name FROM Aircraft ORDER BY distance LIMIT 3;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the aircrafts with top 3 shortest lengthes? List their names. [/INST]

Output: SELECT name FROM Aircraft ORDER BY distance LIMIT 3;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all aircrafts with distances more than the average. [/INST]

Output: SELECT name FROM Aircraft WHERE distance  >  (SELECT avg(distance) FROM Aircraft);


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of all aircrafts that can cover more distances than average? [/INST]

Output: SELECT name FROM Aircraft WHERE distance  >  (SELECT avg(distance) FROM Aircraft);


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: How many employees do we have? [/INST]

Output: SELECT count(*) FROM Employee;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

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

Output: SELECT count(*) FROM Employee;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show name and salary for all employees sorted by salary. [/INST]

Output: SELECT name ,  salary FROM Employee ORDER BY salary;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name and salary of all employees in order of salary? [/INST]

Output: SELECT name ,  salary FROM Employee ORDER BY salary;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show ids for all employees with at least 100000 salary. [/INST]

Output: SELECT eid FROM Employee WHERE salary  >  100000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the id of every employee who has at least a salary of  100000? [/INST]

Output: SELECT eid FROM Employee WHERE salary  >  100000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: How many employees have salary between 100000 and 200000? [/INST]

Output: SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the number of employees that have a salary between 100000 and 200000? [/INST]

Output: SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name and salary for employee with id 242518965? [/INST]

Output: SELECT name ,  salary FROM Employee WHERE eid  =  242518965;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name and salary of the employee with the id 242518965? [/INST]

Output: SELECT name ,  salary FROM Employee WHERE eid  =  242518965;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is average and maximum salary of all employees. [/INST]

Output: SELECT avg(salary) ,  max(salary) FROM Employee;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the average and largest salary of all employees? [/INST]

Output: SELECT avg(salary) ,  max(salary) FROM Employee;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the id and name of the employee with maximum salary. [/INST]

Output: SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the id and name of the employee with the highest salary? [/INST]

Output: SELECT eid ,  name FROM Employee ORDER BY salary DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the name of employees with three lowest salaries. [/INST]

Output: SELECT name FROM Employee ORDER BY salary ASC LIMIT 3;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name of the 3 employees who get paid the least? [/INST]

Output: SELECT name FROM Employee ORDER BY salary ASC LIMIT 3;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all employees with salary more than the average. [/INST]

Output: SELECT name FROM Employee WHERE salary  >  (SELECT avg(salary) FROM Employee);


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of all employees who have a salary higher than average? [/INST]

Output: SELECT name FROM Employee WHERE salary  >  (SELECT avg(salary) FROM Employee);


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the id and salary of Mark Young. [/INST]

Output: SELECT eid ,  salary FROM Employee WHERE name  =  'Mark Young';


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the id and salary of the employee named Mark Young? [/INST]

Output: SELECT eid ,  salary FROM Employee WHERE name  =  'Mark Young';


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: How many flights do we have? [/INST]

Output: SELECT count(*) FROM Flight;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

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

Output: SELECT count(*) FROM Flight;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show flight number, origin, destination of all flights in the alphabetical order of the departure cities. [/INST]

Output: SELECT flno ,  origin ,  destination FROM Flight ORDER BY origin;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the flight number, origin, and destination for all flights in alphabetical order by departure cities? [/INST]

Output: SELECT flno ,  origin ,  destination FROM Flight ORDER BY origin;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show all flight number from Los Angeles. [/INST]

Output: SELECT flno FROM Flight WHERE origin  =  "Los Angeles";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the numbers of all flights coming from Los Angeles? [/INST]

Output: SELECT flno FROM Flight WHERE origin  =  "Los Angeles";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show origins of all flights with destination Honolulu. [/INST]

Output: SELECT origin FROM Flight WHERE destination  =  "Honolulu";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the origins of all flights that are headed to Honolulu? [/INST]

Output: SELECT origin FROM Flight WHERE destination  =  "Honolulu";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show me the departure date and arrival date for all flights from Los Angeles to Honolulu. [/INST]

Output: SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the departure and arrival dates of all flights from LA to Honolulu? [/INST]

Output: SELECT departure_date ,  arrival_date FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show flight number for all flights with more than 2000 distance. [/INST]

Output: SELECT flno FROM Flight WHERE distance  >  2000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the numbers of all flights that can cover a distance of more than 2000? [/INST]

Output: SELECT flno FROM Flight WHERE distance  >  2000;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the average price for flights from Los Angeles to Honolulu. [/INST]

Output: SELECT avg(price) FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the average price for flights from LA to Honolulu? [/INST]

Output: SELECT avg(price) FROM Flight WHERE origin  =  "Los Angeles" AND destination  =  "Honolulu";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show origin and destination for flights with price higher than 300. [/INST]

Output: SELECT origin ,  destination FROM Flight WHERE price  >  300;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the origin and destination for all flights whose price is higher than 300? [/INST]

Output: SELECT origin ,  destination FROM Flight WHERE price  >  300;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the flight number and distance of the flight with maximum price. [/INST]

Output: SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the flight number and its distance for the one with the maximum price? [/INST]

Output: SELECT flno ,  distance FROM Flight ORDER BY price DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the flight number of flights with three lowest distances. [/INST]

Output: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

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

Output: SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the average distance and average price for flights from Los Angeles. [/INST]

Output: SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the average distance and price for all flights from LA? [/INST]

Output: SELECT avg(distance) ,  avg(price) FROM Flight WHERE origin  =  "Los Angeles";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show all origins and the number of flights from each origin. [/INST]

Output: SELECT origin ,  count(*) FROM Flight GROUP BY origin;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: For each origin, how many flights came from there? [/INST]

Output: SELECT origin ,  count(*) FROM Flight GROUP BY origin;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show all destinations and the number of flights to each destination. [/INST]

Output: SELECT destination ,  count(*) FROM Flight GROUP BY destination;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the destinations and number of flights to each one? [/INST]

Output: SELECT destination ,  count(*) FROM Flight GROUP BY destination;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Which origin has most number of flights? [/INST]

Output: SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What place has the most flights coming from there? [/INST]

Output: SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Which destination has least number of flights? [/INST]

Output: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What destination has the fewest number of flights? [/INST]

Output: SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the aircraft name for the flight with number 99 [/INST]

Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name of the aircraft that was on flight number 99? [/INST]

Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show all flight numbers with aircraft Airbus A340-300. [/INST]

Output: SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T2.name  =  "Airbus A340-300";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the flight numbers for the aircraft Airbus A340-300? [/INST]

Output: SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T2.name  =  "Airbus A340-300";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show aircraft names and number of flights for each aircraft. [/INST]

Output: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name of each aircraft and how many flights does each one complete? [/INST]

Output: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all aircraft with at least two flights. [/INST]

Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names for all aircrafts with at least 2 flights? [/INST]

Output: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: How many employees have certificate. [/INST]

Output: SELECT count(DISTINCT eid) FROM Certificate;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the count of distinct employees with certificates? [/INST]

Output: SELECT count(DISTINCT eid) FROM Certificate;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show ids for all employees who don't have a certificate. [/INST]

Output: SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the ids of all employees that don't have certificates? [/INST]

Output: SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all aircrafts of which John Williams has certificates. [/INST]

Output: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of all aircrafts that John Williams have certificates to be able to fly? [/INST]

Output: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all employees who have certificate of Boeing 737-800. [/INST]

Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of all employees who have a certificate to fly Boeing 737-800? [/INST]

Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300. [/INST]

Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300? [/INST]

Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show names for all employees who do not have certificate of Boeing 737-800. [/INST]

Output: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of all employees who are not certified to fly Boeing 737-800s? [/INST]

Output: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800";


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the name of aircraft which fewest people have its certificate. [/INST]

Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What are the names of the aircraft that the least people are certified to fly? [/INST]

Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate. [/INST]

Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly? [/INST]

Output: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: what is the salary and name of the employee who has the most number of aircraft certificates? [/INST]

Output: SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the salaray and name of the employee that is certified to fly the most planes? [/INST]

Output: SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000? [/INST]

Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.distance  >  5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
flight :
flno [ INT ] primary_key
origin [ TEXT ]
destination [ TEXT ]
distance [ INT ]
departure_date [ TEXT ]
arrival_date [ TEXT ]
price [ INT ]
aid [ INT ] flight.aid = aircraft.aid

aircraft :
aid [ INT ] primary_key
name [ TEXT ]
distance [ INT ]

employee :
eid [ INT ] primary_key
name [ TEXT ]
salary [ INT ]

certificate :
eid [ INT ] primary_key certificate.eid = employee.eid
aid [ INT ] certificate.aid = aircraft.aid

Please write me a SQL statement that answers the following question: What is the salaray and name of the employee with the most certificates to fly planes more than 5000? [/INST]

Output: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.distance  >  5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

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

Output: SELECT count(DISTINCT allergy) FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

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

Output: SELECT count(DISTINCT allergy) FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: How many different allergy types exist? [/INST]

Output: SELECT count(DISTINCT allergytype) FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

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

Output: SELECT count(DISTINCT allergytype) FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Show all allergy types. [/INST]

Output: SELECT DISTINCT allergytype FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

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

Output: SELECT DISTINCT allergytype FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Show all allergies and their types. [/INST]

Output: SELECT allergy ,  allergytype FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: What are the allergies and their types? [/INST]

Output: SELECT allergy ,  allergytype FROM Allergy_type;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Show all allergies with type food. [/INST]

Output: SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype  =  "food";


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: What are all the different food allergies? [/INST]

Output: SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype  =  "food";


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: What is the type of allergy Cat? [/INST]

Output: SELECT allergytype FROM Allergy_type WHERE allergy  =  "Cat";


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: What is allergy type of a cat allergy? [/INST]

Output: SELECT allergytype FROM Allergy_type WHERE allergy  =  "Cat";


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: How many allergies have type animal? [/INST]

Output: SELECT count(*) FROM Allergy_type WHERE allergytype  =  "animal";


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: How many animal type allergies exist? [/INST]

Output: SELECT count(*) FROM Allergy_type WHERE allergytype  =  "animal";


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Show all allergy types and the number of allergies in each type. [/INST]

Output: SELECT allergytype ,  count(*) FROM Allergy_type GROUP BY allergytype;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: What are the allergy types and how many allergies correspond to each one? [/INST]

Output: SELECT allergytype ,  count(*) FROM Allergy_type GROUP BY allergytype;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Which allergy type has most number of allergies? [/INST]

Output: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

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

Output: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Which allergy type has least number of allergies? [/INST]

Output: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

Please write me a SQL statement that answers the following question: Which allergy type is the least common? [/INST]

Output: SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1;


Input:
[INST] Here is a database schema:
Allergy_Type :
Allergy [ TEXT ] primary_key
AllergyType [ TEXT ]

Has_Allergy :
StuID [ INT ] Has_Allergy.StuID = Student.StuID
Allergy [ TEXT ] Has_Allergy.Allergy = Allergy_Type.Allergy

Student :
StuID [ INT ] primary_key
LName [ TEXT ]
Fname [ TEXT ]
Age [ INT ]
Sex [ TEXT ]
Major [ INT ]
Advisor [ INT ]
city_code [ TEXT ]

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

Output: SELECT count(*) FROM Student;