Input:
[INST] Here is a database schema:
station :
id [ INT ] primary_key
name [ TEXT ]
lat [ INT ]
long [ INT ]
dock_count [ INT ]
city [ TEXT ]
installation_date [ TEXT ]

status :
station_id [ INT ] status.station_id = station.id
bikes_available [ INT ]
docks_available [ INT ]
time [ TEXT ]

trip :
id [ INT ] primary_key
duration [ INT ]
start_date [ TEXT ]
start_station_name [ TEXT ]
start_station_id [ INT ]
end_date [ TEXT ]
end_station_name [ TEXT ]
end_station_id [ INT ]
bike_id [ INT ]
subscription_type [ TEXT ]
zip_code [ INT ]

weather :
date [ TEXT ]
max_temperature_f [ INT ]
mean_temperature_f [ INT ]
min_temperature_f [ INT ]
max_dew_point_f [ INT ]
mean_dew_point_f [ INT ]
min_dew_point_f [ INT ]
max_humidity [ INT ]
mean_humidity [ INT ]
min_humidity [ INT ]
max_sea_level_pressure_inches [ INT ]
mean_sea_level_pressure_inches [ INT ]
min_sea_level_pressure_inches [ INT ]
max_visibility_miles [ INT ]
mean_visibility_miles [ INT ]
min_visibility_miles [ INT ]
max_wind_Speed_mph [ INT ]
mean_wind_speed_mph [ INT ]
max_gust_speed_mph [ INT ]
precipitation_inches [ INT ]
cloud_cover [ INT ]
events [ TEXT ]
wind_dir_degrees [ INT ]
zip_code [ INT ]

Please write me a SQL statement that answers the following question: How many trips started from Mountain View city and ended at Palo Alto city? [/INST]

Output: SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id  =  T2.start_station_id AND T2.id  =  T4.id AND T3.id  =  T4.end_station_id WHERE T1.city  =  "Mountain View" AND T3.city  =  "Palo Alto";


Input:
[INST] Here is a database schema:
station :
id [ INT ] primary_key
name [ TEXT ]
lat [ INT ]
long [ INT ]
dock_count [ INT ]
city [ TEXT ]
installation_date [ TEXT ]

status :
station_id [ INT ] status.station_id = station.id
bikes_available [ INT ]
docks_available [ INT ]
time [ TEXT ]

trip :
id [ INT ] primary_key
duration [ INT ]
start_date [ TEXT ]
start_station_name [ TEXT ]
start_station_id [ INT ]
end_date [ TEXT ]
end_station_name [ TEXT ]
end_station_id [ INT ]
bike_id [ INT ]
subscription_type [ TEXT ]
zip_code [ INT ]

weather :
date [ TEXT ]
max_temperature_f [ INT ]
mean_temperature_f [ INT ]
min_temperature_f [ INT ]
max_dew_point_f [ INT ]
mean_dew_point_f [ INT ]
min_dew_point_f [ INT ]
max_humidity [ INT ]
mean_humidity [ INT ]
min_humidity [ INT ]
max_sea_level_pressure_inches [ INT ]
mean_sea_level_pressure_inches [ INT ]
min_sea_level_pressure_inches [ INT ]
max_visibility_miles [ INT ]
mean_visibility_miles [ INT ]
min_visibility_miles [ INT ]
max_wind_Speed_mph [ INT ]
mean_wind_speed_mph [ INT ]
max_gust_speed_mph [ INT ]
precipitation_inches [ INT ]
cloud_cover [ INT ]
events [ TEXT ]
wind_dir_degrees [ INT ]
zip_code [ INT ]

Please write me a SQL statement that answers the following question: How many trips stated from  a station in Mountain View and ended at one in Palo Alto? [/INST]

