answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON...
CREATE TABLE Tourist_Attraction_Features (tourist_attraction_id VARCHAR, Feature_ID VARCHAR); CREATE TABLE Features (Feature_ID VARCHAR, feature_Details VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, tourist_attraction_id VARCHAR)
What are the names of the tourist attractions that have parking or shopping as their feature details?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID = T3.Feature_ID WHERE T3.feature_Details = 'park' UNION SELECT T1.Name FROM Tourist...
SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "254 Ottilie Junction" OR T2.How_to_Get_There = "bus"
CREATE TABLE Tourist_Attractions (Name VARCHAR, Location_ID VARCHAR, How_to_Get_There VARCHAR); CREATE TABLE Locations (Location_ID VARCHAR, Address VARCHAR)
What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID = T2.Location_ID WHERE T1.Address = "254 Ottilie Junction" OR T2.How_to_Get_There = "bus" Context: CREATE TABLE Tourist_Attractions (Name VARCHAR, Location_ID VARCHAR, How_to_...
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Vincent" INTERSECT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_At...
CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_Details VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)
What are the names of the tourist attractions Vincent and Marcelle visit?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Vincent" INTERSECT SELECT T1.Name FROM Tourist_Attractions ...
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attrac...
CREATE TABLE VISITS (Tourist_Attraction_ID VARCHAR, Tourist_ID VARCHAR); CREATE TABLE VISITORS (Tourist_Details VARCHAR, Tourist_ID VARCHAR); CREATE TABLE Tourist_Attractions (Name VARCHAR, Tourist_Attraction_ID VARCHAR)
What are the names of tourist attraction that Alison visited but Rosalind did not visit?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID = T3.Tourist_Attraction_ID AND T2.Tourist_ID = T3.Tourist_ID WHERE T2.Tourist_Details = "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T...
SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits)
CREATE TABLE Visitors (Tourist_ID VARCHAR); CREATE TABLE Visits (Tourist_ID VARCHAR)
How many tourists did not make any visit?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Visitors WHERE NOT Tourist_ID IN (SELECT Tourist_ID FROM Visits) Context: CREATE TABLE Visitors (Tourist_ID VARCHAR); CREATE TABLE Visits (Tourist_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many ...
SELECT COUNT(*) FROM Video_games
CREATE TABLE Video_games (Id VARCHAR)
How many video games exist?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Video_games Context: CREATE TABLE Video_games (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many video games exist? The answer to your question is: SELECT COUNT(*) FROM Video_games. [/s>
SELECT COUNT(DISTINCT gtype) FROM Video_games
CREATE TABLE Video_games (gtype VARCHAR)
How many video game types exist?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT gtype) FROM Video_games Context: CREATE TABLE Video_games (gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many video game types exist? The answer to your question is: SELECT COUNT(DISTINCT gtype)...
SELECT DISTINCT gtype FROM Video_games
CREATE TABLE Video_games (gtype VARCHAR)
Show all video game types.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT gtype FROM Video_games Context: CREATE TABLE Video_games (gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all video game types. The answer to your question is: SELECT DISTINCT gtype FROM Video_games. [...
SELECT gname, gtype FROM Video_games ORDER BY gname
CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR)
Show all video games and their types in the order of their names.
<s>[INST] Given the following SQL query and context: Query: SELECT gname, gtype FROM Video_games ORDER BY gname Context: CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all video games and their types in the order of their names. The an...
SELECT gname FROM Video_games WHERE gtype = "Collectible card game"
CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR)
Show all video games with type Collectible card game.
<s>[INST] Given the following SQL query and context: Query: SELECT gname FROM Video_games WHERE gtype = "Collectible card game" Context: CREATE TABLE Video_games (gname VARCHAR, gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all video games with type Collectible card game. Th...
SELECT gtype FROM Video_games WHERE gname = "Call of Destiny"
CREATE TABLE Video_games (gtype VARCHAR, gname VARCHAR)
What is the type of video game Call of Destiny.
<s>[INST] Given the following SQL query and context: Query: SELECT gtype FROM Video_games WHERE gname = "Call of Destiny" Context: CREATE TABLE Video_games (gtype VARCHAR, gname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the type of video game Call of Destiny. The answer to ...
SELECT COUNT(*) FROM Video_games WHERE gtype = "Massively multiplayer online game"
CREATE TABLE Video_games (gtype VARCHAR)
How many video games have type Massively multiplayer online game?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Video_games WHERE gtype = "Massively multiplayer online game" Context: CREATE TABLE Video_games (gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many video games have type Massively multiplayer onl...
SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype
CREATE TABLE Video_games (gtype VARCHAR)
Show all video game types and the number of video games in each type.
<s>[INST] Given the following SQL query and context: Query: SELECT gtype, COUNT(*) FROM Video_games GROUP BY gtype Context: CREATE TABLE Video_games (gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all video game types and the number of video games in each type. The answer to ...
SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Video_games (gtype VARCHAR)
Which game type has most number of games?
<s>[INST] Given the following SQL query and context: Query: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Video_games (gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which game type has most number of games? The answer to your qu...
SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1
CREATE TABLE Video_games (gtype VARCHAR)
Which game type has least number of games?
<s>[INST] Given the following SQL query and context: Query: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Video_games (gtype VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which game type has least number of games? The answer to your questi...
SELECT StuID FROM Student WHERE city_code = "CHI"
CREATE TABLE Student (StuID VARCHAR, city_code VARCHAR)
Show ids for all students who live in CHI.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student WHERE city_code = "CHI" Context: CREATE TABLE Student (StuID VARCHAR, city_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids for all students who live in CHI. The answer to your question is:...
SELECT StuID FROM Student WHERE Advisor = 1121
CREATE TABLE Student (StuID VARCHAR, Advisor VARCHAR)
Show ids for all students who have advisor 1121.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student WHERE Advisor = 1121 Context: CREATE TABLE Student (StuID VARCHAR, Advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids for all students who have advisor 1121. The answer to your question is...
SELECT Fname FROM Student WHERE Major = 600
CREATE TABLE Student (Fname VARCHAR, Major VARCHAR)
Show first name for all students with major 600.
<s>[INST] Given the following SQL query and context: Query: SELECT Fname FROM Student WHERE Major = 600 Context: CREATE TABLE Student (Fname VARCHAR, Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show first name for all students with major 600. The answer to your question is: SEL...
SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major
CREATE TABLE Student (major VARCHAR, age INTEGER)
Show the average, minimum, and maximum age for different majors.
<s>[INST] Given the following SQL query and context: Query: SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major Context: CREATE TABLE Student (major VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the average, minimum, and maximum age for different ma...
SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2
CREATE TABLE Student (advisor VARCHAR)
Show all advisors who have at least two students.
<s>[INST] Given the following SQL query and context: Query: SELECT advisor FROM Student GROUP BY advisor HAVING COUNT(*) >= 2 Context: CREATE TABLE Student (advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all advisors who have at least two students. The answer to your questi...
SELECT COUNT(DISTINCT sportname) FROM Sportsinfo
CREATE TABLE Sportsinfo (sportname VARCHAR)
How many sports do we have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT sportname) FROM Sportsinfo Context: CREATE TABLE Sportsinfo (sportname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many sports do we have? The answer to your question is: SELECT COUNT(DISTINCT sport...
SELECT COUNT(DISTINCT StuID) FROM Sportsinfo
CREATE TABLE Sportsinfo (StuID VARCHAR)
How many students play sports?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT StuID) FROM Sportsinfo Context: CREATE TABLE Sportsinfo (StuID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many students play sports? The answer to your question is: SELECT COUNT(DISTINCT StuID) FRO...
SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'
CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR)
List ids for all student who are on scholarship.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' Context: CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List ids for all student who are on scholarship. The answer to...
SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'
CREATE TABLE Student (Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR)
Show last names for all student who are on scholarship.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y' Context: CREATE TABLE Student (Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR) [/INST] Based on the provi...
SELECT SUM(gamesplayed) FROM Sportsinfo
CREATE TABLE Sportsinfo (gamesplayed INTEGER)
How many games are played for all students?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(gamesplayed) FROM Sportsinfo Context: CREATE TABLE Sportsinfo (gamesplayed INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many games are played for all students? The answer to your question is: SELECT SUM(gamespl...
SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = "Football" AND onscholarship = 'Y'
CREATE TABLE Sportsinfo (gamesplayed INTEGER, sportname VARCHAR, onscholarship VARCHAR)
How many games are played for all football games by students on scholarship?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(gamesplayed) FROM Sportsinfo WHERE sportname = "Football" AND onscholarship = 'Y' Context: CREATE TABLE Sportsinfo (gamesplayed INTEGER, sportname VARCHAR, onscholarship VARCHAR) [/INST] Based on the provided SQL query and context, your question is:...
SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname
CREATE TABLE Sportsinfo (sportname VARCHAR)
Show all sport name and the number of students.
<s>[INST] Given the following SQL query and context: Query: SELECT sportname, COUNT(*) FROM Sportsinfo GROUP BY sportname Context: CREATE TABLE Sportsinfo (sportname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all sport name and the number of students. The answer to your questio...
SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID
CREATE TABLE Sportsinfo (StuID VARCHAR, gamesplayed INTEGER)
Show all student IDs with the number of sports and total number of games played
<s>[INST] Given the following SQL query and context: Query: SELECT StuID, COUNT(*), SUM(gamesplayed) FROM Sportsinfo GROUP BY StuID Context: CREATE TABLE Sportsinfo (StuID VARCHAR, gamesplayed INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all student IDs with the number of sports ...
SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10
CREATE TABLE Sportsinfo (StuID VARCHAR, hoursperweek INTEGER)
Show all student IDs with more than total 10 hours per week on all sports played.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10 Context: CREATE TABLE Sportsinfo (StuID VARCHAR, hoursperweek INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all student IDs with more than total 10...
SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR)
What is the first name and last name of the student who have most number of sports?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Fname, T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR) [/IN...
SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Sportsinfo (sportname VARCHAR, onscholarship VARCHAR)
Which sport has most number of students on scholarship?
<s>[INST] Given the following SQL query and context: Query: SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Sportsinfo (sportname VARCHAR, onscholarship VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Whic...
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo
CREATE TABLE Sportsinfo (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR)
Show student ids who don't have any sports.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo Context: CREATE TABLE Sportsinfo (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show student ids who don't have any spor...
SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'
CREATE TABLE Sportsinfo (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR); CREATE TABLE Student (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR)
Show student ids who are on scholarship and have major 600.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' Context: CREATE TABLE Sportsinfo (StuID VARCHAR, major VARCHAR, onscholarship VARCHAR); CREATE TABLE Student (StuID VARCHAR, major VARCHAR, onscholarsh...
SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = "Football"
CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR)
Show student ids who are female and play football.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = "Football" Context: CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR)...
SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football"
CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR)
Show all male student ids who don't play football.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football" Context: CREATE TABLE Sportsinfo (StuID VARCHAR, sex VARCHAR, sportname VARCHAR); CREATE TABLE Student (StuID VARCHAR, sex VARCHAR, sportname VARCHAR) [/...
SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = "David" AND T2.Lname = "Shieber"
CREATE TABLE Student (StuID VARCHAR, Fname VARCHAR, Lname VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR)
Show total hours per week and number of games played for student David Shieber.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = "David" AND T2.Lname = "Shieber" Context: CREATE TABLE Student (StuID VARCHAR, Fname VARCHAR, Lname VARCHAR); CREATE TABLE Sportsinfo (S...
SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20
CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Sportsinfo (StuID VARCHAR)
Show total hours per week and number of games played for students under 20.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20 Context: CREATE TABLE Student (StuID VARCHAR, age INTEGER); CREATE TABLE Sportsinfo (StuID VARCHAR) [/INST] Based on the provided SQL q...
SELECT COUNT(DISTINCT StuID) FROM Plays_games
CREATE TABLE Plays_games (StuID VARCHAR)
How many students play video games?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT StuID) FROM Plays_games Context: CREATE TABLE Plays_games (StuID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many students play video games? The answer to your question is: SELECT COUNT(DISTINCT Stu...
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games
CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR)
Show ids of students who don't play video game.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games Context: CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids of students who don't play vi...
SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games
CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR)
Show ids of students who play video game and play sports.
<s>[INST] Given the following SQL query and context: Query: SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games Context: CREATE TABLE Plays_games (StuID VARCHAR); CREATE TABLE Sportsinfo (StuID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show ids of students who play...
SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid
CREATE TABLE Plays_games (gameid VARCHAR, hours_played INTEGER)
Show all game ids and the number of hours played.
<s>[INST] Given the following SQL query and context: Query: SELECT gameid, SUM(hours_played) FROM Plays_games GROUP BY gameid Context: CREATE TABLE Plays_games (gameid VARCHAR, hours_played INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all game ids and the number of hours played. ...
SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid
CREATE TABLE Plays_games (Stuid VARCHAR, hours_played INTEGER)
Show all student ids and the number of hours played.
<s>[INST] Given the following SQL query and context: Query: SELECT Stuid, SUM(hours_played) FROM Plays_games GROUP BY Stuid Context: CREATE TABLE Plays_games (Stuid VARCHAR, hours_played INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all student ids and the number of hours played. ...
SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1
CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR)
Show the game name that has most number of hours played.
<s>[INST] Given the following SQL query and context: Query: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY SUM(hours_played) DESC LIMIT 1 Context: CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR) [/INST] Based on the pr...
SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000
CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR)
Show all game names played by at least 1000 hours.
<s>[INST] Given the following SQL query and context: Query: SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000 Context: CREATE TABLE Plays_games (gameid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR) [/INST] Based on the provided ...
SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = "Smith" AND T3.Fname = "Linda"
CREATE TABLE Student (Stuid VARCHAR, Lname VARCHAR, Fname VARCHAR); CREATE TABLE Plays_games (gameid VARCHAR, Stuid VARCHAR); CREATE TABLE Video_games (gameid VARCHAR)
Show all game names played by Linda Smith
<s>[INST] Given the following SQL query and context: Query: SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = "Smith" AND T3.Fname = "Linda" Context: CREATE TABLE Student (Stuid VARCHAR, Lname VARCHAR, Fname VARCHAR); CREATE TA...
SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = "Football" OR T1.SportName = "Lacrosse"
CREATE TABLE SportsInfo (StuID VARCHAR, SportName VARCHAR); CREATE TABLE Student (lname VARCHAR, fname VARCHAR, StuID VARCHAR)
Find the last and first name of students who are playing Football or Lacrosse.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.lname, T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = "Football" OR T1.SportName = "Lacrosse" Context: CREATE TABLE SportsInfo (StuID VARCHAR, SportName VARCHAR); CREATE TABLE Student (lname VARCHAR, fna...
SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = "Lacrosse")
CREATE TABLE Student (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VARCHAR); CREATE TABLE Sportsinfo (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VARCHAR)
Find the first name and age of the students who are playing both Football and Lacrosse.
<s>[INST] Given the following SQL query and context: Query: SELECT fname, age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = "Lacrosse") Context: CREATE TABLE Student (fname VARCHAR, age VARCHAR, StuID VARCHAR, SportName VA...
SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Call of Destiny" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Works of Widenius")
CREATE TABLE Plays_games (StuID VARCHAR, GameID VARCHAR); CREATE TABLE Student (lname VARCHAR, sex VARCHAR, StuID VARCHAR); CREATE TABLE Video_games (GameID VARCHAR, Gname VARCHAR)
Find the last name and gender of the students who are playing both Call of Destiny and Works of Widenius games.
<s>[INST] Given the following SQL query and context: Query: SELECT lname, sex FROM Student WHERE StuID IN (SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.GameID WHERE T2.Gname = "Call of Destiny" INTERSECT SELECT T1.StuID FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.GameID = T2.G...
SELECT customer_name FROM customers
CREATE TABLE customers (customer_name VARCHAR)
Find the name of all customers.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM customers Context: CREATE TABLE customers (customer_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of all customers. The answer to your question is: SELECT customer_name FROM custome...
SELECT AVG(order_quantity) FROM order_items
CREATE TABLE order_items (order_quantity INTEGER)
What is the average amount of items ordered in each order?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(order_quantity) FROM order_items Context: CREATE TABLE order_items (order_quantity INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average amount of items ordered in each order? The answer to your question...
SELECT customer_name FROM customers WHERE payment_method = "Cash"
CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)
What are the names of customers who use payment method "Cash"?
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM customers WHERE payment_method = "Cash" Context: CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of customers who use pay...
SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20
CREATE TABLE customers (date_became_customer VARCHAR, customer_id INTEGER)
Find the "date became customers" of the customers whose ID is between 10 and 20.
<s>[INST] Given the following SQL query and context: Query: SELECT date_became_customer FROM customers WHERE customer_id BETWEEN 10 AND 20 Context: CREATE TABLE customers (date_became_customer VARCHAR, customer_id INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the "date became cust...
SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customers (payment_method VARCHAR)
Which payment method is used by most customers?
<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: Which payment method is used by most cus...
SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1)
CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)
What are the names of customers using the most popular payment method?
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM customers WHERE payment_method = (SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1) Context: CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR) [/INST] Based on the provid...
SELECT DISTINCT payment_method FROM customers
CREATE TABLE customers (payment_method VARCHAR)
What are all the payment methods?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT payment_method FROM customers Context: CREATE TABLE customers (payment_method VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the payment methods? The answer to your question is: SELECT DISTINCT paym...
SELECT DISTINCT product_details FROM products
CREATE TABLE products (product_details VARCHAR)
What are the details of all products?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT product_details FROM products Context: CREATE TABLE products (product_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the details of all products? The answer to your question is: SELECT DISTINCT ...
SELECT customer_name FROM customers WHERE customer_name LIKE "%Alex%"
CREATE TABLE customers (customer_name VARCHAR)
Find the name of all customers whose name contains "Alex".
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM customers WHERE customer_name LIKE "%Alex%" Context: CREATE TABLE customers (customer_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of all customers whose name contains "Alex". The ...
SELECT product_details FROM products WHERE product_details LIKE "%Latte%" OR product_details LIKE "%Americano%"
CREATE TABLE products (product_details VARCHAR)
Find the detail of products whose detail contains the word "Latte" or the word "Americano"
<s>[INST] Given the following SQL query and context: Query: SELECT product_details FROM products WHERE product_details LIKE "%Latte%" OR product_details LIKE "%Americano%" Context: CREATE TABLE products (product_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the detail of p...
SELECT t3.address_content 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 t1.customer_name = "Maudie Kertzmann"
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE addresses (address_content VARCHAR, address_id VARCHAR)
What is the address content of the customer named "Maudie Kertzmann"?
<s>[INST] Given the following SQL query and context: Query: SELECT t3.address_content 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 t1.customer_name = "Maudie Kertzmann" Context: CREATE TABLE customers (customer_id VARCH...
SELECT COUNT(*) 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.city = "Lake Geovannyton"
CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, city VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR)
How many customers are living in city "Lake Geovannyton"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) 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.city = "Lake Geovannyton" Context: CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE a...
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 = "Colorado"
CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE addresses (address_id VARCHAR, state_province_county VARCHAR)
Find the name of customers who are living in Colorado?
<s>[INST] Given the following SQL query and context: Query: 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 = "Colorado" Context: CREATE TABLE customer_addresses (customer_i...
SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city 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)
CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR); CREATE TABLE addresses (city VARCHAR)
Find the list of cities that no customer is living in.
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM addresses WHERE NOT city IN (SELECT DISTINCT t3.city 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) Context: CREATE TABLE customers (customer_id VARC...
SELECT t3.city 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 GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE addresses (city VARCHAR, address_id VARCHAR); CREATE TABLE customer_addresses (customer_id VARCHAR, address_id VARCHAR)
Which city has the most customers living in?
<s>[INST] Given the following SQL query and context: Query: SELECT t3.city 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 GROUP BY t3.city ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE customers (customer_id VARCHAR); CR...
SELECT city FROM addresses WHERE zip_postcode = 255
CREATE TABLE addresses (city VARCHAR, zip_postcode VARCHAR)
Find the city with post code 255.
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM addresses WHERE zip_postcode = 255 Context: CREATE TABLE addresses (city VARCHAR, zip_postcode VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the city with post code 255. The answer to your question is: SE...
SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE "4%"
CREATE TABLE addresses (state_province_county VARCHAR, country VARCHAR, zip_postcode VARCHAR)
Find the state and country of all cities with post code starting with 4.
<s>[INST] Given the following SQL query and context: Query: SELECT state_province_county, country FROM addresses WHERE zip_postcode LIKE "4%" Context: CREATE TABLE addresses (state_province_county VARCHAR, country VARCHAR, zip_postcode VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find...
SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4
CREATE TABLE addresses (country VARCHAR, address_id VARCHAR)
List the countries having more than 4 addresses listed.
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM addresses GROUP BY country HAVING COUNT(address_id) > 4 Context: CREATE TABLE addresses (country VARCHAR, address_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the countries having more than 4 addre...
SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5
CREATE TABLE customer_contact_channels (channel_code VARCHAR, customer_id VARCHAR)
List all the contact channel codes that were used less than 5 times.
<s>[INST] Given the following SQL query and context: Query: SELECT channel_code FROM customer_contact_channels GROUP BY channel_code HAVING COUNT(customer_id) < 5 Context: CREATE TABLE customer_contact_channels (channel_code VARCHAR, customer_id VARCHAR) [/INST] Based on the provided SQL query and context, your questio...
SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser"
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (customer_id VARCHAR)
Which contact channel has been used by the customer with name "Tillman Ernser"?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT channel_code FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser" Context: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE custo...
SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser"
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE customer_contact_channels (active_to_date INTEGER, customer_id VARCHAR)
What is the "active to date" of the latest contact channel used by "Tillman Ernser"?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(t2.active_to_date) FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Tillman Ernser" Context: CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE cust...
SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels
CREATE TABLE customer_contact_channels (active_to_date VARCHAR, active_from_date VARCHAR)
What is the average time span of contact channels in the database?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(active_to_date - active_from_date) FROM customer_contact_channels Context: CREATE TABLE customer_contact_channels (active_to_date VARCHAR, active_from_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the a...
SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1)
CREATE TABLE customer_contact_channels (channel_code VARCHAR, contact_number VARCHAR, active_to_date VARCHAR, active_from_date VARCHAR)
What is the channel code and contact number of the customer contact channel that was active for the longest time?
<s>[INST] Given the following SQL query and context: Query: SELECT channel_code, contact_number FROM customer_contact_channels WHERE active_to_date - active_from_date = (SELECT active_to_date - active_from_date FROM customer_contact_channels ORDER BY (active_to_date - active_from_date) DESC LIMIT 1) Context: CREATE TAB...
SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_contact_channels (active_from_date VARCHAR, customer_id VARCHAR, channel_code VARCHAR)
Find the name and active date of the customer that use email as the contact channel.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name, t2.active_from_date FROM customers AS t1 JOIN customer_contact_channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' Context: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items)
CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE order_items (order_quantity INTEGER); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
What is the name of the customer that made the order with the largest quantity?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t3.order_quantity = (SELECT MAX(order_quantity) FROM order_items) Context: CREATE TABLE order_i...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1
CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
What is the name of the customer that has purchased the most items?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1 Context: CREATE TABLE order_it...
SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) LIMIT 1
CREATE TABLE order_items (order_id VARCHAR, order_quantity INTEGER); CREATE TABLE customers (payment_method VARCHAR, customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
What is the payment method of the customer that has purchased the least quantity of items?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.payment_method FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) LIMIT 1 Context: CREATE TABLE order_items ...
SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (product_id VARCHAR, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
How many types of products have Rodrick Heaney bought in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT t3.product_id) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney" Context: CREATE TABLE customers (customer_id V...
SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney"
CREATE TABLE customers (customer_id VARCHAR, customer_name VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
What is the total quantity of products purchased by "Rodrick Heaney"?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(t3.order_quantity) FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id WHERE t1.customer_name = "Rodrick Heaney" Context: CREATE TABLE customers (customer_id VARCHAR,...
SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled"
CREATE TABLE customer_orders (customer_id VARCHAR, order_status VARCHAR)
How many customers have at least one order with status "Cancelled"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT customer_id) FROM customer_orders WHERE order_status = "Cancelled" Context: CREATE TABLE customer_orders (customer_id VARCHAR, order_status VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers...
SELECT COUNT(*) FROM customer_orders WHERE order_details = "Second time"
CREATE TABLE customer_orders (order_details VARCHAR)
How many orders have detail "Second time"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM customer_orders WHERE order_details = "Second time" Context: CREATE TABLE customer_orders (order_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many orders have detail "Second time"? The answer ...
SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered"
CREATE TABLE customer_orders (order_date VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
Find the customer name and date of the orders that have the status "Delivered".
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name, t2.order_date FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id WHERE order_status = "Delivered" Context: CREATE TABLE customer_orders (order_date VARCHAR, customer_id VARCHAR); CREATE TABLE customers (...
SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled"
CREATE TABLE customer_orders (order_id VARCHAR, order_status VARCHAR); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR)
What is the total number of products that are in orders with status "Cancelled"?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled" Context: CREATE TABLE customer_orders (order_id VARCHAR, order_status VARCHAR); CREATE TABLE order_items (order_qua...
SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53"
CREATE TABLE customer_orders (order_id VARCHAR, order_date INTEGER); CREATE TABLE order_items (order_quantity INTEGER, order_id VARCHAR)
Find the total amount of products ordered before 2018-03-17 07:13:53.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_date < "2018-03-17 07:13:53" Context: CREATE TABLE customer_orders (order_id VARCHAR, order_date INTEGER); CREATE TABLE order_items (ord...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1
CREATE TABLE customer_orders (customer_id VARCHAR, order_date VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
Who made the latest order?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id ORDER BY t2.order_date DESC LIMIT 1 Context: CREATE TABLE customer_orders (customer_id VARCHAR, order_date VARCHAR); CREATE TABLE customers (customer_nam...
SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE products (product_details VARCHAR, product_id VARCHAR); CREATE TABLE order_items (product_id VARCHAR)
Which product has been ordered most number of times?
<s>[INST] Given the following SQL query and context: Query: SELECT t2.product_details FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE products (product_details VARCHAR, product_id VARCHAR); CREATE TABLE order_items (...
SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1
CREATE TABLE order_items (product_id VARCHAR, order_quantity INTEGER); CREATE TABLE products (product_details VARCHAR, product_id VARCHAR)
Find the name and ID of the product whose total order quantity is the largest.
<s>[INST] Given the following SQL query and context: Query: SELECT t2.product_details, t2.product_id FROM order_items AS t1 JOIN products AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_id ORDER BY SUM(t1.order_quantity) LIMIT 1 Context: CREATE TABLE order_items (product_id VARCHAR, order_quantity INTEGER); ...
SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona"
CREATE TABLE addresses (address_content VARCHAR, city VARCHAR, state_province_county VARCHAR)
Find all the addresses in East Julianaside, Texas or in Gleasonmouth, Arizona.
<s>[INST] Given the following SQL query and context: Query: SELECT address_content FROM addresses WHERE city = "East Julianaside" AND state_province_county = "Texas" UNION SELECT address_content FROM addresses WHERE city = "Gleasonmouth" AND state_province_county = "Arizona" Context: CREATE TABLE addresses (address_con...
SELECT customer_name FROM customers WHERE payment_method <> 'Cash'
CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR)
Find the name of customers who did not pay with Cash.
<s>[INST] Given the following SQL query and context: Query: SELECT customer_name FROM customers WHERE payment_method <> 'Cash' Context: CREATE TABLE customers (customer_name VARCHAR, payment_method VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of customers who did not pay...
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte'
CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
Find the names of customers who never ordered product Latte.
<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_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE...
SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)
Find the names of customers who never placed an order.
<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_orders AS t2 ON t1.customer_id = t2.customer_id Context: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers (customer...
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orde...
CREATE TABLE products (product_id VARCHAR, product_details VARCHAR); CREATE TABLE order_items (order_id VARCHAR, product_id VARCHAR); CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR, order_id VARCHAR)
Find the names of customers who ordered both products Latte and Americano.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' INTERSECT SEL...
SELECT Age FROM artist
CREATE TABLE artist (Age VARCHAR)
List the age of all music artists.
<s>[INST] Given the following SQL query and context: Query: SELECT Age FROM artist Context: CREATE TABLE artist (Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the age of all music artists. The answer to your question is: SELECT Age FROM artist. [/s>
SELECT AVG(Age) FROM artist
CREATE TABLE artist (Age INTEGER)
What is the average age of all artists?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Age) FROM artist Context: CREATE TABLE artist (Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average age of all artists? The answer to your question is: SELECT AVG(Age) FROM artist. [/s>
SELECT Famous_Title FROM artist WHERE Artist = "Triumfall"
CREATE TABLE artist (Famous_Title VARCHAR, Artist VARCHAR)
What are the famous titles of the artist "Triumfall"?
<s>[INST] Given the following SQL query and context: Query: SELECT Famous_Title FROM artist WHERE Artist = "Triumfall" Context: CREATE TABLE artist (Famous_Title VARCHAR, Artist VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the famous titles of the artist "Triumfall"? The answ...
SELECT DISTINCT (Famous_Release_date) FROM artist
CREATE TABLE artist (Famous_Release_date VARCHAR)
What are the distinct Famous release dates?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT (Famous_Release_date) FROM artist Context: CREATE TABLE artist (Famous_Release_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the distinct Famous release dates? The answer to your question is: SELE...
SELECT Date_of_ceremony, RESULT FROM music_festival
CREATE TABLE music_festival (Date_of_ceremony VARCHAR, RESULT VARCHAR)
Return the dates of ceremony and the results of all music festivals
<s>[INST] Given the following SQL query and context: Query: SELECT Date_of_ceremony, RESULT FROM music_festival Context: CREATE TABLE music_festival (Date_of_ceremony VARCHAR, RESULT VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the dates of ceremony and the results of all music...
SELECT Category FROM music_festival WHERE RESULT = "Awarded"
CREATE TABLE music_festival (Category VARCHAR, RESULT VARCHAR)
What are the category of music festivals with result "Awarded"?
<s>[INST] Given the following SQL query and context: Query: SELECT Category FROM music_festival WHERE RESULT = "Awarded" Context: CREATE TABLE music_festival (Category VARCHAR, RESULT VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the category of music festivals with result "Aw...
SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume
CREATE TABLE volume (Weeks_on_Top INTEGER)
What are the maximum and minimum week on top of all volumes?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Weeks_on_Top), MIN(Weeks_on_Top) FROM volume Context: CREATE TABLE volume (Weeks_on_Top INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the maximum and minimum week on top of all volumes? The answer to your q...
SELECT Song FROM volume WHERE Weeks_on_Top > 1
CREATE TABLE volume (Song VARCHAR, Weeks_on_Top INTEGER)
What are the songs in volumes with more than 1 week on top?
<s>[INST] Given the following SQL query and context: Query: SELECT Song FROM volume WHERE Weeks_on_Top > 1 Context: CREATE TABLE volume (Song VARCHAR, Weeks_on_Top INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the songs in volumes with more than 1 week on top? The answer to yo...
SELECT Song FROM volume ORDER BY Song
CREATE TABLE volume (Song VARCHAR)
Please list all songs in volumes in ascending alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT Song FROM volume ORDER BY Song Context: CREATE TABLE volume (Song VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please list all songs in volumes in ascending alphabetical order. The answer to your question is: SELECT So...
SELECT COUNT(DISTINCT Artist_ID) FROM volume
CREATE TABLE volume (Artist_ID VARCHAR)
How many distinct artists do the volumes associate to?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT Artist_ID) FROM volume Context: CREATE TABLE volume (Artist_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many distinct artists do the volumes associate to? The answer to your question is: SELECT C...