answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1
CREATE TABLE WINE (Winery VARCHAR, SCORE VARCHAR)
Which winery is the wine that has the highest score from?
<s>[INST] Given the following SQL query and context: Query: SELECT Winery FROM WINE ORDER BY SCORE LIMIT 1 Context: CREATE TABLE WINE (Winery VARCHAR, SCORE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which winery is the wine that has the highest score from? The answer to your questi...
SELECT Name FROM WINE WHERE YEAR = "2008"
CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR)
Find the names of all wines produced in 2008.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM WINE WHERE YEAR = "2008" Context: CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all wines produced in 2008. The answer to your question is: SELECT Name F...
SELECT Grape, Appelation FROM WINE
CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR)
List the grapes and appelations of all wines.
<s>[INST] Given the following SQL query and context: Query: SELECT Grape, Appelation FROM WINE Context: CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the grapes and appelations of all wines. The answer to your question is: SELECT Grape,...
SELECT Name, Score FROM WINE
CREATE TABLE WINE (Name VARCHAR, Score VARCHAR)
List the names and scores of all wines.
<s>[INST] Given the following SQL query and context: Query: SELECT Name, Score FROM WINE Context: CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names and scores of all wines. The answer to your question is: SELECT Name, Score FROM WINE. [...
SELECT Area, County FROM APPELLATIONS
CREATE TABLE APPELLATIONS (Area VARCHAR, County VARCHAR)
List the area and county of all appelations.
<s>[INST] Given the following SQL query and context: Query: SELECT Area, County FROM APPELLATIONS Context: CREATE TABLE APPELLATIONS (Area VARCHAR, County VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the area and county of all appelations. The answer to your question is: SELECT A...
SELECT Price FROM WINE WHERE YEAR < 2010
CREATE TABLE WINE (Price VARCHAR, YEAR INTEGER)
What are the prices of wines produced before the year of 2010?
<s>[INST] Given the following SQL query and context: Query: SELECT Price FROM WINE WHERE YEAR < 2010 Context: CREATE TABLE WINE (Price VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the prices of wines produced before the year of 2010? The answer to your question ...
SELECT Name FROM WINE WHERE score > 90
CREATE TABLE WINE (Name VARCHAR, score INTEGER)
List the names of all distinct wines that have scores higher than 90.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM WINE WHERE score > 90 Context: CREATE TABLE WINE (Name VARCHAR, score INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the names of all distinct wines that have scores higher than 90. The answer to your ques...
SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red"
CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR)
List the names of all distinct wines that are made of red color grape.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" Context: CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR) [/INST] Based on the provided SQL query and con...
SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast"
CREATE TABLE APPELLATIONs (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR)
Find the names of all distinct wines that have appellations in North Coast area.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "North Coast" Context: CREATE TABLE APPELLATIONs (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR) [/INST] B...
SELECT COUNT(*) FROM WINE WHERE Winery = "Robert Biale"
CREATE TABLE WINE (Winery VARCHAR)
How many wines are produced at Robert Biale winery?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM WINE WHERE Winery = "Robert Biale" Context: CREATE TABLE WINE (Winery VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many wines are produced at Robert Biale winery? The answer to your question is: SELEC...
SELECT COUNT(*) FROM APPELLATIONS WHERE County = "Napa"
CREATE TABLE APPELLATIONS (County VARCHAR)
How many appelations are in Napa Country?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM APPELLATIONS WHERE County = "Napa" Context: CREATE TABLE APPELLATIONS (County VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many appelations are in Napa Country? The answer to your question is: SELECT ...
SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma"
CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR)
Give me the average prices of wines that are produced by appelations in Sonoma County.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Sonoma" Context: CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR) [/INST] Base...
SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White"
CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Score VARCHAR, Grape VARCHAR)
What are the names and scores of wines that are made of white color grapes?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" Context: CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Name VARCHAR, Score VARCHAR, Grape VARCHAR) [/INST] Based on the provided...
SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "Central Coast" AND T2.year < 2005
CREATE TABLE APPELLATIONS (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Price INTEGER, Appelation VARCHAR, year VARCHAR)
Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = "Central Coast" AND T2.year < 2005 Context: CREATE TABLE APPELLATIONS (Appelation VARCHAR, Area VARCHAR); CREATE TABLE WINE (Price INTEGER, Appelation...
SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" AND T2.score > 90
CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Grape VARCHAR, score VARCHAR)
Find the the grape whose white color grapes are used to produce wines with scores higher than 90.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "White" AND T2.score > 90 Context: CREATE TABLE GRAPES (Grape VARCHAR, Color VARCHAR); CREATE TABLE WINE (Grape VARCHAR, score VARCHAR) [/INST] Based on the prov...
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50
CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR, price VARCHAR); CREATE TABLE Grapes (Grape VARCHAR, Color VARCHAR)
What are the wines that have prices higher than 50 and made of Red color grapes?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50 Context: CREATE TABLE WINE (Name VARCHAR, Grape VARCHAR, price VARCHAR); CREATE TABLE Grapes (Grape VARCHAR, Color VARCHAR) [/INST] Based on the pr...
SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50
CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR, price VARCHAR)
What are the wines that have prices lower than 50 and have appelations in Monterey county?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.price < 50 Context: CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Name VARCHAR, Appelation VARCHAR,...
SELECT COUNT(*), Grape FROM WINE GROUP BY Grape
CREATE TABLE WINE (Grape VARCHAR)
What are the numbers of wines for different grapes?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), Grape FROM WINE GROUP BY Grape Context: CREATE TABLE WINE (Grape VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the numbers of wines for different grapes? The answer to your question is: SELECT COUNT(*...
SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR
CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER)
What are the average prices of wines for different years?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR Context: CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the average prices of wines for different years? The answer to your questio...
SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = "John Anthony")
CREATE TABLE wine (Name VARCHAR, Price INTEGER, Winery VARCHAR); CREATE TABLE WINE (Name VARCHAR, Price INTEGER, Winery VARCHAR)
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = "John Anthony") Context: CREATE TABLE wine (Name VARCHAR, Price INTEGER, Winery VARCHAR); CREATE TABLE WINE (Name VARCHAR, Price INTEGER, Winery VARCHAR) [/INST] Based on ...
SELECT DISTINCT Name FROM WINE ORDER BY Name
CREATE TABLE WINE (Name VARCHAR)
List the names of all distinct wines in alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Name FROM WINE ORDER BY Name Context: CREATE TABLE WINE (Name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all distinct wines in alphabetical order. The answer to your question is: SELECT DIS...
SELECT DISTINCT Name FROM WINE ORDER BY price
CREATE TABLE WINE (Name VARCHAR, price VARCHAR)
List the names of all distinct wines ordered by price.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Name FROM WINE ORDER BY price Context: CREATE TABLE WINE (Name VARCHAR, price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all distinct wines ordered by price. The answer to your question is:...
SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE WINE (Appelation VARCHAR, year VARCHAR); CREATE TABLE APPELLATIONS (Area VARCHAR, Appelation VARCHAR)
What is the area of the appelation that produces the highest number of wines before the year of 2010?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE WINE (Appelation VARCHAR, year VARCHAR); CREATE TABLE APPELLATIONS (Area V...
SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1
CREATE TABLE GRAPES (Color VARCHAR, Grape VARCHAR); CREATE TABLE WINE (Grape VARCHAR)
What is the color of the grape whose wine products has the highest average price?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1 Context: CREATE TABLE GRAPES (Color VARCHAR, Grape VARCHAR); CREATE TABLE WINE (Grape VARCHAR) [/INST] Based on the provided SQL query a...
SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR)
Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010 Context: CREATE TABLE WINE (Name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the distinct names of wines produced before the year of 2000 or ...
SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
CREATE TABLE WINE (Winery VARCHAR, Price INTEGER)
Find the distinct winery of wines having price between 50 and 100.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100 Context: CREATE TABLE WINE (Winery VARCHAR, Price INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the distinct winery of wines having price between 50 and 100....
SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel"
CREATE TABLE WINE (Price INTEGER, Cases INTEGER, YEAR VARCHAR, Grape VARCHAR)
What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = "Zinfandel" Context: CREATE TABLE WINE (Price INTEGER, Cases INTEGER, YEAR VARCHAR, Grape VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the average...
SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = "St. Helena"
CREATE TABLE WINE (Price INTEGER, Score INTEGER, Appelation VARCHAR)
What are the maximum price and score of wines produced by St. Helena appelation?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = "St. Helena" Context: CREATE TABLE WINE (Price INTEGER, Score INTEGER, Appelation VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the maximum price and score of...
SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR
CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER, Score INTEGER)
What are the maximum price and score of wines in each year?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR Context: CREATE TABLE WINE (YEAR VARCHAR, Price INTEGER, Score INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the maximum price and score of wines in each yea...
SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation
CREATE TABLE WINE (Appelation VARCHAR, Price INTEGER, Score INTEGER)
What are the average price and score of wines grouped by appelation?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation Context: CREATE TABLE WINE (Appelation VARCHAR, Price INTEGER, Score INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the average price and score of...
SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4
CREATE TABLE WINE (Winery VARCHAR)
Find the wineries that have at least four wines.
<s>[INST] Given the following SQL query and context: Query: SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4 Context: CREATE TABLE WINE (Winery VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the wineries that have at least four wines. The answer to your question is: SEL...
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3
CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR); CREATE TABLE WINE (Appelation VARCHAR)
Find the country of all appelations who have at most three wines.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3 Context: CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR); CREATE TABLE WINE (Appelation VARCHAR) [/INST] Based ...
SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = "Brander")
CREATE TABLE WINE (Name VARCHAR, YEAR INTEGER, Winery VARCHAR)
What are the names of wines whose production year are before the year of all wines by Brander winery?
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = "Brander") Context: CREATE TABLE WINE (Name VARCHAR, YEAR INTEGER, Winery VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of wines ...
SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)
CREATE TABLE WINE (Name VARCHAR, Price INTEGER, YEAR VARCHAR)
What are the names of wines that are more expensive then all wines made in the year 2006?
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006) Context: CREATE TABLE WINE (Name VARCHAR, Price INTEGER, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of wines that a...
SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = "White" GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3
CREATE TABLE GRAPES (GRAPE VARCHAR, Color VARCHAR); CREATE TABLE WINE (Winery VARCHAR, GRAPE VARCHAR)
Find the top 3 wineries with the greatest number of wines made of white color grapes.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = "White" GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3 Context: CREATE TABLE GRAPES (GRAPE VARCHAR, Color VARCHAR); CREATE TABLE WINE (Winery VARCHAR, GRAPE VARCHAR) ...
SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR
CREATE TABLE WINE (Grape VARCHAR, Winery VARCHAR, YEAR VARCHAR, Price INTEGER)
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
<s>[INST] Given the following SQL query and context: Query: SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR Context: CREATE TABLE WINE (Grape VARCHAR, Winery VARCHAR, YEAR VARCHAR, Price INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the grape, winery and year ...
SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name
CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR, Name VARCHAR, Score INTEGER)
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
<s>[INST] Given the following SQL query and context: Query: SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name Context: CREATE TABLE WINE (Grape VARCHAR, Appelation VARCHAR, Name VARCHAR, Score INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the grape, appelatio...
SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast"
CREATE TABLE WINE (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR)
Find the appelations that produce wines after the year of 2008 but not in Central Coast area.
<s>[INST] Given the following SQL query and context: Query: SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = "Central Coast" Context: CREATE TABLE WINE (Appelation VARCHAR, YEAR INTEGER, Area VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, YEAR INTEGER, Area...
SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')
CREATE TABLE wine (price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLATIONS (Appelation VARCHAR, County VARCHAR); CREATE TABLE WINE (Appelation VARCHAR)
Find the average price of wines that are not produced from Sonoma county.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma') Context: CREATE TABLE wine (price INTEGER, Appelation VARCHAR); CREATE TABLE APPELLAT...
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE WINE (Appelation VARCHAR, Score INTEGER); CREATE TABLE APPELLATIONS (County VARCHAR, Appelation VARCHAR)
Find the county where produces the most number of wines with score higher than 90.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE WINE (Appelation VARCHAR, Score INTEGER); CREATE TABLE APPELLATIONS (County VA...
SELECT COUNT(*) FROM station
CREATE TABLE station (Id VARCHAR)
How many train stations are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM station Context: CREATE TABLE station (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many train stations are there? The answer to your question is: SELECT COUNT(*) FROM station. [/s>
SELECT name, LOCATION, number_of_platforms FROM station
CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, number_of_platforms VARCHAR)
Show the name, location, and number of platforms for all stations.
<s>[INST] Given the following SQL query and context: Query: SELECT name, LOCATION, number_of_platforms FROM station Context: CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, number_of_platforms VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name, location, and number of pl...
SELECT DISTINCT LOCATION FROM station
CREATE TABLE station (LOCATION VARCHAR)
What are all locations of train stations?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT LOCATION FROM station Context: CREATE TABLE station (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all locations of train stations? The answer to your question is: SELECT DISTINCT LOCATION FRO...
SELECT name, total_passengers FROM station WHERE LOCATION <> 'London'
CREATE TABLE station (name VARCHAR, total_passengers VARCHAR, LOCATION VARCHAR)
Show the names and total passengers for all train stations not in London.
<s>[INST] Given the following SQL query and context: Query: SELECT name, total_passengers FROM station WHERE LOCATION <> 'London' Context: CREATE TABLE station (name VARCHAR, total_passengers VARCHAR, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names and total passe...
SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3
CREATE TABLE station (name VARCHAR, main_services VARCHAR, total_passengers VARCHAR)
Show the names and main services for train stations that have the top three total number of passengers.
<s>[INST] Given the following SQL query and context: Query: SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3 Context: CREATE TABLE station (name VARCHAR, main_services VARCHAR, total_passengers VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names a...
SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'
CREATE TABLE station (total_passengers INTEGER, LOCATION VARCHAR)
What is the average and maximum number of total passengers for train stations in London or Glasgow?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow' Context: CREATE TABLE station (total_passengers INTEGER, LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is:...
SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION
CREATE TABLE station (LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER)
Show all locations and the total number of platforms and passengers for all train stations in each location.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION Context: CREATE TABLE station (LOCATION VARCHAR, number_of_platforms INTEGER, total_passengers INTEGER) [/INST] Based on the provided SQL query and context, your qu...
SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25
CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR, total_passengers VARCHAR)
Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25 Context: CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR, total_passengers VARCHAR) [/INST] Based on the provided SQL query and context, your qu...
SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15
CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR)
Show all locations which don't have a train station with at least 15 platforms.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15 Context: CREATE TABLE station (LOCATION VARCHAR, number_of_platforms VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all locat...
SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE station (LOCATION VARCHAR)
Show the location with most number of train stations.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE station (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the location with most number of train stations. The answ...
SELECT name, TIME, service FROM train
CREATE TABLE train (name VARCHAR, TIME VARCHAR, service VARCHAR)
Show the name, time, and service for all trains.
<s>[INST] Given the following SQL query and context: Query: SELECT name, TIME, service FROM train Context: CREATE TABLE train (name VARCHAR, TIME VARCHAR, service VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name, time, and service for all trains. The answer to your question ...
SELECT COUNT(*) FROM train
CREATE TABLE train (Id VARCHAR)
Show the number of trains
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM train Context: CREATE TABLE train (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of trains The answer to your question is: SELECT COUNT(*) FROM train. [/s>
SELECT name, service FROM train ORDER BY TIME
CREATE TABLE train (name VARCHAR, service VARCHAR, TIME VARCHAR)
Show the name and service for all trains in order by time.
<s>[INST] Given the following SQL query and context: Query: SELECT name, service FROM train ORDER BY TIME Context: CREATE TABLE train (name VARCHAR, service VARCHAR, TIME VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name and service for all trains in order by time. The answer...
SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id
CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR)
Show the station name and number of trains in each station.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id Context: CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) [/INST] Based on the ...
SELECT T2.name, T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id
CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR)
show the train name and station name for each train.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id Context: CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARC...
SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC
CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR); CREATE TABLE station (station_id VARCHAR, location VARCHAR); CREATE TABLE train (name VARCHAR, time VARCHAR, train_id VARCHAR)
Show all train names and times in stations in London in descending order by train time.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC Context: CREATE TABLE train_station (station_id VARCHAR, train...
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR)
Show the station name with greatest number of trains.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) ...
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2
CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR)
Show the station name with at least two trains.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2 Context: CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR) [/INST] Ba...
SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1
CREATE TABLE station (LOCATION VARCHAR)
Show all locations with only 1 station.
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1 Context: CREATE TABLE station (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all locations with only 1 station. The answer to your question is: S...
SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station)
CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (name VARCHAR, station_id VARCHAR)
Show station names without any trains.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station) Context: CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train_station (name VARCHAR, station_id VARCHAR) [/INST] Based on the provided SQL query and ...
SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Ananthapuri Express" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train...
CREATE TABLE station (name VARCHAR, station_id VARCHAR); CREATE TABLE train (train_id VARCHAR, Name VARCHAR); CREATE TABLE train_station (station_id VARCHAR, train_id VARCHAR)
What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Ananthapuri Express" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_i...
SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = "London")
CREATE TABLE station (station_id VARCHAR); CREATE TABLE train_station (station_id VARCHAR); CREATE TABLE train_station (train_id VARCHAR, station_id VARCHAR); CREATE TABLE train (name VARCHAR, train_id VARCHAR)
Find the names of the trains that do not pass any station located in London.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = "London") Context: CREATE TA...
SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit, Annual_interchanges
CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, Annual_entry_exit VARCHAR, Annual_interchanges VARCHAR)
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
<s>[INST] Given the following SQL query and context: Query: SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit, Annual_interchanges Context: CREATE TABLE station (name VARCHAR, LOCATION VARCHAR, Annual_entry_exit VARCHAR, Annual_interchanges VARCHAR) [/INST] Based on the provided SQL query and context, your ...
SELECT vehicle_id FROM Vehicles
CREATE TABLE Vehicles (vehicle_id VARCHAR)
List all vehicle id
<s>[INST] Given the following SQL query and context: Query: SELECT vehicle_id FROM Vehicles Context: CREATE TABLE Vehicles (vehicle_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all vehicle id The answer to your question is: SELECT vehicle_id FROM Vehicles. [/s>
SELECT COUNT(*) FROM Vehicles
CREATE TABLE Vehicles (Id VARCHAR)
How many vehicle in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Vehicles Context: CREATE TABLE Vehicles (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many vehicle in total? The answer to your question is: SELECT COUNT(*) FROM Vehicles. [/s>
SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1
CREATE TABLE Vehicles (vehicle_details VARCHAR, vehicle_id VARCHAR)
Show the detail of vehicle with id 1.
<s>[INST] Given the following SQL query and context: Query: SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1 Context: CREATE TABLE Vehicles (vehicle_details VARCHAR, vehicle_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the detail of vehicle with id 1. The answer to yo...
SELECT first_name, middle_name, last_name FROM Staff
CREATE TABLE Staff (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR)
List the first name middle name and last name of all staff.
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, middle_name, last_name FROM Staff Context: CREATE TABLE Staff (first_name VARCHAR, middle_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the first name middle name and last name o...
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
CREATE TABLE Staff (date_of_birth VARCHAR, first_name VARCHAR, last_name VARCHAR)
What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
<s>[INST] Given the following SQL query and context: Query: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn" Context: CREATE TABLE Staff (date_of_birth VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the ...
SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
CREATE TABLE Staff (date_joined_staff VARCHAR, first_name VARCHAR, last_name VARCHAR)
When did the staff member with first name as Janessa and last name as Sawayn join the company?
<s>[INST] Given the following SQL query and context: Query: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn" Context: CREATE TABLE Staff (date_joined_staff VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When...
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
CREATE TABLE Staff (date_left_staff VARCHAR, first_name VARCHAR, last_name VARCHAR)
When did the staff member with first name as Janessa and last name as Sawayn leave the company?
<s>[INST] Given the following SQL query and context: Query: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn" Context: CREATE TABLE Staff (date_left_staff VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When did...
SELECT COUNT(*) FROM Staff WHERE first_name = "Ludie"
CREATE TABLE Staff (first_name VARCHAR)
How many staff have the first name Ludie?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Staff WHERE first_name = "Ludie" Context: CREATE TABLE Staff (first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many staff have the first name Ludie? The answer to your question is: SELECT COUNT...
SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
CREATE TABLE Staff (nickname VARCHAR, first_name VARCHAR, last_name VARCHAR)
What is the nickname of staff with first name as Janessa and last name as Sawayn?
<s>[INST] Given the following SQL query and context: Query: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn" Context: CREATE TABLE Staff (nickname VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the nickname o...
SELECT COUNT(*) FROM Staff
CREATE TABLE Staff (Id VARCHAR)
How many staff in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Staff Context: CREATE TABLE Staff (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many staff in total? The answer to your question is: SELECT COUNT(*) FROM Staff. [/s>
SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)
Which city does staff with first name as Janessa and last name as Sawayn live?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" Context: CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE ...
SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
CREATE TABLE Addresses (country VARCHAR, state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
Which country and state does staff with first name as Janessa and last name as Sawayn lived?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" Context: CREATE TABLE Addresses (country VARCHAR, state_province_county VARCHAR...
SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin"
CREATE TABLE Lessons (lesson_time INTEGER, customer_id VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" Context: CREATE TABLE Lessons (lesson_time INTEGER, customer_id VARCHAR); CREATE TABLE Customers (c...
SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
What is the zip code of staff with first name as Janessa and last name as Sawayn lived?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" Context: CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staf...
SELECT COUNT(*) FROM Addresses WHERE state_province_county = "Georgia"
CREATE TABLE Addresses (state_province_county VARCHAR)
How many staff live in state Georgia?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Addresses WHERE state_province_county = "Georgia" Context: CREATE TABLE Addresses (state_province_county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many staff live in state Georgia? The answer to yo...
SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort"
CREATE TABLE Staff (first_name VARCHAR, last_name VARCHAR, staff_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR)
Find out the first name and last name of staff lived in city Damianfort.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort" Context: CREATE TABLE Staff (first_name VARCHAR, last_name VARCHAR, staff_address_id VARCHAR); CREATE TABLE Addresses (...
SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Staff (staff_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)
Which city lives most of staffs? List the city name and number of staffs.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Staff (staff_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCH...
SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4
CREATE TABLE Addresses (state_province_county VARCHAR, address_id VARCHAR); CREATE TABLE Staff (staff_address_id VARCHAR)
List the states which have between 2 to 4 staffs living there.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4 Context: CREATE TABLE Addresses (state_province_county VARCHAR, address_id VARCHAR); ...
SELECT first_name, last_name FROM Customers
CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR)
List the first name and last name of all customers.
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM Customers Context: CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the first name and last name of all customers. The answer to your qu...
SELECT email_address, date_of_birth FROM Customers WHERE first_name = "Carole"
CREATE TABLE Customers (email_address VARCHAR, date_of_birth VARCHAR, first_name VARCHAR)
List email address and birthday of customer whose first name as Carole.
<s>[INST] Given the following SQL query and context: Query: SELECT email_address, date_of_birth FROM Customers WHERE first_name = "Carole" Context: CREATE TABLE Customers (email_address VARCHAR, date_of_birth VARCHAR, first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List email ...
SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000
CREATE TABLE Customers (phone_number VARCHAR, email_address VARCHAR, amount_outstanding INTEGER)
List phone number and email address of customer with more than 2000 outstanding balance.
<s>[INST] Given the following SQL query and context: Query: SELECT phone_number, email_address FROM Customers WHERE amount_outstanding > 2000 Context: CREATE TABLE Customers (phone_number VARCHAR, email_address VARCHAR, amount_outstanding INTEGER) [/INST] Based on the provided SQL query and context, your question is: L...
SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler"
CREATE TABLE Customers (customer_status_code VARCHAR, cell_mobile_phone_number VARCHAR, email_address VARCHAR, first_name VARCHAR, last_name VARCHAR)
What is the status code, mobile phone number and email address of customer with last name as Kohler or first name as Marina?
<s>[INST] Given the following SQL query and context: Query: SELECT customer_status_code, cell_mobile_phone_number, email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler" Context: CREATE TABLE Customers (customer_status_code VARCHAR, cell_mobile_phone_number VARCHAR, email_address VARCHAR, firs...
SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer'
CREATE TABLE Customers (date_of_birth VARCHAR, customer_status_code VARCHAR)
When are the birthdays of customer who are classified as 'Good Customer' status?
<s>[INST] Given the following SQL query and context: Query: SELECT date_of_birth FROM Customers WHERE customer_status_code = 'Good Customer' Context: CREATE TABLE Customers (date_of_birth VARCHAR, customer_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When are the birthdays...
SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard"
CREATE TABLE Customers (date_became_customer VARCHAR, first_name VARCHAR, last_name VARCHAR)
When did customer with first name as Carole and last name as Bernhard became a customer?
<s>[INST] Given the following SQL query and context: Query: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard" Context: CREATE TABLE Customers (date_became_customer VARCHAR, first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your qu...
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
CREATE TABLE Customers (customer_status_code VARCHAR)
List all customer status codes and the number of customers having each status code.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code Context: CREATE TABLE Customers (customer_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all customer status codes and the numb...
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1
CREATE TABLE Customers (customer_status_code VARCHAR)
Which customer status code has least number of customers?
<s>[INST] Given the following SQL query and context: Query: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Customers (customer_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which customer status code ...
SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed"
CREATE TABLE Lessons (customer_id VARCHAR, lesson_status_code VARCHAR); CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed" Context: CREATE TABLE Lessons (customer_id VARCHAR, lesson_status_code...
SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers
CREATE TABLE Customers (amount_outstanding INTEGER)
What is maximum, minimum and average amount of outstanding of customer?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM Customers Context: CREATE TABLE Customers (amount_outstanding INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is maximum, minimum and ave...
SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000
CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, amount_outstanding INTEGER)
List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000 Context: CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, amount_outstanding INTEGER) [/INST] Based on the provided SQL query and context, your question is...
SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt"
CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_address_id VARCHAR); CREATE TABLE Addresses (address_id VARCHAR, city VARCHAR)
List first name and last name of customers lived in city Lockmanfurt.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt" Context: CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_address_id VARCHAR); CREATE TA...
SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
CREATE TABLE Addresses (country VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
Which country does customer with first name as Carole and last name as Bernhard lived in?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" Context: CREATE TABLE Addresses (country VARCHAR, address_id VARCHAR); CREATE TABLE Customers (cu...
SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard"
CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Customers (customer_address_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
What is zip code of customer with first name as Carole and last name as Bernhard?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" Context: CREATE TABLE Addresses (zip_postcode VARCHAR, address_id VARCHAR); CREATE TABLE Cus...
SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Customers (customer_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id VARCHAR)
Which city does has most number of customers?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Customers (customer_address_id VARCHAR); CREATE TABLE Addresses (city VARCHAR, address_id V...
SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard"
CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE Customer_Payments (amount_payment INTEGER, customer_id VARCHAR)
How much in total does customer with first name as Carole and last name as Bernhard paid?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard" Context: CREATE TABLE Customers (customer_id VARCHAR, first_name VARCHAR, last_name ...
SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments)
CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR)
List the number of customers that did not have any payment history.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Customer_Payments) Context: CREATE TABLE Customers (customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR) [/INST] Based on the provided SQL query and context,...
SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2
CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE Customer_Payments (customer_id VARCHAR)
List first name and last name of customers that have more than 2 payments.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.first_name, T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) > 2 Context: CREATE TABLE Customers (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CR...
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code
CREATE TABLE Customer_Payments (payment_method_code VARCHAR)
List all payment methods and number of payments using each payment methods.
<s>[INST] Given the following SQL query and context: Query: SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code Context: CREATE TABLE Customer_Payments (payment_method_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all payment methods and n...