Output: SELECT count(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id  =  T2.start_station_id AND T2.id  =  T4.id AND T3.id  =  T4.end_station_id WHERE T1.city  =  "Mountain View" AND T3.city  =  "Palo Alto";


Input:
[INST] Here is a database schema:
station :
id [ INT ] primary_key
name [ TEXT ]
lat [ INT ]
long [ INT ]
dock_count [ INT ]
city [ TEXT ]
installation_date [ TEXT ]

status :
station_id [ INT ] status.station_id = station.id
bikes_available [ INT ]
docks_available [ INT ]
time [ TEXT ]

trip :
id [ INT ] primary_key
duration [ INT ]
start_date [ TEXT ]
start_station_name [ TEXT ]
start_station_id [ INT ]
end_date [ TEXT ]
end_station_name [ TEXT ]
end_station_id [ INT ]
bike_id [ INT ]
subscription_type [ TEXT ]
zip_code [ INT ]

weather :
date [ TEXT ]
max_temperature_f [ INT ]
mean_temperature_f [ INT ]
min_temperature_f [ INT ]
max_dew_point_f [ INT ]
mean_dew_point_f [ INT ]
min_dew_point_f [ INT ]
max_humidity [ INT ]
mean_humidity [ INT ]
min_humidity [ INT ]
max_sea_level_pressure_inches [ INT ]
mean_sea_level_pressure_inches [ INT ]
min_sea_level_pressure_inches [ INT ]
max_visibility_miles [ INT ]
mean_visibility_miles [ INT ]
min_visibility_miles [ INT ]
max_wind_Speed_mph [ INT ]
mean_wind_speed_mph [ INT ]
max_gust_speed_mph [ INT ]
precipitation_inches [ INT ]
cloud_cover [ INT ]
events [ TEXT ]
wind_dir_degrees [ INT ]
zip_code [ INT ]

Please write me a SQL statement that answers the following question: What is the average latitude and longitude of the starting points of all trips? [/INST]

Output: SELECT avg(T1.lat) ,  avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id;


Input:
[INST] Here is a database schema:
station :
id [ INT ] primary_key
name [ TEXT ]
lat [ INT ]
long [ INT ]
dock_count [ INT ]
city [ TEXT ]
installation_date [ TEXT ]

status :
station_id [ INT ] status.station_id = station.id
bikes_available [ INT ]
docks_available [ INT ]
time [ TEXT ]

trip :
id [ INT ] primary_key
duration [ INT ]
start_date [ TEXT ]
start_station_name [ TEXT ]
start_station_id [ INT ]
end_date [ TEXT ]
end_station_name [ TEXT ]
end_station_id [ INT ]
bike_id [ INT ]
subscription_type [ TEXT ]
zip_code [ INT ]

weather :
date [ TEXT ]
max_temperature_f [ INT ]
mean_temperature_f [ INT ]
min_temperature_f [ INT ]
max_dew_point_f [ INT ]
mean_dew_point_f [ INT ]
min_dew_point_f [ INT ]
max_humidity [ INT ]
mean_humidity [ INT ]
min_humidity [ INT ]
max_sea_level_pressure_inches [ INT ]
mean_sea_level_pressure_inches [ INT ]
min_sea_level_pressure_inches [ INT ]
max_visibility_miles [ INT ]
mean_visibility_miles [ INT ]
min_visibility_miles [ INT ]
max_wind_Speed_mph [ INT ]
mean_wind_speed_mph [ INT ]
max_gust_speed_mph [ INT ]
precipitation_inches [ INT ]
cloud_cover [ INT ]
events [ TEXT ]
wind_dir_degrees [ INT ]
zip_code [ INT ]

Please write me a SQL statement that answers the following question: What is the average latitude and longitude of all starting stations for the trips? [/INST]

Output: SELECT avg(T1.lat) ,  avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

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

Output: SELECT count(*) FROM book;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: List the writers of the books in ascending alphabetical order. [/INST]

Output: SELECT Writer FROM book ORDER BY Writer ASC;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: List the titles of the books in ascending order of issues. [/INST]

Output: SELECT Title FROM book ORDER BY Issues ASC;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: What are the titles of the books whose writer is not "Elaine Lee"? [/INST]

Output: SELECT Title FROM book WHERE Writer != "Elaine Lee";


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: What are the title and issues of the books? [/INST]

Output: SELECT Title ,  Issues FROM book;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: What are the dates of publications in descending order of price? [/INST]

Output: SELECT Publication_Date FROM publication ORDER BY Price DESC;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: What are the distinct publishers of publications with price higher than 5000000? [/INST]

Output: SELECT DISTINCT Publisher FROM publication WHERE Price  >  5000000;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: List the publisher of the publication with the highest price. [/INST]

Output: SELECT Publisher FROM publication ORDER BY Price DESC LIMIT 1;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: List the publication dates of publications with 3 lowest prices. [/INST]

Output: SELECT Publication_Date FROM publication ORDER BY Price ASC LIMIT 3;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show the title and publication dates of books. [/INST]

Output: SELECT T1.Title ,  T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID  =  T2.Book_ID;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show writers who have published a book with price more than 4000000. [/INST]

Output: SELECT T1.Writer FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID  =  T2.Book_ID WHERE T2.Price  >  4000000;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show the titles of books in descending order of publication price. [/INST]

Output: SELECT T1.Title FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID  =  T2.Book_ID ORDER BY T2.Price DESC;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show publishers that have more than one publication. [/INST]

Output: SELECT Publisher FROM publication GROUP BY Publisher HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show different publishers together with the number of publications they have. [/INST]

Output: SELECT Publisher ,  COUNT(*) FROM publication GROUP BY Publisher;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Please show the most common publication date. [/INST]

Output: SELECT Publication_Date FROM publication GROUP BY Publication_Date ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: List the writers who have written more than one book. [/INST]

Output: SELECT Writer FROM book GROUP BY Writer HAVING COUNT(*)  >  1;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: List the titles of books that are not published. [/INST]

Output: SELECT Title FROM book WHERE Book_ID NOT IN (SELECT Book_ID FROM publication);


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show the publishers that have publications with price higher than 10000000 and publications with price lower than 5000000. [/INST]

Output: SELECT Publisher FROM publication WHERE Price  >  10000000 INTERSECT SELECT Publisher FROM publication WHERE Price  <  5000000;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

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

Output: SELECT COUNT (DISTINCT Publication_Date) FROM publication;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: How many distinct publication dates are there in our record? [/INST]

Output: SELECT COUNT (DISTINCT Publication_Date) FROM publication;


Input:
[INST] Here is a database schema:
publication :
Publication_ID [ INT ] primary_key
Book_ID [ INT ] publication.Book_ID = book.Book_ID
Publisher [ TEXT ]
Publication_Date [ TEXT ]
Price [ INT ]

book :
Book_ID [ INT ] primary_key
Title [ TEXT ]
Issues [ INT ]
Writer [ TEXT ]

Please write me a SQL statement that answers the following question: Show the prices of publications whose publisher is either "Person" or "Wiley" [/INST]

Output: SELECT Price FROM publication WHERE Publisher  =  "Person" OR Publisher  =  "Wiley";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

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

Output: SELECT count(*) FROM actor;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

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

Output: SELECT count(*) FROM actor;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: List the name of actors in ascending alphabetical order. [/INST]

Output: SELECT Name FROM actor ORDER BY Name ASC;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

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

Output: SELECT Name FROM actor ORDER BY Name ASC;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the characters and duration of actors? [/INST]

Output: SELECT Character ,  Duration FROM actor;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Return the characters and durations for each actor. [/INST]

Output: SELECT Character ,  Duration FROM actor;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: List the name of actors whose age is not 20. [/INST]

Output: SELECT Name FROM actor WHERE Age != 20;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of actors who are not 20 years old? [/INST]

Output: SELECT Name FROM actor WHERE Age != 20;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the characters of actors in descending order of age? [/INST]

Output: SELECT Character FROM actor ORDER BY age DESC;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Return the characters for actors, ordered by age descending. [/INST]

Output: SELECT Character FROM actor ORDER BY age DESC;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

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

Output: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Return the duration of the actor with the greatest age. [/INST]

Output: SELECT Duration FROM actor ORDER BY Age DESC LIMIT 1;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of musicals with nominee "Bob Fosse"? [/INST]

Output: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Return the names of musicals who have the nominee Bob Fosse. [/INST]

Output: SELECT Name FROM musical WHERE Nominee  =  "Bob Fosse";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the distinct nominees of the musicals with the award that is not "Tony Award"? [/INST]

Output: SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Return the different nominees of musicals that have an award that is not the Tony Award. [/INST]

Output: SELECT DISTINCT Nominee FROM musical WHERE Award != "Tony Award";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

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

Output: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of actors and the musicals that they are in? [/INST]

Output: SELECT T1.Name ,  T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show names of actors that have appeared in musical with name "The Phantom of the Opera". [/INST]

Output: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "The Phantom of the Opera";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of actors who have been in the musical titled The Phantom of the Opera? [/INST]

Output: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID WHERE T2.Name  =  "The Phantom of the Opera";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show names of actors in descending order of the year their musical is awarded. [/INST]

Output: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID ORDER BY T2.Year DESC;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of actors ordered descending by the year in which their musical was awarded? [/INST]

Output: SELECT T1.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID ORDER BY T2.Year DESC;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show names of musicals and the number of actors who have appeared in the musicals. [/INST]

Output: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: How many actors have appeared in each musical? [/INST]

Output: SELECT T2.Name ,  COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show names of musicals which have at least three actors. [/INST]

Output: SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of musicals who have at 3 or more actors? [/INST]

Output: SELECT T2.Name FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID  =  T2.Musical_ID GROUP BY T1.Musical_ID HAVING COUNT(*)  >=  3;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show different nominees and the number of musicals they have been nominated. [/INST]

Output: SELECT Nominee ,  COUNT(*) FROM musical GROUP BY Nominee;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: How many musicals has each nominee been nominated for? [/INST]

Output: SELECT Nominee ,  COUNT(*) FROM musical GROUP BY Nominee;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Please show the nominee who has been nominated the greatest number of times. [/INST]

Output: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Who is the nominee who has been nominated for the most musicals? [/INST]

Output: SELECT Nominee FROM musical GROUP BY Nominee ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: List the most common result of the musicals. [/INST]

Output: SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Return the most frequent result across all musicals. [/INST]

Output: SELECT RESULT FROM musical GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: List the nominees that have been nominated more than two musicals. [/INST]

Output: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Who are the nominees who have been nominated more than two times? [/INST]

Output: SELECT Nominee FROM musical GROUP BY Nominee HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: List the name of musicals that do not have actors. [/INST]

Output: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor);


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: What are the names of musicals who have no actors? [/INST]

