answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE storm (name VARCHAR, max_speed VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR)
What is the storm name and max speed which affected the greatest number of regions?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE storm (name VARCHAR, max_speed VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the storm name and max speed which affected the greatest number of regions? The answer to your question is: SELECT T1.name, T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region)
CREATE TABLE affected_region (name VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)
Show the name of storms which don't have affected region in record.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region) Context: CREATE TABLE affected_region (name VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of storms which don't have affected region in record. The answer to your question is: SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region). [/s>
SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10
CREATE TABLE affected_region (storm_id VARCHAR, number_city_affected INTEGER); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)
Show storm name with at least two regions and 10 cities affected.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10 Context: CREATE TABLE affected_region (storm_id VARCHAR, number_city_affected INTEGER); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show storm name with at least two regions and 10 cities affected. The answer to your question is: SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 INTERSECT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING SUM(T2.number_city_affected) >= 10. [/s>
SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2
CREATE TABLE storm (name VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)
Show all storm names except for those with at least two affected regions.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 Context: CREATE TABLE storm (name VARCHAR); CREATE TABLE affected_region (storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all storm names except for those with at least two affected regions. The answer to your question is: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2. [/s>
SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10
CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, number_deaths VARCHAR)
What are the region names affected by the storm with a number of deaths of least 10?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10 Context: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, number_deaths VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the region names affected by the storm with a number of deaths of least 10? The answer to your question is: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10. [/s>
SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'
CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR)
Show all storm names affecting region "Denmark".
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark' Context: CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (name VARCHAR, storm_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all storm names affecting region "Denmark". The answer to your question is: SELECT T3.name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.region_name = 'Denmark'. [/s>
SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2
CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR)
Show the region name with at least two storms.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2 Context: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the region name with at least two storms. The answer to your question is: SELECT T1.region_name FROM region AS T1 JOIN affected_region AS T2 ON T1.region_id = T2.region_id GROUP BY T1.region_id HAVING COUNT(*) >= 2. [/s>
SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1
CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, Number_Deaths VARCHAR)
Find the names of the regions which were affected by the storm that killed the greatest number of people.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1 Context: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE storm (storm_id VARCHAR, Number_Deaths VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of the regions which were affected by the storm that killed the greatest number of people. The answer to your question is: SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id ORDER BY T3.Number_Deaths DESC LIMIT 1. [/s>
SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'
CREATE TABLE storm (Name VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE region (region_id VARCHAR, Region_name VARCHAR)
Find the name of the storm that affected both Afghanistan and Albania regions.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania' Context: CREATE TABLE storm (Name VARCHAR, storm_id VARCHAR); CREATE TABLE affected_region (region_id VARCHAR, storm_id VARCHAR); CREATE TABLE region (region_id VARCHAR, Region_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the storm that affected both Afghanistan and Albania regions. The answer to your question is: SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Afghanistan' INTERSECT SELECT T3.Name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T2.Region_name = 'Albania'. [/s>
SELECT COUNT(*) FROM county
CREATE TABLE county (Id VARCHAR)
How many counties are there in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM county Context: CREATE TABLE county (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many counties are there in total? The answer to your question is: SELECT COUNT(*) FROM county. [/s>
SELECT County_name, Population FROM county
CREATE TABLE county (County_name VARCHAR, Population VARCHAR)
Show the county name and population of all counties.
<s>[INST] Given the following SQL query and context: Query: SELECT County_name, Population FROM county Context: CREATE TABLE county (County_name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the county name and population of all counties. The answer to your question is: SELECT County_name, Population FROM county. [/s>
SELECT AVG(Population) FROM county
CREATE TABLE county (Population INTEGER)
Show the average population of all counties.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Population) FROM county Context: CREATE TABLE county (Population INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the average population of all counties. The answer to your question is: SELECT AVG(Population) FROM county. [/s>
SELECT MAX(Population), MIN(Population) FROM county
CREATE TABLE county (Population INTEGER)
Return the maximum and minimum population among all counties.
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Population), MIN(Population) FROM county Context: CREATE TABLE county (Population INTEGER) [/INST] Based on the provided SQL query and context, your question is: Return the maximum and minimum population among all counties. The answer to your question is: SELECT MAX(Population), MIN(Population) FROM county. [/s>
SELECT DISTINCT District FROM election
CREATE TABLE election (District VARCHAR)
Show all the distinct districts for elections.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT District FROM election Context: CREATE TABLE election (District VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the distinct districts for elections. The answer to your question is: SELECT DISTINCT District FROM election. [/s>
SELECT Zip_code FROM county WHERE County_name = "Howard"
CREATE TABLE county (Zip_code VARCHAR, County_name VARCHAR)
Show the zip code of the county with name "Howard".
<s>[INST] Given the following SQL query and context: Query: SELECT Zip_code FROM county WHERE County_name = "Howard" Context: CREATE TABLE county (Zip_code VARCHAR, County_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the zip code of the county with name "Howard". The answer to your question is: SELECT Zip_code FROM county WHERE County_name = "Howard". [/s>
SELECT Delegate FROM election WHERE District = 1
CREATE TABLE election (Delegate VARCHAR, District VARCHAR)
Show the delegate from district 1 in election.
<s>[INST] Given the following SQL query and context: Query: SELECT Delegate FROM election WHERE District = 1 Context: CREATE TABLE election (Delegate VARCHAR, District VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the delegate from district 1 in election. The answer to your question is: SELECT Delegate FROM election WHERE District = 1. [/s>
SELECT Delegate, Committee FROM election
CREATE TABLE election (Delegate VARCHAR, Committee VARCHAR)
Show the delegate and committee information of elections.
<s>[INST] Given the following SQL query and context: Query: SELECT Delegate, Committee FROM election Context: CREATE TABLE election (Delegate VARCHAR, Committee VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the delegate and committee information of elections. The answer to your question is: SELECT Delegate, Committee FROM election. [/s>
SELECT COUNT(DISTINCT Governor) FROM party
CREATE TABLE party (Governor VARCHAR)
How many distinct governors are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT Governor) FROM party Context: CREATE TABLE party (Governor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many distinct governors are there? The answer to your question is: SELECT COUNT(DISTINCT Governor) FROM party. [/s>
SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = "Democratic"
CREATE TABLE party (Lieutenant_Governor VARCHAR, Comptroller VARCHAR, Party VARCHAR)
Show the lieutenant governor and comptroller from the democratic party.
<s>[INST] Given the following SQL query and context: Query: SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = "Democratic" Context: CREATE TABLE party (Lieutenant_Governor VARCHAR, Comptroller VARCHAR, Party VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the lieutenant governor and comptroller from the democratic party. The answer to your question is: SELECT Lieutenant_Governor, Comptroller FROM party WHERE Party = "Democratic". [/s>
SELECT DISTINCT YEAR FROM party WHERE Governor = "Eliot Spitzer"
CREATE TABLE party (YEAR VARCHAR, Governor VARCHAR)
In which distinct years was the governor "Eliot Spitzer"?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT YEAR FROM party WHERE Governor = "Eliot Spitzer" Context: CREATE TABLE party (YEAR VARCHAR, Governor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: In which distinct years was the governor "Eliot Spitzer"? The answer to your question is: SELECT DISTINCT YEAR FROM party WHERE Governor = "Eliot Spitzer". [/s>
SELECT * FROM election
CREATE TABLE election (Id VARCHAR)
Show all the information about election.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM election Context: CREATE TABLE election (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all the information about election. The answer to your question is: SELECT * FROM election. [/s>
SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District
CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)
Show the delegates and the names of county they belong to.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District Context: CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the delegates and the names of county they belong to. The answer to your question is: SELECT T2.Delegate, T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District. [/s>
SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000
CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER)
Which delegates are from counties with population smaller than 100000?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000 Context: CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER) [/INST] Based on the provided SQL query and context, your question is: Which delegates are from counties with population smaller than 100000? The answer to your question is: SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000. [/s>
SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000
CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER)
How many distinct delegates are from counties with population larger than 50000?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 Context: CREATE TABLE election (Delegate VARCHAR, District VARCHAR); CREATE TABLE county (County_id VARCHAR, Population INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many distinct delegates are from counties with population larger than 50000? The answer to your question is: SELECT COUNT(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000. [/s>
SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = "Appropriations"
CREATE TABLE election (District VARCHAR, Committee VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)
What are the names of the county that the delegates on "Appropriations" committee belong to?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = "Appropriations" Context: CREATE TABLE election (District VARCHAR, Committee VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the county that the delegates on "Appropriations" committee belong to? The answer to your question is: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = "Appropriations". [/s>
SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID
CREATE TABLE election (Delegate VARCHAR, Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
Show the delegates and the names of the party they belong to.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID Context: CREATE TABLE election (Delegate VARCHAR, Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the delegates and the names of the party they belong to. The answer to your question is: SELECT T1.Delegate, T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID. [/s>
SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1
CREATE TABLE party (Governor VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR)
Who were the governors of the parties associated with delegates from district 1?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 Context: CREATE TABLE party (Governor VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who were the governors of the parties associated with delegates from district 1? The answer to your question is: SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1. [/s>
SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2
CREATE TABLE party (Comptroller VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR)
Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 Context: CREATE TABLE party (Comptroller VARCHAR, Party_ID VARCHAR); CREATE TABLE election (Party VARCHAR, District VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who were the comptrollers of the parties associated with the delegates from district 1 or district 2? The answer to your question is: SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2. [/s>
SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic"
CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR)
Return all the committees that have delegates from Democratic party.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" Context: CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return all the committees that have delegates from Democratic party. The answer to your question is: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic". [/s>
SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id
CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)
Show the name of each county along with the corresponding number of delegates from that county.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id Context: CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of each county along with the corresponding number of delegates from that county. The answer to your question is: SELECT T1.County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id. [/s>
SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party
CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
Show the name of each party and the corresponding number of delegates from that party.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party Context: CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of each party and the corresponding number of delegates from that party. The answer to your question is: SELECT T2.Party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party. [/s>
SELECT County_name FROM county ORDER BY Population
CREATE TABLE county (County_name VARCHAR, Population VARCHAR)
Return the names of all counties sorted by population in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT County_name FROM county ORDER BY Population Context: CREATE TABLE county (County_name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the names of all counties sorted by population in ascending order. The answer to your question is: SELECT County_name FROM county ORDER BY Population. [/s>
SELECT County_name FROM county ORDER BY County_name DESC
CREATE TABLE county (County_name VARCHAR)
Return the names of all counties sorted by county name in descending alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT County_name FROM county ORDER BY County_name DESC Context: CREATE TABLE county (County_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the names of all counties sorted by county name in descending alphabetical order. The answer to your question is: SELECT County_name FROM county ORDER BY County_name DESC. [/s>
SELECT County_name FROM county ORDER BY Population DESC LIMIT 1
CREATE TABLE county (County_name VARCHAR, Population VARCHAR)
Show the name of the county with the biggest population.
<s>[INST] Given the following SQL query and context: Query: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1 Context: CREATE TABLE county (County_name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of the county with the biggest population. The answer to your question is: SELECT County_name FROM county ORDER BY Population DESC LIMIT 1. [/s>
SELECT County_name FROM county ORDER BY Population LIMIT 3
CREATE TABLE county (County_name VARCHAR, Population VARCHAR)
Show the 3 counties with the smallest population.
<s>[INST] Given the following SQL query and context: Query: SELECT County_name FROM county ORDER BY Population LIMIT 3 Context: CREATE TABLE county (County_name VARCHAR, Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the 3 counties with the smallest population. The answer to your question is: SELECT County_name FROM county ORDER BY Population LIMIT 3. [/s>
SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2
CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR)
Show the names of counties that have at least two delegates.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2 Context: CREATE TABLE election (District VARCHAR); CREATE TABLE county (County_name VARCHAR, County_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of counties that have at least two delegates. The answer to your question is: SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2. [/s>
SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2
CREATE TABLE party (Party VARCHAR)
Show the name of the party that has at least two records.
<s>[INST] Given the following SQL query and context: Query: SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2 Context: CREATE TABLE party (Party VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of the party that has at least two records. The answer to your question is: SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2. [/s>
SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
Show the name of the party that has the most delegates.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE election (Party VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of the party that has the most delegates. The answer to your question is: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE party (Governor VARCHAR)
Show the people that have been governor the most times.
<s>[INST] Given the following SQL query and context: Query: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE party (Governor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the people that have been governor the most times. The answer to your question is: SELECT Governor FROM party GROUP BY Governor ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE party (Comptroller VARCHAR)
Show the people that have been comptroller the most times and the corresponding number of times.
<s>[INST] Given the following SQL query and context: Query: SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE party (Comptroller VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the people that have been comptroller the most times and the corresponding number of times. The answer to your question is: SELECT Comptroller, COUNT(*) FROM party GROUP BY Comptroller ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election)
CREATE TABLE election (Party VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
What are the names of parties that do not have delegates in election?
<s>[INST] Given the following SQL query and context: Query: SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election) Context: CREATE TABLE election (Party VARCHAR, Party_ID VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of parties that do not have delegates in election? The answer to your question is: SELECT Party FROM party WHERE NOT Party_ID IN (SELECT Party FROM election). [/s>
SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters"
CREATE TABLE election (Party VARCHAR, Committee VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR)
What are the names of parties that have both delegates on "Appropriations" committee and
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters" Context: CREATE TABLE election (Party VARCHAR, Committee VARCHAR); CREATE TABLE party (Party VARCHAR, Party_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of parties that have both delegates on "Appropriations" committee and The answer to your question is: SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Appropriations" INTERSECT SELECT T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.Committee = "Economic Matters". [/s>
SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal"
CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR)
Which committees have delegates from both democratic party and liberal party?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal" Context: CREATE TABLE election (Committee VARCHAR, Party VARCHAR); CREATE TABLE party (Party_ID VARCHAR, Party VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which committees have delegates from both democratic party and liberal party? The answer to your question is: SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" INTERSECT SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal". [/s>
SELECT COUNT(*) FROM journalist
CREATE TABLE journalist (Id VARCHAR)
How many journalists are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM journalist Context: CREATE TABLE journalist (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many journalists are there? The answer to your question is: SELECT COUNT(*) FROM journalist. [/s>
SELECT Name FROM journalist ORDER BY Years_working
CREATE TABLE journalist (Name VARCHAR, Years_working VARCHAR)
List the names of journalists in ascending order of years working.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM journalist ORDER BY Years_working Context: CREATE TABLE journalist (Name VARCHAR, Years_working VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of journalists in ascending order of years working. The answer to your question is: SELECT Name FROM journalist ORDER BY Years_working. [/s>
SELECT Nationality, Age FROM journalist
CREATE TABLE journalist (Nationality VARCHAR, Age VARCHAR)
What are the nationalities and ages of journalists?
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality, Age FROM journalist Context: CREATE TABLE journalist (Nationality VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the nationalities and ages of journalists? The answer to your question is: SELECT Nationality, Age FROM journalist. [/s>
SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales"
CREATE TABLE journalist (Name VARCHAR, Nationality VARCHAR)
Show the names of journalists from "England" or "Wales".
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales" Context: CREATE TABLE journalist (Name VARCHAR, Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of journalists from "England" or "Wales". The answer to your question is: SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales". [/s>
SELECT AVG(Years_working) FROM journalist
CREATE TABLE journalist (Years_working INTEGER)
What is the average number of years spent working as a journalist?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Years_working) FROM journalist Context: CREATE TABLE journalist (Years_working INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average number of years spent working as a journalist? The answer to your question is: SELECT AVG(Years_working) FROM journalist. [/s>
SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1
CREATE TABLE journalist (Nationality VARCHAR, Years_working VARCHAR)
What is the nationality of the journalist with the largest number of years working?
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1 Context: CREATE TABLE journalist (Nationality VARCHAR, Years_working VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the nationality of the journalist with the largest number of years working? The answer to your question is: SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1. [/s>
SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality
CREATE TABLE journalist (Nationality VARCHAR)
Show the different nationalities and the number of journalists of each nationality.
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality Context: CREATE TABLE journalist (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the different nationalities and the number of journalists of each nationality. The answer to your question is: SELECT Nationality, COUNT(*) FROM journalist GROUP BY Nationality. [/s>
SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE journalist (Nationality VARCHAR)
Show the most common nationality for journalists.
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE journalist (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common nationality for journalists. The answer to your question is: SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3
CREATE TABLE journalist (Nationality VARCHAR, Years_working INTEGER)
Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3 Context: CREATE TABLE journalist (Nationality VARCHAR, Years_working INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working. The answer to your question is: SELECT Nationality FROM journalist WHERE Years_working > 10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working < 3. [/s>
SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC
CREATE TABLE event (Date VARCHAR, Name VARCHAR, venue VARCHAR, Event_Attendance VARCHAR)
Show the dates, places, and names of events in descending order of the attendance.
<s>[INST] Given the following SQL query and context: Query: SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC Context: CREATE TABLE event (Date VARCHAR, Name VARCHAR, venue VARCHAR, Event_Attendance VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the dates, places, and names of events in descending order of the attendance. The answer to your question is: SELECT Date, Name, venue FROM event ORDER BY Event_Attendance DESC. [/s>
SELECT T3.Name, T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Date VARCHAR, Event_ID VARCHAR)
Show the names of journalists and the dates of the events they reported.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name, T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID Context: CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Date VARCHAR, Event_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of journalists and the dates of the events they reported. The answer to your question is: SELECT T3.Name, T2.Date FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID. [/s>
SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Name VARCHAR, Event_ID VARCHAR, Event_Attendance VARCHAR)
Show the names of journalists and the names of the events they reported in ascending order
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance Context: CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Name VARCHAR, Event_ID VARCHAR, Event_Attendance VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of journalists and the names of the events they reported in ascending order The answer to your question is: SELECT T3.Name, T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance. [/s>
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR)
Show the names of journalists and the number of events they reported.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name Context: CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of journalists and the number of events they reported. The answer to your question is: SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name. [/s>
SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR)
Show the names of journalists that have reported more than one event.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1 Context: CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Event_ID VARCHAR, journalist_ID VARCHAR); CREATE TABLE event (Event_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of journalists that have reported more than one event. The answer to your question is: SELECT T3.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name HAVING COUNT(*) > 1. [/s>
SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report)
CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Name VARCHAR, journalist_ID VARCHAR)
List the names of journalists who have not reported any event.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report) Context: CREATE TABLE journalist (Name VARCHAR, journalist_ID VARCHAR); CREATE TABLE news_report (Name VARCHAR, journalist_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of journalists who have not reported any event. The answer to your question is: SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report). [/s>
SELECT AVG(Event_Attendance), MAX(Event_Attendance) FROM event
CREATE TABLE event (Event_Attendance INTEGER)
what are the average and maximum attendances of all events?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Event_Attendance), MAX(Event_Attendance) FROM event Context: CREATE TABLE event (Event_Attendance INTEGER) [/INST] Based on the provided SQL query and context, your question is: what are the average and maximum attendances of all events? The answer to your question is: SELECT AVG(Event_Attendance), MAX(Event_Attendance) FROM event. [/s>
SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type
CREATE TABLE news_report (work_type VARCHAR, journalist_id VARCHAR); CREATE TABLE journalist (age INTEGER, journalist_id VARCHAR)
Find the average age and experience working length of journalists working on different role type.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type Context: CREATE TABLE news_report (work_type VARCHAR, journalist_id VARCHAR); CREATE TABLE journalist (age INTEGER, journalist_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the average age and experience working length of journalists working on different role type. The answer to your question is: SELECT AVG(t1.age), AVG(Years_working), t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type. [/s>
SELECT venue, name FROM event ORDER BY Event_Attendance DESC LIMIT 2
CREATE TABLE event (venue VARCHAR, name VARCHAR, Event_Attendance VARCHAR)
List the event venues and names that have the top 2 most number of people attended.
<s>[INST] Given the following SQL query and context: Query: SELECT venue, name FROM event ORDER BY Event_Attendance DESC LIMIT 2 Context: CREATE TABLE event (venue VARCHAR, name VARCHAR, Event_Attendance VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the event venues and names that have the top 2 most number of people attended. The answer to your question is: SELECT venue, name FROM event ORDER BY Event_Attendance DESC LIMIT 2. [/s>
SELECT ResName FROM Restaurant
CREATE TABLE Restaurant (ResName VARCHAR)
Show me all the restaurants.
<s>[INST] Given the following SQL query and context: Query: SELECT ResName FROM Restaurant Context: CREATE TABLE Restaurant (ResName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show me all the restaurants. The answer to your question is: SELECT ResName FROM Restaurant. [/s>
SELECT Address FROM Restaurant WHERE ResName = "Subway"
CREATE TABLE Restaurant (Address VARCHAR, ResName VARCHAR)
What is the address of the restaurant Subway?
<s>[INST] Given the following SQL query and context: Query: SELECT Address FROM Restaurant WHERE ResName = "Subway" Context: CREATE TABLE Restaurant (Address VARCHAR, ResName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the address of the restaurant Subway? The answer to your question is: SELECT Address FROM Restaurant WHERE ResName = "Subway". [/s>
SELECT Rating FROM Restaurant WHERE ResName = "Subway"
CREATE TABLE Restaurant (Rating VARCHAR, ResName VARCHAR)
What is the rating of the restaurant Subway?
<s>[INST] Given the following SQL query and context: Query: SELECT Rating FROM Restaurant WHERE ResName = "Subway" Context: CREATE TABLE Restaurant (Rating VARCHAR, ResName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the rating of the restaurant Subway? The answer to your question is: SELECT Rating FROM Restaurant WHERE ResName = "Subway". [/s>
SELECT ResTypeName FROM Restaurant_Type
CREATE TABLE Restaurant_Type (ResTypeName VARCHAR)
List all restaurant types.
<s>[INST] Given the following SQL query and context: Query: SELECT ResTypeName FROM Restaurant_Type Context: CREATE TABLE Restaurant_Type (ResTypeName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all restaurant types. The answer to your question is: SELECT ResTypeName FROM Restaurant_Type. [/s>
SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = "Sandwich"
CREATE TABLE Restaurant_Type (ResTypeDescription VARCHAR, ResTypeName VARCHAR)
What is the description of the restaurant type Sandwich?
<s>[INST] Given the following SQL query and context: Query: SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = "Sandwich" Context: CREATE TABLE Restaurant_Type (ResTypeDescription VARCHAR, ResTypeName VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the description of the restaurant type Sandwich? The answer to your question is: SELECT ResTypeDescription FROM Restaurant_Type WHERE ResTypeName = "Sandwich". [/s>
SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1
CREATE TABLE Restaurant (ResName VARCHAR, Rating VARCHAR)
Which restaurants have highest rating? List the restaurant name and its rating.
<s>[INST] Given the following SQL query and context: Query: SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1 Context: CREATE TABLE Restaurant (ResName VARCHAR, Rating VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which restaurants have highest rating? List the restaurant name and its rating. The answer to your question is: SELECT ResName, Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1. [/s>
SELECT Age FROM Student WHERE Fname = "Linda" AND Lname = "Smith"
CREATE TABLE Student (Age VARCHAR, Fname VARCHAR, Lname VARCHAR)
What is the age of student Linda Smith?
<s>[INST] Given the following SQL query and context: Query: SELECT Age FROM Student WHERE Fname = "Linda" AND Lname = "Smith" Context: CREATE TABLE Student (Age VARCHAR, Fname VARCHAR, Lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the age of student Linda Smith? The answer to your question is: SELECT Age FROM Student WHERE Fname = "Linda" AND Lname = "Smith". [/s>
SELECT Sex FROM Student WHERE Fname = "Linda" AND Lname = "Smith"
CREATE TABLE Student (Sex VARCHAR, Fname VARCHAR, Lname VARCHAR)
What is the gender of the student Linda Smith?
<s>[INST] Given the following SQL query and context: Query: SELECT Sex FROM Student WHERE Fname = "Linda" AND Lname = "Smith" Context: CREATE TABLE Student (Sex VARCHAR, Fname VARCHAR, Lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the gender of the student Linda Smith? The answer to your question is: SELECT Sex FROM Student WHERE Fname = "Linda" AND Lname = "Smith". [/s>
SELECT Fname, Lname FROM Student WHERE Major = 600
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Major VARCHAR)
List all students' first names and last names who majored in 600.
<s>[INST] Given the following SQL query and context: Query: SELECT Fname, Lname FROM Student WHERE Major = 600 Context: CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all students' first names and last names who majored in 600. The answer to your question is: SELECT Fname, Lname FROM Student WHERE Major = 600. [/s>
SELECT city_code FROM Student WHERE Fname = "Linda" AND Lname = "Smith"
CREATE TABLE Student (city_code VARCHAR, Fname VARCHAR, Lname VARCHAR)
Which city does student Linda Smith live in?
<s>[INST] Given the following SQL query and context: Query: SELECT city_code FROM Student WHERE Fname = "Linda" AND Lname = "Smith" Context: CREATE TABLE Student (city_code VARCHAR, Fname VARCHAR, Lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which city does student Linda Smith live in? The answer to your question is: SELECT city_code FROM Student WHERE Fname = "Linda" AND Lname = "Smith". [/s>
SELECT COUNT(*) FROM Student WHERE Advisor = 1121
CREATE TABLE Student (Advisor VARCHAR)
Advisor 1121 has how many students?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Student WHERE Advisor = 1121 Context: CREATE TABLE Student (Advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Advisor 1121 has how many students? The answer to your question is: SELECT COUNT(*) FROM Student WHERE Advisor = 1121. [/s>
SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1
CREATE TABLE Student (Advisor VARCHAR)
Which Advisor has most of students? List advisor and the number of students.
<s>[INST] Given the following SQL query and context: Query: SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1 Context: CREATE TABLE Student (Advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which Advisor has most of students? List advisor and the number of students. The answer to your question is: SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor ORDER BY COUNT(Advisor) DESC LIMIT 1. [/s>
SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) LIMIT 1
CREATE TABLE Student (Major VARCHAR)
Which major has least number of students? List the major and the number of students.
<s>[INST] Given the following SQL query and context: Query: SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) LIMIT 1 Context: CREATE TABLE Student (Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which major has least number of students? List the major and the number of students. The answer to your question is: SELECT Major, COUNT(*) FROM Student GROUP BY Major ORDER BY COUNT(Major) LIMIT 1. [/s>
SELECT Major, COUNT(*) FROM Student GROUP BY Major HAVING COUNT(Major) BETWEEN 2 AND 30
CREATE TABLE Student (Major VARCHAR)
Which major has between 2 and 30 number of students? List major and the number of students.
<s>[INST] Given the following SQL query and context: Query: SELECT Major, COUNT(*) FROM Student GROUP BY Major HAVING COUNT(Major) BETWEEN 2 AND 30 Context: CREATE TABLE Student (Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which major has between 2 and 30 number of students? List major and the number of students. The answer to your question is: SELECT Major, COUNT(*) FROM Student GROUP BY Major HAVING COUNT(Major) BETWEEN 2 AND 30. [/s>
SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Major VARCHAR)
Which student's age is older than 18 and is majoring in 600? List each student's first and last name.
<s>[INST] Given the following SQL query and context: Query: SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600 Context: CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which student's age is older than 18 and is majoring in 600? List each student's first and last name. The answer to your question is: SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major = 600. [/s>
SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F'
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Sex VARCHAR, Age VARCHAR, Major VARCHAR)
List all female students age is older than 18 who is not majoring in 600. List students' first name and last name.
<s>[INST] Given the following SQL query and context: Query: SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F' Context: CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Sex VARCHAR, Age VARCHAR, Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all female students age is older than 18 who is not majoring in 600. List students' first name and last name. The answer to your question is: SELECT Fname, Lname FROM Student WHERE Age > 18 AND Major <> 600 AND Sex = 'F'. [/s>
SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'
CREATE TABLE Type_Of_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR); CREATE TABLE Restaurant_Type (Id VARCHAR)
How many restaurant is the Sandwich type restaurant?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich' Context: CREATE TABLE Type_Of_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR); CREATE TABLE Restaurant_Type (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many restaurant is the Sandwich type restaurant? The answer to your question is: SELECT COUNT(*) FROM Restaurant JOIN Type_Of_Restaurant ON Restaurant.ResID = Type_Of_Restaurant.ResID JOIN Restaurant_Type ON Type_Of_Restaurant.ResTypeID = Restaurant_Type.ResTypeID GROUP BY Type_Of_Restaurant.ResTypeID HAVING Restaurant_Type.ResTypeName = 'Sandwich'. [/s>
SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith"
CREATE TABLE Visits_Restaurant (Spent INTEGER); CREATE TABLE Student (Spent INTEGER)
How long does student Linda Smith spend on the restaurant in total?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" Context: CREATE TABLE Visits_Restaurant (Spent INTEGER); CREATE TABLE Student (Spent INTEGER) [/INST] Based on the provided SQL query and context, your question is: How long does student Linda Smith spend on the restaurant in total? The answer to your question is: SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith". [/s>
SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR)
How many times has the student Linda Smith visited Subway?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway" Context: CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many times has the student Linda Smith visited Subway? The answer to your question is: SELECT COUNT(*) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway". [/s>
SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway"
CREATE TABLE Restaurant (TIME VARCHAR); CREATE TABLE Visits_Restaurant (TIME VARCHAR); CREATE TABLE Student (TIME VARCHAR)
When did Linda Smith visit Subway?
<s>[INST] Given the following SQL query and context: Query: SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway" Context: CREATE TABLE Restaurant (TIME VARCHAR); CREATE TABLE Visits_Restaurant (TIME VARCHAR); CREATE TABLE Student (TIME VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When did Linda Smith visit Subway? The answer to your question is: SELECT TIME FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" AND Restaurant.ResName = "Subway". [/s>
SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1
CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR)
At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total.
<s>[INST] Given the following SQL query and context: Query: SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1 Context: CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Restaurant (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total. The answer to your question is: SELECT Restaurant.ResName, SUM(Visits_Restaurant.Spent) FROM Visits_Restaurant JOIN Restaurant ON Visits_Restaurant.ResID = Restaurant.ResID GROUP BY Restaurant.ResID ORDER BY SUM(Visits_Restaurant.Spent) LIMIT 1. [/s>
SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR)
Which student visited restaurant most often? List student's first name and last name.
<s>[INST] Given the following SQL query and context: Query: SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Visits_Restaurant (Id VARCHAR); CREATE TABLE Student (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which student visited restaurant most often? List student's first name and last name. The answer to your question is: SELECT Student.Fname, Student.Lname FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID GROUP BY Student.StuID ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success'
CREATE TABLE actual_orders (actual_order_id VARCHAR, order_status_code VARCHAR)
Find the ids of orders whose status is 'Success'.
<s>[INST] Given the following SQL query and context: Query: SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success' Context: CREATE TABLE actual_orders (actual_order_id VARCHAR, order_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the ids of orders whose status is 'Success'. The answer to your question is: SELECT actual_order_id FROM actual_orders WHERE order_status_code = 'Success'. [/s>
SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE products (product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE regular_order_products (product_id VARCHAR)
Find the name and price of the product that has been ordered the greatest number of times.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE products (product_name VARCHAR, product_price VARCHAR, product_id VARCHAR); CREATE TABLE regular_order_products (product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and price of the product that has been ordered the greatest number of times. The answer to your question is: SELECT t1.product_name, t1.product_price FROM products AS t1 JOIN regular_order_products AS t2 ON t1.product_id = t2.product_id GROUP BY t2.product_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT COUNT(*) FROM customers
CREATE TABLE customers (Id VARCHAR)
Find the number of customers in total.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM customers Context: CREATE TABLE customers (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of customers in total. The answer to your question is: SELECT COUNT(*) FROM customers. [/s>
SELECT COUNT(DISTINCT payment_method) FROM customers
CREATE TABLE customers (payment_method VARCHAR)
How many different payment methods are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT payment_method) FROM customers Context: CREATE TABLE customers (payment_method VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different payment methods are there? The answer to your question is: SELECT COUNT(DISTINCT payment_method) FROM customers. [/s>
SELECT truck_details FROM trucks ORDER BY truck_licence_number
CREATE TABLE trucks (truck_details VARCHAR, truck_licence_number VARCHAR)
Show the details of all trucks in the order of their license number.
<s>[INST] Given the following SQL query and context: Query: SELECT truck_details FROM trucks ORDER BY truck_licence_number Context: CREATE TABLE trucks (truck_details VARCHAR, truck_licence_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the details of all trucks in the order of their license number. The answer to your question is: SELECT truck_details FROM trucks ORDER BY truck_licence_number. [/s>
SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1
CREATE TABLE products (product_name VARCHAR, product_price VARCHAR)
Find the name of the most expensive product.
<s>[INST] Given the following SQL query and context: Query: SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1 Context: CREATE TABLE products (product_name VARCHAR, product_price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the most expensive product. The answer to your question is: SELECT product_name FROM products ORDER BY product_price DESC LIMIT 1. [/s>
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)
Find the names of customers who are not living in the state of California.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' Context: CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of customers who are not living in the state of California. The answer to your question is: SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'. [/s>
SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa'
CREATE TABLE customers (customer_email VARCHAR, customer_name VARCHAR, payment_method VARCHAR)
List the names and emails of customers who payed by Visa card.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa' Context: CREATE TABLE customers (customer_email VARCHAR, customer_name VARCHAR, payment_method VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names and emails of customers who payed by Visa card. The answer to your question is: SELECT customer_email, customer_name FROM customers WHERE payment_method = 'Visa'. [/s>
SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)
Find the names and phone numbers of customers living in California state.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California' Context: CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names and phone numbers of customers living in California state. The answer to your question is: SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'. [/s>
SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees)
CREATE TABLE Employees (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR)
Find the states which do not have any employee in their record.
<s>[INST] Given the following SQL query and context: Query: SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees) Context: CREATE TABLE Employees (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR, employee_address_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the states which do not have any employee in their record. The answer to your question is: SELECT state_province_county FROM addresses WHERE NOT address_id IN (SELECT employee_address_id FROM Employees). [/s>
SELECT customer_name, customer_phone, customer_email FROM Customers ORDER BY date_became_customer
CREATE TABLE Customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, date_became_customer VARCHAR)
List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name, customer_phone, customer_email FROM Customers ORDER BY date_became_customer Context: CREATE TABLE Customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, date_became_customer VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names, phone numbers, and emails of all customers sorted by their dates of becoming customers. The answer to your question is: SELECT customer_name, customer_phone, customer_email FROM Customers ORDER BY date_became_customer. [/s>
SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5
CREATE TABLE Customers (customer_name VARCHAR, date_became_customer VARCHAR)
Find the name of the first 5 customers.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5 Context: CREATE TABLE Customers (customer_name VARCHAR, date_became_customer VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the first 5 customers. The answer to your question is: SELECT customer_name FROM Customers ORDER BY date_became_customer LIMIT 5. [/s>
SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Customers (payment_method VARCHAR)
Find the payment method that is used most frequently.
<s>[INST] Given the following SQL query and context: Query: SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Customers (payment_method VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the payment method that is used most frequently. The answer to your question is: SELECT payment_method FROM Customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT route_name FROM Delivery_Routes ORDER BY route_name
CREATE TABLE Delivery_Routes (route_name VARCHAR)
List the names of all routes in alphabetic order.
<s>[INST] Given the following SQL query and context: Query: SELECT route_name FROM Delivery_Routes ORDER BY route_name Context: CREATE TABLE Delivery_Routes (route_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all routes in alphabetic order. The answer to your question is: SELECT route_name FROM Delivery_Routes ORDER BY route_name. [/s>
SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Delivery_Routes (route_name VARCHAR, route_id VARCHAR); CREATE TABLE Delivery_Route_Locations (route_id VARCHAR)
Find the name of route that has the highest number of deliveries.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Delivery_Routes (route_name VARCHAR, route_id VARCHAR); CREATE TABLE Delivery_Route_Locations (route_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of route that has the highest number of deliveries. The answer to your question is: SELECT t1.route_name FROM Delivery_Routes AS t1 JOIN Delivery_Route_Locations AS t2 ON t1.route_id = t2.route_id GROUP BY t1.route_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county
CREATE TABLE customer_addresses (address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR)
List the state names and the number of customers living in each state.
<s>[INST] Given the following SQL query and context: Query: SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county Context: CREATE TABLE customer_addresses (address_id VARCHAR); CREATE TABLE addresses (state_province_county VARCHAR, address_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the state names and the number of customers living in each state. The answer to your question is: SELECT t2.state_province_county, COUNT(*) FROM customer_addresses AS t1 JOIN addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county. [/s>
SELECT COUNT(*) FROM authors
CREATE TABLE authors (Id VARCHAR)
How many authors are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM authors Context: CREATE TABLE authors (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many authors are there? The answer to your question is: SELECT COUNT(*) FROM authors. [/s>