answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC
CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER)
List each donator name and the amount of endowment in descending order of the amount of endowment.
<s>[INST] Given the following SQL query and context: Query: SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC Context: CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: List each donator name and the amount of endowment in descending order of the amount of endowment. The answer to your question is: SELECT donator_name, SUM(amount) FROM endowment GROUP BY donator_name ORDER BY SUM(amount) DESC. [/s>
SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment)
CREATE TABLE endowment (school_name VARCHAR, school_id VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR)
List the names of the schools without any endowment.
<s>[INST] Given the following SQL query and context: Query: SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment) Context: CREATE TABLE endowment (school_name VARCHAR, school_id VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of the schools without any endowment. The answer to your question is: SELECT school_name FROM school WHERE NOT school_id IN (SELECT school_id FROM endowment). [/s>
SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10
CREATE TABLE school (school_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER)
List all the names of schools with an endowment amount smaller than or equal to 10.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10 Context: CREATE TABLE school (school_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: List all the names of schools with an endowment amount smaller than or equal to 10. The answer to your question is: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING SUM(T1.amount) <= 10. [/s>
SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton'
CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR)
Show the names of donors who donated to both school "Glenn" and "Triton."
<s>[INST] Given the following SQL query and context: Query: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton' Context: CREATE TABLE school (school_id VARCHAR, school_name VARCHAR); CREATE TABLE endowment (donator_name VARCHAR, school_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of donors who donated to both school "Glenn" and "Triton." The answer to your question is: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Triton'. [/s>
SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9
CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER)
Show the names of all the donors except those whose donation amount less than 9.
<s>[INST] Given the following SQL query and context: Query: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9 Context: CREATE TABLE endowment (donator_name VARCHAR, amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the names of all the donors except those whose donation amount less than 9. The answer to your question is: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount < 9. [/s>
SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1
CREATE TABLE endowment (amount VARCHAR, donator_name VARCHAR)
List the amount and donor name for the largest amount of donation.
<s>[INST] Given the following SQL query and context: Query: SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1 Context: CREATE TABLE endowment (amount VARCHAR, donator_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the amount and donor name for the largest amount of donation. The answer to your question is: SELECT amount, donator_name FROM endowment ORDER BY amount DESC LIMIT 1. [/s>
SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001
CREATE TABLE budget (budgeted VARCHAR, YEAR VARCHAR)
How many budgets are above 3000 in year 2001 or before?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001 Context: CREATE TABLE budget (budgeted VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many budgets are above 3000 in year 2001 or before? The answer to your question is: SELECT COUNT(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001. [/s>
SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002
CREATE TABLE budget (budgeted VARCHAR, invested VARCHAR, school_id VARCHAR, year VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR)
Show each school name, its budgeted amount, and invested amount in year 2002 or after.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002 Context: CREATE TABLE budget (budgeted VARCHAR, invested VARCHAR, school_id VARCHAR, year VARCHAR); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show each school name, its budgeted amount, and invested amount in year 2002 or after. The answer to your question is: SELECT T2.school_name, T1.budgeted, T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002. [/s>
SELECT DISTINCT donator_name FROM endowment
CREATE TABLE endowment (donator_name VARCHAR)
Show all donor names.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT donator_name FROM endowment Context: CREATE TABLE endowment (donator_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all donor names. The answer to your question is: SELECT DISTINCT donator_name FROM endowment. [/s>
SELECT COUNT(*) FROM budget WHERE budgeted < invested
CREATE TABLE budget (budgeted INTEGER, invested VARCHAR)
How many budget record has a budget amount smaller than the invested amount?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM budget WHERE budgeted < invested Context: CREATE TABLE budget (budgeted INTEGER, invested VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many budget record has a budget amount smaller than the invested amount? The answer to your question is: SELECT COUNT(*) FROM budget WHERE budgeted < invested. [/s>
SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'
CREATE TABLE budget (budgeted INTEGER, school_id VARCHAR); CREATE TABLE school (school_id VARCHAR, school_name VARCHAR)
What is the total budget amount for school "Glenn" in all years?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn' Context: CREATE TABLE budget (budgeted INTEGER, school_id VARCHAR); CREATE TABLE school (school_id VARCHAR, school_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total budget amount for school "Glenn" in all years? The answer to your question is: SELECT SUM(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'. [/s>
SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10
CREATE TABLE endowment (school_id VARCHAR, amount INTEGER); CREATE TABLE budget (school_id VARCHAR, budgeted INTEGER); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR)
Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10 Context: CREATE TABLE endowment (school_id VARCHAR, amount INTEGER); CREATE TABLE budget (school_id VARCHAR, budgeted INTEGER); CREATE TABLE school (school_name VARCHAR, school_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10. The answer to your question is: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING SUM(T1.budgeted) > 100 OR SUM(T3.amount) > 10. [/s>
SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1
CREATE TABLE school (School_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER)
Find the names of schools that have more than one donator with donation amount above 8.5.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1 Context: CREATE TABLE school (School_name VARCHAR, school_id VARCHAR); CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the names of schools that have more than one donator with donation amount above 8.5. The answer to your question is: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING COUNT(*) > 1. [/s>
SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1)
CREATE TABLE endowment (school_id VARCHAR, amount INTEGER)
Find the number of schools that have more than one donator whose donation amount is less than 8.5.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1) Context: CREATE TABLE endowment (school_id VARCHAR, amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the number of schools that have more than one donator whose donation amount is less than 8.5. The answer to your question is: SELECT COUNT(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING COUNT(*) > 1). [/s>
SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted
CREATE TABLE school (School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR); CREATE TABLE budget (school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR)
List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted Context: CREATE TABLE school (School_name VARCHAR, Mascot VARCHAR, IHSAA_Football_Class VARCHAR, school_id VARCHAR); CREATE TABLE budget (school_id VARCHAR, total_budget_percent_invested VARCHAR, total_budget_percent_budgeted VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget. The answer to your question is: SELECT T1.School_name, T1.Mascot, T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested, T2.total_budget_percent_budgeted. [/s>
SELECT COUNT(*) FROM building
CREATE TABLE building (Id VARCHAR)
How many buildings are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM building Context: CREATE TABLE building (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many buildings are there? The answer to your question is: SELECT COUNT(*) FROM building. [/s>
SELECT name, street_address, floors FROM building ORDER BY floors
CREATE TABLE building (name VARCHAR, street_address VARCHAR, floors VARCHAR)
Show the name, street address, and number of floors for all buildings ordered by the number of floors.
<s>[INST] Given the following SQL query and context: Query: SELECT name, street_address, floors FROM building ORDER BY floors Context: CREATE TABLE building (name VARCHAR, street_address VARCHAR, floors VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name, street address, and number of floors for all buildings ordered by the number of floors. The answer to your question is: SELECT name, street_address, floors FROM building ORDER BY floors. [/s>
SELECT name FROM building ORDER BY height_feet DESC LIMIT 1
CREATE TABLE building (name VARCHAR, height_feet VARCHAR)
What is the name of the tallest building?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1 Context: CREATE TABLE building (name VARCHAR, height_feet VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the tallest building? The answer to your question is: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1. [/s>
SELECT AVG(floors), MAX(floors), MIN(floors) FROM building
CREATE TABLE building (floors INTEGER)
What are the average, maximum, and minimum number of floors for all buildings?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(floors), MAX(floors), MIN(floors) FROM building Context: CREATE TABLE building (floors INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the average, maximum, and minimum number of floors for all buildings? The answer to your question is: SELECT AVG(floors), MAX(floors), MIN(floors) FROM building. [/s>
SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building)
CREATE TABLE building (height_feet INTEGER, floors INTEGER)
Show the number of buildings with a height above the average or a number of floors above the average.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building) Context: CREATE TABLE building (height_feet INTEGER, floors INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the number of buildings with a height above the average or a number of floors above the average. The answer to your question is: SELECT COUNT(*) FROM building WHERE height_feet > (SELECT AVG(height_feet) FROM building) OR floors > (SELECT AVG(floors) FROM building). [/s>
SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20
CREATE TABLE building (name VARCHAR, height_feet VARCHAR, floors VARCHAR)
List the names of buildings with at least 200 feet of height and with at least 20 floors.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20 Context: CREATE TABLE building (name VARCHAR, height_feet VARCHAR, floors VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of buildings with at least 200 feet of height and with at least 20 floors. The answer to your question is: SELECT name FROM building WHERE height_feet >= 200 AND floors >= 20. [/s>
SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'
CREATE TABLE institution (institution VARCHAR, LOCATION VARCHAR, founded VARCHAR, TYPE VARCHAR)
Show the names and locations of institutions that are founded after 1990 and have the type "Private".
<s>[INST] Given the following SQL query and context: Query: SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private' Context: CREATE TABLE institution (institution VARCHAR, LOCATION VARCHAR, founded VARCHAR, TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names and locations of institutions that are founded after 1990 and have the type "Private". The answer to your question is: SELECT institution, LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'. [/s>
SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE
CREATE TABLE institution (TYPE VARCHAR, enrollment INTEGER)
Show institution types, along with the number of institutions and total enrollment for each type.
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE Context: CREATE TABLE institution (TYPE VARCHAR, enrollment INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show institution types, along with the number of institutions and total enrollment for each type. The answer to your question is: SELECT TYPE, COUNT(*), SUM(enrollment) FROM institution GROUP BY TYPE. [/s>
SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE institution (TYPE VARCHAR)
Show the institution type with the largest number of institutions.
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE institution (TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the institution type with the largest number of institutions. The answer to your question is: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000
CREATE TABLE institution (TYPE VARCHAR, founded VARCHAR, enrollment VARCHAR)
Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment.
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000 Context: CREATE TABLE institution (TYPE VARCHAR, founded VARCHAR, enrollment VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. The answer to your question is: SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000. [/s>
SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution)
CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (name VARCHAR, building_id VARCHAR)
Show the name of buildings that do not have any institution.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution) Context: CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (name VARCHAR, building_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of buildings that do not have any institution. The answer to your question is: SELECT name FROM building WHERE NOT building_id IN (SELECT building_id FROM institution). [/s>
SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003
CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE building (name VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded VARCHAR)
Show the names of buildings except for those having an institution founded in 2003.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003 Context: CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE building (name VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of buildings except for those having an institution founded in 2003. The answer to your question is: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003. [/s>
SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id
CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR)
For each building, show the name of the building and the number of institutions in it.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id Context: CREATE TABLE building (name VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each building, show the name of the building and the number of institutions in it. The answer to your question is: SELECT T1.name, COUNT(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id. [/s>
SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2
CREATE TABLE building (name VARCHAR, height_feet VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded INTEGER)
Show the names and heights of buildings with at least two institutions founded after 1880.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2 Context: CREATE TABLE building (name VARCHAR, height_feet VARCHAR, building_id VARCHAR); CREATE TABLE institution (building_id VARCHAR, founded INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the names and heights of buildings with at least two institutions founded after 1880. The answer to your question is: SELECT T1.name, T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT(*) >= 2. [/s>
SELECT DISTINCT TYPE FROM institution
CREATE TABLE institution (TYPE VARCHAR)
Show all the distinct institution types.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT TYPE FROM institution Context: CREATE TABLE institution (TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the distinct institution types. The answer to your question is: SELECT DISTINCT TYPE FROM institution. [/s>
SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id
CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (institution_id VARCHAR)
Show institution names along with the number of proteins for each institution.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id Context: CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (institution_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show institution names along with the number of proteins for each institution. The answer to your question is: SELECT T1.institution, COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id. [/s>
SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'
CREATE TABLE institution (institution_id VARCHAR, founded VARCHAR, type VARCHAR); CREATE TABLE protein (institution_id VARCHAR)
How many proteins are associated with an institution founded after 1880 or an institution with type "Private"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private' Context: CREATE TABLE institution (institution_id VARCHAR, founded VARCHAR, type VARCHAR); CREATE TABLE protein (institution_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? The answer to your question is: SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'. [/s>
SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id
CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (protein_name VARCHAR, institution_id VARCHAR)
Show the protein name and the institution name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id Context: CREATE TABLE institution (institution VARCHAR, institution_id VARCHAR); CREATE TABLE protein (protein_name VARCHAR, institution_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the protein name and the institution name. The answer to your question is: SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id. [/s>
SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20
CREATE TABLE institution (institution_id VARCHAR, building_id VARCHAR); CREATE TABLE building (building_id VARCHAR, floors VARCHAR); CREATE TABLE protein (institution_id VARCHAR)
How many proteins are associated with an institution in a building with at least 20 floors?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20 Context: CREATE TABLE institution (institution_id VARCHAR, building_id VARCHAR); CREATE TABLE building (building_id VARCHAR, floors VARCHAR); CREATE TABLE protein (institution_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many proteins are associated with an institution in a building with at least 20 floors? The answer to your question is: SELECT COUNT(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 20. [/s>
SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein)
CREATE TABLE protein (institution_id VARCHAR); CREATE TABLE institution (institution_id VARCHAR)
How many institutions do not have an associated protein in our record?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein) Context: CREATE TABLE protein (institution_id VARCHAR); CREATE TABLE institution (institution_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many institutions do not have an associated protein in our record? The answer to your question is: SELECT COUNT(*) FROM institution WHERE NOT institution_id IN (SELECT institution_id FROM protein). [/s>
SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800
CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER)
Show all the locations where no cinema has capacity over 800.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800 Context: CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all the locations where no cinema has capacity over 800. The answer to your question is: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800. [/s>
SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011
CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR)
Show all the locations where some cinemas were opened in both year 2010 and year 2011.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011 Context: CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the locations where some cinemas were opened in both year 2010 and year 2011. The answer to your question is: SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011. [/s>
SELECT COUNT(*) FROM cinema
CREATE TABLE cinema (Id VARCHAR)
How many cinema do we have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM cinema Context: CREATE TABLE cinema (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many cinema do we have? The answer to your question is: SELECT COUNT(*) FROM cinema. [/s>
SELECT name, openning_year, capacity FROM cinema
CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR, capacity VARCHAR)
Show name, opening year, and capacity for each cinema.
<s>[INST] Given the following SQL query and context: Query: SELECT name, openning_year, capacity FROM cinema Context: CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR, capacity VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show name, opening year, and capacity for each cinema. The answer to your question is: SELECT name, openning_year, capacity FROM cinema. [/s>
SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema)
CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity INTEGER)
Show the cinema name and location for cinemas with capacity above average.
<s>[INST] Given the following SQL query and context: Query: SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema) Context: CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the cinema name and location for cinemas with capacity above average. The answer to your question is: SELECT name, LOCATION FROM cinema WHERE capacity > (SELECT AVG(capacity) FROM cinema). [/s>
SELECT DISTINCT LOCATION FROM cinema
CREATE TABLE cinema (LOCATION VARCHAR)
What are all the locations with a cinema?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT LOCATION FROM cinema Context: CREATE TABLE cinema (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the locations with a cinema? The answer to your question is: SELECT DISTINCT LOCATION FROM cinema. [/s>
SELECT name, openning_year FROM cinema ORDER BY openning_year DESC
CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR)
Show all the cinema names and opening years in descending order of opening year.
<s>[INST] Given the following SQL query and context: Query: SELECT name, openning_year FROM cinema ORDER BY openning_year DESC Context: CREATE TABLE cinema (name VARCHAR, openning_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the cinema names and opening years in descending order of opening year. The answer to your question is: SELECT name, openning_year FROM cinema ORDER BY openning_year DESC. [/s>
SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity VARCHAR)
What are the name and location of the cinema with the largest capacity?
<s>[INST] Given the following SQL query and context: Query: SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1 Context: CREATE TABLE cinema (name VARCHAR, LOCATION VARCHAR, capacity VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the name and location of the cinema with the largest capacity? The answer to your question is: SELECT name, LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1. [/s>
SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011
CREATE TABLE cinema (capacity INTEGER, openning_year VARCHAR)
Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011 Context: CREATE TABLE cinema (capacity INTEGER, openning_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later. The answer to your question is: SELECT AVG(capacity), MIN(capacity), MAX(capacity) FROM cinema WHERE openning_year >= 2011. [/s>
SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION
CREATE TABLE cinema (LOCATION VARCHAR)
Show each location and the number of cinemas there.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION Context: CREATE TABLE cinema (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show each location and the number of cinemas there. The answer to your question is: SELECT LOCATION, COUNT(*) FROM cinema GROUP BY LOCATION. [/s>
SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR)
What is the location with the most cinemas opened in year 2010 or later?
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE cinema (LOCATION VARCHAR, openning_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the location with the most cinemas opened in year 2010 or later? The answer to your question is: SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2
CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER)
Show all the locations with at least two cinemas with capacity above 300.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2 Context: CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all the locations with at least two cinemas with capacity above 300. The answer to your question is: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) >= 2. [/s>
SELECT title, directed_by FROM film
CREATE TABLE film (title VARCHAR, directed_by VARCHAR)
Show the title and director for all films.
<s>[INST] Given the following SQL query and context: Query: SELECT title, directed_by FROM film Context: CREATE TABLE film (title VARCHAR, directed_by VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the title and director for all films. The answer to your question is: SELECT title, directed_by FROM film. [/s>
SELECT DISTINCT directed_by FROM film
CREATE TABLE film (directed_by VARCHAR)
Show all directors.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT directed_by FROM film Context: CREATE TABLE film (directed_by VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all directors. The answer to your question is: SELECT DISTINCT directed_by FROM film. [/s>
SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by
CREATE TABLE film (directed_by VARCHAR)
List all directors along with the number of films directed by each director.
<s>[INST] Given the following SQL query and context: Query: SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by Context: CREATE TABLE film (directed_by VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all directors along with the number of films directed by each director. The answer to your question is: SELECT directed_by, COUNT(*) FROM film GROUP BY directed_by. [/s>
SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id
CREATE TABLE schedule (show_times_per_day INTEGER, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR)
What is total number of show times per dat for each cinema?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id Context: CREATE TABLE schedule (show_times_per_day INTEGER, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is total number of show times per dat for each cinema? The answer to your question is: SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id. [/s>
SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id
CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE schedule (price INTEGER, film_id VARCHAR)
What are the title and maximum price of each film?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id Context: CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE schedule (price INTEGER, film_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the title and maximum price of each film? The answer to your question is: SELECT T2.title, MAX(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id. [/s>
SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id
CREATE TABLE schedule (date VARCHAR, price VARCHAR, film_id VARCHAR, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR)
Show cinema name, film title, date, and price for each record in schedule.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id Context: CREATE TABLE schedule (date VARCHAR, price VARCHAR, film_id VARCHAR, cinema_id VARCHAR); CREATE TABLE cinema (name VARCHAR, cinema_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show cinema name, film title, date, and price for each record in schedule. The answer to your question is: SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id. [/s>
SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule)
CREATE TABLE schedule (title VARCHAR, directed_by VARCHAR, film_id VARCHAR); CREATE TABLE film (title VARCHAR, directed_by VARCHAR, film_id VARCHAR)
What are the title and director of the films without any schedule?
<s>[INST] Given the following SQL query and context: Query: SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule) Context: CREATE TABLE schedule (title VARCHAR, directed_by VARCHAR, film_id VARCHAR); CREATE TABLE film (title VARCHAR, directed_by VARCHAR, film_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the title and director of the films without any schedule? The answer to your question is: SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule). [/s>
SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1
CREATE TABLE schedule (film_id VARCHAR, show_times_per_day INTEGER); CREATE TABLE film (directed_by VARCHAR, film_id VARCHAR)
Show director with the largest number of show times in total.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1 Context: CREATE TABLE schedule (film_id VARCHAR, show_times_per_day INTEGER); CREATE TABLE film (directed_by VARCHAR, film_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show director with the largest number of show times in total. The answer to your question is: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1. [/s>
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1
CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER)
Find the locations that have more than one movie theater with capacity above 300.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1 Context: CREATE TABLE cinema (LOCATION VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the locations that have more than one movie theater with capacity above 300. The answer to your question is: SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING COUNT(*) > 1. [/s>
SELECT COUNT(*) FROM film WHERE title LIKE "%Dummy%"
CREATE TABLE film (title VARCHAR)
How many films have the word 'Dummy' in their titles?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM film WHERE title LIKE "%Dummy%" Context: CREATE TABLE film (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many films have the word 'Dummy' in their titles? The answer to your question is: SELECT COUNT(*) FROM film WHERE title LIKE "%Dummy%". [/s>
SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500
CREATE TABLE discount_coupons (coupon_id VARCHAR, coupon_amount VARCHAR); CREATE TABLE customers (good_or_bad_customer VARCHAR, coupon_id VARCHAR)
Are the customers holding coupons with amount 500 bad or good?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500 Context: CREATE TABLE discount_coupons (coupon_id VARCHAR, coupon_amount VARCHAR); CREATE TABLE customers (good_or_bad_customer VARCHAR, coupon_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Are the customers holding coupons with amount 500 bad or good? The answer to your question is: SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500. [/s>
SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
CREATE TABLE bookings (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR)
How many bookings did each customer make? List the customer id, first name, and the count.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id Context: CREATE TABLE bookings (customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many bookings did each customer make? List the customer id, first name, and the count. The answer to your question is: SELECT T1.customer_id, T1.first_name, COUNT(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id. [/s>
SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1
CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER)
What is the maximum total amount paid by a customer? List the customer id and amount.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1 Context: CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the maximum total amount paid by a customer? List the customer id and amount. The answer to your question is: SELECT customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1. [/s>
SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Payments (booking_id VARCHAR); CREATE TABLE Bookings (booking_id VARCHAR, amount_of_refund VARCHAR)
What are the id and the amount of refund of the booking that incurred the most times of payments?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Payments (booking_id VARCHAR); CREATE TABLE Bookings (booking_id VARCHAR, amount_of_refund VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the id and the amount of refund of the booking that incurred the most times of payments? The answer to your question is: SELECT T1.booking_id, T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3
CREATE TABLE products_booked (product_id VARCHAR)
What is the id of the product that is booked for 3 times?
<s>[INST] Given the following SQL query and context: Query: SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3 Context: CREATE TABLE products_booked (product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the product that is booked for 3 times? The answer to your question is: SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3. [/s>
SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76
CREATE TABLE products_for_hire (product_description VARCHAR, product_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booked_amount VARCHAR)
What is the product description of the product booked with an amount of 102.76?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76 Context: CREATE TABLE products_for_hire (product_description VARCHAR, product_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booked_amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the product description of the product booked with an amount of 102.76? The answer to your question is: SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76. [/s>
SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'
CREATE TABLE bookings (booking_start_date VARCHAR, booking_end_date VARCHAR, booking_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booking_id VARCHAR); CREATE TABLE Products_for_hire (product_id VARCHAR, product_name VARCHAR)
What are the start date and end date of the booking that has booked the product named 'Book collection A'?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A' Context: CREATE TABLE bookings (booking_start_date VARCHAR, booking_end_date VARCHAR, booking_id VARCHAR); CREATE TABLE products_booked (product_id VARCHAR, booking_id VARCHAR); CREATE TABLE Products_for_hire (product_id VARCHAR, product_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the start date and end date of the booking that has booked the product named 'Book collection A'? The answer to your question is: SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'. [/s>
SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1
CREATE TABLE view_product_availability (product_id VARCHAR, available_yn VARCHAR); CREATE TABLE products_for_hire (product_name VARCHAR, product_id VARCHAR)
What are the names of products whose availability equals to 1?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1 Context: CREATE TABLE view_product_availability (product_id VARCHAR, available_yn VARCHAR); CREATE TABLE products_for_hire (product_name VARCHAR, product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of products whose availability equals to 1? The answer to your question is: SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 1. [/s>
SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire
CREATE TABLE products_for_hire (product_type_code VARCHAR)
How many different product types are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire Context: CREATE TABLE products_for_hire (product_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different product types are there? The answer to your question is: SELECT COUNT(DISTINCT product_type_code) FROM products_for_hire. [/s>
SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name
CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, gender_mf VARCHAR, good_or_bad_customer VARCHAR)
What are the first name, last name, and gender of all the good customers? Order by their last name.
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name Context: CREATE TABLE customers (first_name VARCHAR, last_name VARCHAR, gender_mf VARCHAR, good_or_bad_customer VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the first name, last name, and gender of all the good customers? Order by their last name. The answer to your question is: SELECT first_name, last_name, gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name. [/s>
SELECT AVG(amount_due) FROM payments
CREATE TABLE payments (amount_due INTEGER)
What is the average amount due for all the payments?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(amount_due) FROM payments Context: CREATE TABLE payments (amount_due INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average amount due for all the payments? The answer to your question is: SELECT AVG(amount_due) FROM payments. [/s>
SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked
CREATE TABLE products_booked (booked_count INTEGER)
What are the maximum, minimum, and average booked count for the products booked?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked Context: CREATE TABLE products_booked (booked_count INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the maximum, minimum, and average booked count for the products booked? The answer to your question is: SELECT MAX(booked_count), MIN(booked_count), AVG(booked_count) FROM products_booked. [/s>
SELECT DISTINCT payment_type_code FROM payments
CREATE TABLE payments (payment_type_code VARCHAR)
What are all the distinct payment types?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT payment_type_code FROM payments Context: CREATE TABLE payments (payment_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the distinct payment types? The answer to your question is: SELECT DISTINCT payment_type_code FROM payments. [/s>
SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'
CREATE TABLE Products_for_hire (daily_hire_cost VARCHAR, product_name VARCHAR)
What are the daily hire costs for the products with substring 'Book' in its name?
<s>[INST] Given the following SQL query and context: Query: SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%' Context: CREATE TABLE Products_for_hire (daily_hire_cost VARCHAR, product_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the daily hire costs for the products with substring 'Book' in its name? The answer to your question is: SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'. [/s>
SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200)
CREATE TABLE products_booked (product_id VARCHAR, booked_amount INTEGER); CREATE TABLE Products_for_hire (product_id VARCHAR, booked_amount INTEGER)
How many products are never booked with amount higher than 200?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200) Context: CREATE TABLE products_booked (product_id VARCHAR, booked_amount INTEGER); CREATE TABLE Products_for_hire (product_id VARCHAR, booked_amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many products are never booked with amount higher than 200? The answer to your question is: SELECT COUNT(*) FROM Products_for_hire WHERE NOT product_id IN (SELECT product_id FROM products_booked WHERE booked_amount > 200). [/s>
SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad'
CREATE TABLE Discount_Coupons (coupon_amount VARCHAR, coupon_id VARCHAR); CREATE TABLE customers (coupon_id VARCHAR, good_or_bad_customer VARCHAR)
What are the coupon amount of the coupons owned by both good and bad customers?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad' Context: CREATE TABLE Discount_Coupons (coupon_amount VARCHAR, coupon_id VARCHAR); CREATE TABLE customers (coupon_id VARCHAR, good_or_bad_customer VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the coupon amount of the coupons owned by both good and bad customers? The answer to your question is: SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad'. [/s>
SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
CREATE TABLE payments (payment_date VARCHAR, amount_paid VARCHAR, payment_type_code VARCHAR)
What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check'
<s>[INST] Given the following SQL query and context: Query: SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check' Context: CREATE TABLE payments (payment_date VARCHAR, amount_paid VARCHAR, payment_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check' The answer to your question is: SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'. [/s>
SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20
CREATE TABLE products_for_hire (product_name VARCHAR, product_description VARCHAR, product_type_code VARCHAR, daily_hire_cost VARCHAR)
What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20?
<s>[INST] Given the following SQL query and context: Query: SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20 Context: CREATE TABLE products_for_hire (product_name VARCHAR, product_description VARCHAR, product_type_code VARCHAR, daily_hire_cost VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20? The answer to your question is: SELECT product_name, product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 20. [/s>
SELECT COUNT(*) FROM phone
CREATE TABLE phone (Id VARCHAR)
How many phones are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM phone Context: CREATE TABLE phone (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many phones are there? The answer to your question is: SELECT COUNT(*) FROM phone. [/s>
SELECT Name FROM phone ORDER BY Price
CREATE TABLE phone (Name VARCHAR, Price VARCHAR)
List the names of phones in ascending order of price.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM phone ORDER BY Price Context: CREATE TABLE phone (Name VARCHAR, Price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of phones in ascending order of price. The answer to your question is: SELECT Name FROM phone ORDER BY Price. [/s>
SELECT Memory_in_G, Carrier FROM phone
CREATE TABLE phone (Memory_in_G VARCHAR, Carrier VARCHAR)
What are the memories and carriers of phones?
<s>[INST] Given the following SQL query and context: Query: SELECT Memory_in_G, Carrier FROM phone Context: CREATE TABLE phone (Memory_in_G VARCHAR, Carrier VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the memories and carriers of phones? The answer to your question is: SELECT Memory_in_G, Carrier FROM phone. [/s>
SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32
CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER)
List the distinct carriers of phones with memories bigger than 32.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32 Context: CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the distinct carriers of phones with memories bigger than 32. The answer to your question is: SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32. [/s>
SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile"
CREATE TABLE phone (Name VARCHAR, Carrier VARCHAR)
Show the names of phones with carrier either "Sprint" or "TMobile".
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile" Context: CREATE TABLE phone (Name VARCHAR, Carrier VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of phones with carrier either "Sprint" or "TMobile". The answer to your question is: SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile". [/s>
SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
CREATE TABLE phone (Carrier VARCHAR, Price VARCHAR)
What is the carrier of the most expensive phone?
<s>[INST] Given the following SQL query and context: Query: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1 Context: CREATE TABLE phone (Carrier VARCHAR, Price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the carrier of the most expensive phone? The answer to your question is: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1. [/s>
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier
CREATE TABLE phone (Carrier VARCHAR)
Show different carriers of phones together with the number of phones with each carrier.
<s>[INST] Given the following SQL query and context: Query: SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier Context: CREATE TABLE phone (Carrier VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show different carriers of phones together with the number of phones with each carrier. The answer to your question is: SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier. [/s>
SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE phone (Carrier VARCHAR)
Show the most frequently used carrier of the phones.
<s>[INST] Given the following SQL query and context: Query: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE phone (Carrier VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most frequently used carrier of the phones. The answer to your question is: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64
CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER)
Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
<s>[INST] Given the following SQL query and context: Query: SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64 Context: CREATE TABLE phone (Carrier VARCHAR, Memory_in_G INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64. The answer to your question is: SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64. [/s>
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID
CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE market (District VARCHAR, Market_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR)
Show the names of phones and the districts of markets they are on.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID Context: CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE market (District VARCHAR, Market_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of phones and the districts of markets they are on. The answer to your question is: SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID. [/s>
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking
CREATE TABLE market (District VARCHAR, Market_ID VARCHAR, Ranking VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR)
Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking Context: CREATE TABLE market (District VARCHAR, Market_ID VARCHAR, Ranking VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market. The answer to your question is: SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking. [/s>
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50
CREATE TABLE market (Market_ID VARCHAR, Num_of_shops INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR)
Show the names of phones that are on market with number of shops greater than 50.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50 Context: CREATE TABLE market (Market_ID VARCHAR, Num_of_shops INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Market_ID VARCHAR, Phone_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of phones that are on market with number of shops greater than 50. The answer to your question is: SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50. [/s>
SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name
CREATE TABLE phone_market (Num_of_stock INTEGER, Phone_ID VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR)
For each phone, show its names and total number of stocks.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name Context: CREATE TABLE phone_market (Num_of_stock INTEGER, Phone_ID VARCHAR); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each phone, show its names and total number of stocks. The answer to your question is: SELECT T2.Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name. [/s>
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING SUM(T1.Num_of_stock) >= 2000 ORDER BY SUM(T1.Num_of_stock) DESC
CREATE TABLE phone_market (Phone_ID VARCHAR, Num_of_stock INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR)
Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING SUM(T1.Num_of_stock) >= 2000 ORDER BY SUM(T1.Num_of_stock) DESC Context: CREATE TABLE phone_market (Phone_ID VARCHAR, Num_of_stock INTEGER); CREATE TABLE phone (Name VARCHAR, Phone_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks. The answer to your question is: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING SUM(T1.Num_of_stock) >= 2000 ORDER BY SUM(T1.Num_of_stock) DESC. [/s>
SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market)
CREATE TABLE phone (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR)
List the names of phones that are not on any market.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market) Context: CREATE TABLE phone (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR); CREATE TABLE phone_market (Name VARCHAR, Phone_id VARCHAR, Phone_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of phones that are not on any market. The answer to your question is: SELECT Name FROM phone WHERE NOT Phone_id IN (SELECT Phone_ID FROM phone_market). [/s>
SELECT COUNT(*) FROM company
CREATE TABLE company (Id VARCHAR)
How many gas companies are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM company Context: CREATE TABLE company (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many gas companies are there? The answer to your question is: SELECT COUNT(*) FROM company. [/s>
SELECT company, rank FROM company ORDER BY Sales_billion DESC
CREATE TABLE company (company VARCHAR, rank VARCHAR, Sales_billion VARCHAR)
List the company name and rank for all companies in the decreasing order of their sales.
<s>[INST] Given the following SQL query and context: Query: SELECT company, rank FROM company ORDER BY Sales_billion DESC Context: CREATE TABLE company (company VARCHAR, rank VARCHAR, Sales_billion VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the company name and rank for all companies in the decreasing order of their sales. The answer to your question is: SELECT company, rank FROM company ORDER BY Sales_billion DESC. [/s>
SELECT company, main_industry FROM company WHERE headquarters <> 'USA'
CREATE TABLE company (company VARCHAR, main_industry VARCHAR, headquarters VARCHAR)
Show the company name and the main industry for all companies whose headquarters are not from USA.
<s>[INST] Given the following SQL query and context: Query: SELECT company, main_industry FROM company WHERE headquarters <> 'USA' Context: CREATE TABLE company (company VARCHAR, main_industry VARCHAR, headquarters VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the company name and the main industry for all companies whose headquarters are not from USA. The answer to your question is: SELECT company, main_industry FROM company WHERE headquarters <> 'USA'. [/s>
SELECT company, headquarters FROM company ORDER BY market_value DESC
CREATE TABLE company (company VARCHAR, headquarters VARCHAR, market_value VARCHAR)
Show all company names and headquarters in the descending order of market value.
<s>[INST] Given the following SQL query and context: Query: SELECT company, headquarters FROM company ORDER BY market_value DESC Context: CREATE TABLE company (company VARCHAR, headquarters VARCHAR, market_value VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all company names and headquarters in the descending order of market value. The answer to your question is: SELECT company, headquarters FROM company ORDER BY market_value DESC. [/s>
SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company
CREATE TABLE company (market_value INTEGER)
Show minimum, maximum, and average market value for all companies.
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company Context: CREATE TABLE company (market_value INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show minimum, maximum, and average market value for all companies. The answer to your question is: SELECT MIN(market_value), MAX(market_value), AVG(market_value) FROM company. [/s>
SELECT DISTINCT main_industry FROM company
CREATE TABLE company (main_industry VARCHAR)
Show all main industry for all companies.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT main_industry FROM company Context: CREATE TABLE company (main_industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all main industry for all companies. The answer to your question is: SELECT DISTINCT main_industry FROM company. [/s>
SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters
CREATE TABLE company (headquarters VARCHAR)
List all headquarters and the number of companies in each headquarter.
<s>[INST] Given the following SQL query and context: Query: SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters Context: CREATE TABLE company (headquarters VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all headquarters and the number of companies in each headquarter. The answer to your question is: SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters. [/s>
SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry
CREATE TABLE company (main_industry VARCHAR, market_value INTEGER)
Show all main industry and total market value in each industry.
<s>[INST] Given the following SQL query and context: Query: SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry Context: CREATE TABLE company (main_industry VARCHAR, market_value INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all main industry and total market value in each industry. The answer to your question is: SELECT main_industry, SUM(market_value) FROM company GROUP BY main_industry. [/s>
SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1
CREATE TABLE company (main_industry VARCHAR, market_value INTEGER)
List the main industry with highest total market value and its number of companies.
<s>[INST] Given the following SQL query and context: Query: SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1 Context: CREATE TABLE company (main_industry VARCHAR, market_value INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the main industry with highest total market value and its number of companies. The answer to your question is: SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1. [/s>
SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2
CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)
Show headquarters with at least two companies in the banking industry.
<s>[INST] Given the following SQL query and context: Query: SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2 Context: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show headquarters with at least two companies in the banking industry. The answer to your question is: SELECT headquarters FROM company WHERE main_industry = 'Banking' GROUP BY headquarters HAVING COUNT(*) >= 2. [/s>