Output: SELECT Name FROM musical WHERE Musical_ID NOT IN (SELECT Musical_ID FROM actor);


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show the nominees that have nominated musicals for both "Tony Award" and "Drama Desk Award". [/INST]

Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Who are the nominees who have been nominated for both a Tony Award and a Drama Desk Award? [/INST]

Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" INTERSECT SELECT Nominee FROM musical WHERE Award  =  "Drama Desk Award";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Show the musical nominee with award "Bob Fosse" or "Cleavant Derricks". [/INST]

Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks";


Input:
[INST] Here is a database schema:
musical :
Musical_ID [ INT ] primary_key
Name [ TEXT ]
Year [ INT ]
Award [ TEXT ]
Category [ TEXT ]
Nominee [ TEXT ]
Result [ TEXT ]

actor :
Actor_ID [ INT ] primary_key
Name [ TEXT ]
Musical_ID [ INT ] actor.Musical_ID = actor.Actor_ID
Character [ TEXT ]
Duration [ TEXT ]
age [ INT ]

Please write me a SQL statement that answers the following question: Who are the nominees who were nominated for either of the Bob Fosse or Cleavant Derricks awards? [/INST]

Output: SELECT Nominee FROM musical WHERE Award  =  "Tony Award" OR Award  =  "Cleavant Derricks";


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the emails of the user named "Mary". [/INST]

Output: SELECT email FROM user_profiles WHERE name  =  'Mary';


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: What is the partition id of the user named "Iron Man". [/INST]

Output: SELECT partitionid FROM user_profiles WHERE name  =  'Iron Man';


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

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

Output: SELECT count(*) FROM user_profiles;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: How many followers does each user have? [/INST]

Output: SELECT count(*) FROM follows;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

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

Output: SELECT count(*) FROM follows GROUP BY f1;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

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

Output: SELECT count(*) FROM tweets;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the number of users who posted some tweets. [/INST]

Output: SELECT count(DISTINCT UID) FROM tweets;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name and email of the user whose name contains the word ‘Swift’. [/INST]

Output: SELECT name ,  email FROM user_profiles WHERE name LIKE '%Swift%';


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the names of users whose emails contain ‘superstar’ or ‘edu’. [/INST]

Output: SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%';


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Return the text of tweets about the topic 'intern'. [/INST]

Output: SELECT text FROM tweets WHERE text LIKE '%intern%';


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name and email of the users who have more than 1000 followers. [/INST]

Output: SELECT name ,  email FROM user_profiles WHERE followers  >  1000;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the names of the users whose number of followers is greater than that of the user named "Tyler Swift". [/INST]

Output: SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 WHERE T1.name  =  'Tyler Swift');


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name and email for the users who have more than one follower. [/INST]

Output: SELECT T1.name ,  T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the names of users who have more than one tweet. [/INST]

Output: SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the id of users who are followed by Mary and Susan. [/INST]

Output: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Mary" INTERSECT SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Susan";


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the id of users who are followed by Mary or Susan. [/INST]

Output: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Mary" OR T1.name  =  "Susan";


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the user who has the largest number of followers. [/INST]

Output: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name and email of the user followed by the least number of people. [/INST]

Output: SELECT name ,  email FROM user_profiles ORDER BY followers LIMIT 1;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: List the name and number of followers for each user, and sort the results by the number of followers in descending order. [/INST]

Output: SELECT name ,  followers FROM user_profiles ORDER BY followers DESC;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: List the names of 5 users followed by the largest number of other users. [/INST]

Output: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: List the text of all tweets in the order of date. [/INST]

Output: SELECT text FROM tweets ORDER BY createdate;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name of each user and number of tweets tweeted by each of them. [/INST]

Output: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name and partition id for users who tweeted less than twice. [/INST]

Output: SELECT T1.name ,  T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  <  2;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the name of the user who tweeted more than once, and number of tweets tweeted by them. [/INST]

Output: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the average number of followers for the users who do not have any tweet. [/INST]

Output: SELECT avg(followers) FROM user_profiles WHERE UID NOT IN (SELECT UID FROM tweets);


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the average number of followers for the users who had some tweets. [/INST]

Output: SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets);


Input:
[INST] Here is a database schema:
follows :
f1 [ INT ] primary_key follows.f1 = user_profiles.uid
f2 [ INT ] follows.f2 = user_profiles.uid

tweets :
id [ INT ] primary_key
uid [ INT ] tweets.uid = user_profiles.uid
text [ TEXT ]
createdate [ TEXT ]

user_profiles :
uid [ INT ] primary_key
name [ TEXT ]
email [ TEXT ]
partitionid [ INT ]
followers [ INT ]

Please write me a SQL statement that answers the following question: Find the maximum and total number of followers of all users. [/INST]

Output: SELECT max(followers) ,  sum(followers) FROM user_profiles;


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 all the catalog entries. [/INST]

Output: SELECT distinct(catalog_entry_name) 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: What are all the catalog entry names? [/INST]

Output: SELECT distinct(catalog_entry_name) 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 list of attribute data types possessed by more than 3 attribute definitions. [/INST]

Output: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3;


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 attribute data types with more than 3 attribute definitions? [/INST]

Output: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3;


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 is the attribute data type of the attribute with name "Green"? [/INST]

Output: SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name  =  "Green";


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 attribute data type for the attribute named "Green". [/INST]

Output: SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name  =  "Green";


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 level of catalog structure with level between 5 and 10. [/INST]

Output: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10;


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 name and level of catalog structure with level number between 5 and 10 [/INST]

Output: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10;


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 all the catalog publishers whose name contains "Murray" [/INST]

Output: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%";


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 publishers have substring "Murray" in their names? [/INST]

Output: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%";


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 publisher has published the most catalogs? [/INST]

Output: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 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: Find the catalog publisher that has the most catalogs. [/INST]

Output: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 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: Find the names and publication dates of all catalogs that have catalog level number greater than 5. [/INST]

Output: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  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: What are the name and publication date of the catalogs with catalog level number above 5? [/INST]

Output: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  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: What are the entry names of catalog with the attribute possessed by most entries. [/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.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 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: Find the entry names of the catalog with the attribute that have the most entries. [/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.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 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: What is the entry name of the most expensive catalog (in USD)? [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 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: Find the entry name of the catalog with the highest price (in USD). [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 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: What is the level name of the cheapest catalog (in USD)? [/INST]

Output: SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number  =  t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 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: Find the level name of the catalog with the lowest price (in USD). [/INST]

Output: SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number  =  t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 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: What are the average and minimum price (in Euro) of all products? [/INST]

Output: SELECT avg(price_in_euros) ,  min(price_in_euros) 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: Give me the average and minimum price (in Euro) of the products. [/INST]

Output: SELECT avg(price_in_euros) ,  min(price_in_euros) 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: What is the product with the highest height? Give me the catalog entry name. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 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: Which catalog content has the highest height? Give me the catalog entry name. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 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: Find the name of the product that has the smallest capacity. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 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: Which catalog content has the smallest capacity? Return the catalog entry name. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 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: Find the names of all the products whose stock number starts with "2". [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%";


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 a product stock number that starts from "2"? Show the catalog entry names. [/INST]

Output: SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%";


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 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";