answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2
CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Volume VARCHAR); CREATE TABLE volume (Volume_ID VARCHAR, Weeks_on_Top INTEGER)
Please show the date of ceremony of the volumes that last more than 2 weeks on top.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Date_of_ceremony FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T2.Weeks_on_Top > 2 Context: CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Volume VARCHAR); CREATE TABLE volume (Volume_ID VARCHAR, Weeks_on_Top I...
SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = "Nominated"
CREATE TABLE volume (Song VARCHAR, Volume_ID VARCHAR); CREATE TABLE music_festival (Volume VARCHAR, Result VARCHAR)
Please show the songs that have result "nominated" at music festivals.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Song FROM music_festival AS T1 JOIN volume AS T2 ON T1.Volume = T2.Volume_ID WHERE T1.Result = "Nominated" Context: CREATE TABLE volume (Song VARCHAR, Volume_ID VARCHAR); CREATE TABLE music_festival (Volume VARCHAR, Result VARCHAR) [/INST] Based on t...
SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth"
CREATE TABLE artist (Artist_ID VARCHAR, Artist VARCHAR); CREATE TABLE volume (Issue_Date VARCHAR, Artist_ID VARCHAR)
What are the issue dates of volumes associated with the artist "Gorgoroth"?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.Artist = "Gorgoroth" Context: CREATE TABLE artist (Artist_ID VARCHAR, Artist VARCHAR); CREATE TABLE volume (Issue_Date VARCHAR, Artist_ID VARCHAR) [/INST] Based on...
SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32
CREATE TABLE volume (Song VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR)
What are the songs in volumes associated with the artist aged 32 or older?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Song FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age >= 32 Context: CREATE TABLE volume (Song VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query an...
SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25
CREATE TABLE volume (Weeks_on_Top INTEGER, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR)
What is the average weeks on top of volumes associated with the artist aged 25 or younger?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.Weeks_on_Top) FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 25 Context: CREATE TABLE volume (Weeks_on_Top INTEGER, Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR) [/INST] Based on the ...
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2
CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER)
What are the famous title of the artists associated with volumes with more than 2 weeks on top?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 Context: CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER) [/INST] Ba...
SELECT Famous_Title, Age FROM artist ORDER BY Age DESC
CREATE TABLE artist (Famous_Title VARCHAR, Age VARCHAR)
Please list the age and famous title of artists in descending order of age.
<s>[INST] Given the following SQL query and context: Query: SELECT Famous_Title, Age FROM artist ORDER BY Age DESC Context: CREATE TABLE artist (Famous_Title VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please list the age and famous title of artists in descending order o...
SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1
CREATE TABLE artist (Famous_Release_date VARCHAR, Age VARCHAR)
What is the famous release date of the artist with the oldest age?
<s>[INST] Given the following SQL query and context: Query: SELECT Famous_Release_date FROM artist ORDER BY Age DESC LIMIT 1 Context: CREATE TABLE artist (Famous_Release_date VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the famous release date of the artist with t...
SELECT Category, COUNT(*) FROM music_festival GROUP BY Category
CREATE TABLE music_festival (Category VARCHAR)
Please show the categories of the music festivals and the count.
<s>[INST] Given the following SQL query and context: Query: SELECT Category, COUNT(*) FROM music_festival GROUP BY Category Context: CREATE TABLE music_festival (Category VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the categories of the music festivals and the count. The ...
SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE music_festival (RESULT VARCHAR)
What is the most common result of the music festival?
<s>[INST] Given the following SQL query and context: Query: SELECT RESULT FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE music_festival (RESULT VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the most common result of the music festival? ...
SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1
CREATE TABLE music_festival (Category VARCHAR)
Please show the categories of the music festivals with count more than 1.
<s>[INST] Given the following SQL query and context: Query: SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1 Context: CREATE TABLE music_festival (Category VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the categories of the music festivals with coun...
SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1
CREATE TABLE volume (Song VARCHAR, Weeks_on_Top VARCHAR)
What is the song in the volume with the maximum weeks on top?
<s>[INST] Given the following SQL query and context: Query: SELECT Song FROM volume ORDER BY Weeks_on_Top DESC LIMIT 1 Context: CREATE TABLE volume (Song VARCHAR, Weeks_on_Top VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the song in the volume with the maximum weeks on top? Th...
SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume)
CREATE TABLE volume (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR)
Find the famous titles of artists that do not have any volume.
<s>[INST] Given the following SQL query and context: Query: SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume) Context: CREATE TABLE volume (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR) [/INST] Based on the provided SQL query ...
SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2
CREATE TABLE artist (Famous_Title VARCHAR, Artist_ID VARCHAR); CREATE TABLE volume (Artist_ID VARCHAR, Weeks_on_Top INTEGER)
Show the famous titles of the artists with both volumes that lasted more than 2 weeks on top and volumes that lasted less than 2 weeks on top.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top > 2 INTERSECT SELECT T1.Famous_Title FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T2.Weeks_on_Top < 2 Context: CREATE TA...
SELECT Date_of_ceremony FROM music_festival WHERE Category = "Best Song" AND RESULT = "Awarded"
CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Category VARCHAR, RESULT VARCHAR)
What are the date of ceremony of music festivals with category "Best Song" and result "Awarded"?
<s>[INST] Given the following SQL query and context: Query: SELECT Date_of_ceremony FROM music_festival WHERE Category = "Best Song" AND RESULT = "Awarded" Context: CREATE TABLE music_festival (Date_of_ceremony VARCHAR, Category VARCHAR, RESULT VARCHAR) [/INST] Based on the provided SQL query and context, your question...
SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top LIMIT 1
CREATE TABLE volume (Issue_Date VARCHAR, Weeks_on_Top VARCHAR)
What is the issue date of the volume with the minimum weeks on top?
<s>[INST] Given the following SQL query and context: Query: SELECT Issue_Date FROM volume ORDER BY Weeks_on_Top LIMIT 1 Context: CREATE TABLE volume (Issue_Date VARCHAR, Weeks_on_Top VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the issue date of the volume with the minimum wee...
SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC
CREATE TABLE music_festival (RESULT VARCHAR)
Please show the results of music festivals and the number of music festivals that have had each, ordered by this count.
<s>[INST] Given the following SQL query and context: Query: SELECT RESULT, COUNT(*) FROM music_festival GROUP BY RESULT ORDER BY COUNT(*) DESC Context: CREATE TABLE music_festival (RESULT VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the results of music festivals and the n...
SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23
CREATE TABLE volume (Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR)
What are the issue dates of volumes associated with the artist aged 23 or younger?
<s>[INST] Given the following SQL query and context: Query: SELECT Issue_Date FROM artist AS T1 JOIN volume AS T2 ON T1.Artist_ID = T2.Artist_ID WHERE T1.age <= 23 Context: CREATE TABLE volume (Artist_ID VARCHAR); CREATE TABLE artist (Artist_ID VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, ...
SELECT COUNT(*) FROM roller_coaster
CREATE TABLE roller_coaster (Id VARCHAR)
How many roller coasters are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM roller_coaster Context: CREATE TABLE roller_coaster (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many roller coasters are there? The answer to your question is: SELECT COUNT(*) FROM roller_coaster...
SELECT Name FROM roller_coaster ORDER BY LENGTH
CREATE TABLE roller_coaster (Name VARCHAR, LENGTH VARCHAR)
List the names of roller coasters by ascending order of length.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM roller_coaster ORDER BY LENGTH Context: CREATE TABLE roller_coaster (Name VARCHAR, LENGTH VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of roller coasters by ascending order of length. The answe...
SELECT LENGTH, Height FROM roller_coaster
CREATE TABLE roller_coaster (LENGTH VARCHAR, Height VARCHAR)
What are the lengths and heights of roller coasters?
<s>[INST] Given the following SQL query and context: Query: SELECT LENGTH, Height FROM roller_coaster Context: CREATE TABLE roller_coaster (LENGTH VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the lengths and heights of roller coasters? The answer to your quest...
SELECT Name FROM country WHERE Languages <> "German"
CREATE TABLE country (Name VARCHAR, Languages VARCHAR)
List the names of countries whose language is not "German".
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM country WHERE Languages <> "German" Context: CREATE TABLE country (Name VARCHAR, Languages VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of countries whose language is not "German". The answer t...
SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100
CREATE TABLE roller_coaster (Status VARCHAR, LENGTH VARCHAR, Height VARCHAR)
Show the statuses of roller coasters longer than 3300 or higher than 100.
<s>[INST] Given the following SQL query and context: Query: SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100 Context: CREATE TABLE roller_coaster (Status VARCHAR, LENGTH VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the statuses of roller coast...
SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1
CREATE TABLE roller_coaster (Speed VARCHAR, LENGTH VARCHAR)
What are the speeds of the longest roller coaster?
<s>[INST] Given the following SQL query and context: Query: SELECT Speed FROM roller_coaster ORDER BY LENGTH DESC LIMIT 1 Context: CREATE TABLE roller_coaster (Speed VARCHAR, LENGTH VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the speeds of the longest roller coaster? The ans...
SELECT AVG(Speed) FROM roller_coaster
CREATE TABLE roller_coaster (Speed INTEGER)
What is the average speed of roller coasters?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Speed) FROM roller_coaster Context: CREATE TABLE roller_coaster (Speed INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average speed of roller coasters? The answer to your question is: SELECT AVG(Speed) FR...
SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status
CREATE TABLE roller_coaster (Status VARCHAR)
Show the different statuses and the numbers of roller coasters for each status.
<s>[INST] Given the following SQL query and context: Query: SELECT Status, COUNT(*) FROM roller_coaster GROUP BY Status Context: CREATE TABLE roller_coaster (Status VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the different statuses and the numbers of roller coasters for each sta...
SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE roller_coaster (Status VARCHAR)
Please show the most common status of roller coasters.
<s>[INST] Given the following SQL query and context: Query: SELECT Status FROM roller_coaster GROUP BY Status ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE roller_coaster (Status VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the most common status of roller coasters....
SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2
CREATE TABLE roller_coaster (Status VARCHAR)
List the status shared by more than two roller coaster.
<s>[INST] Given the following SQL query and context: Query: SELECT Status FROM roller_coaster GROUP BY Status HAVING COUNT(*) > 2 Context: CREATE TABLE roller_coaster (Status VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the status shared by more than two roller coaster. The answe...
SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
CREATE TABLE roller_coaster (Park VARCHAR, Speed VARCHAR)
Show the park of the roller coaster with the highest speed.
<s>[INST] Given the following SQL query and context: Query: SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1 Context: CREATE TABLE roller_coaster (Park VARCHAR, Speed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the park of the roller coaster with the highest speed. Th...
SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID
CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Name VARCHAR, Country_ID VARCHAR)
Show the names of roller coasters and names of country they are in.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID Context: CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Name VARCHAR, Country_ID VARCHAR) [/INST] Based on the provided...
SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1
CREATE TABLE roller_coaster (Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR)
Show the names of countries that have more than one roller coaster.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name HAVING COUNT(*) > 1 Context: CREATE TABLE roller_coaster (Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR) [/INST] Based o...
SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1
CREATE TABLE roller_coaster (Country_ID VARCHAR, Height VARCHAR); CREATE TABLE country (Name VARCHAR, population VARCHAR, Country_ID VARCHAR)
Show the name and population of the country that has the highest roller coaster.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID ORDER BY T2.Height DESC LIMIT 1 Context: CREATE TABLE roller_coaster (Country_ID VARCHAR, Height VARCHAR); CREATE TABLE country (Name VARCHAR, populatio...
SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name
CREATE TABLE roller_coaster (Speed INTEGER, Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR)
Show the names of countries and the average speed of roller coasters from each country.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, AVG(T2.Speed) FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID GROUP BY T1.Name Context: CREATE TABLE roller_coaster (Speed INTEGER, Country_ID VARCHAR); CREATE TABLE country (Name VARCHAR, Country_ID VARCHAR) [/INS...
SELECT COUNT(*) FROM country WHERE NOT country_id IN (SELECT country_id FROM roller_coaster WHERE LENGTH > 3000)
CREATE TABLE country (country_id VARCHAR, LENGTH INTEGER); CREATE TABLE roller_coaster (country_id VARCHAR, LENGTH INTEGER)
How many countries do not have an roller coaster longer than 3000?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM country WHERE NOT country_id IN (SELECT country_id FROM roller_coaster WHERE LENGTH > 3000) Context: CREATE TABLE country (country_id VARCHAR, LENGTH INTEGER); CREATE TABLE roller_coaster (country_id VARCHAR, LENGTH INTEGER) [/INST] Based ...
SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed < 55
CREATE TABLE country (name VARCHAR, area VARCHAR, population VARCHAR, Country_ID VARCHAR); CREATE TABLE roller_coaster (Country_ID VARCHAR, speed INTEGER)
What are the country names, area and population which has both roller coasters with speed higher
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country_ID WHERE T2.speed > 60 INTERSECT SELECT T1.name, T1.area, T1.population FROM country AS T1 JOIN roller_coaster AS T2 ON T1.Country_ID = T2.Country...
SELECT COUNT(DISTINCT rank) FROM captain
CREATE TABLE captain (rank VARCHAR)
How many different captain ranks are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT rank) FROM captain Context: CREATE TABLE captain (rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different captain ranks are there? The answer to your question is: SELECT COUNT(DISTINCT rank)...
SELECT COUNT(*), rank FROM captain GROUP BY rank
CREATE TABLE captain (rank VARCHAR)
How many captains are in each rank?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), rank FROM captain GROUP BY rank Context: CREATE TABLE captain (rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many captains are in each rank? The answer to your question is: SELECT COUNT(*), rank FROM ...
SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank
CREATE TABLE captain (rank VARCHAR, age INTEGER)
How many captains with younger than 50 are in each rank?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), rank FROM captain WHERE age < 50 GROUP BY rank Context: CREATE TABLE captain (rank VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many captains with younger than 50 are in each rank? The answer...
SELECT name FROM captain ORDER BY age DESC
CREATE TABLE captain (name VARCHAR, age VARCHAR)
Sort all captain names by their ages from old to young.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM captain ORDER BY age DESC Context: CREATE TABLE captain (name VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Sort all captain names by their ages from old to young. The answer to your question is: ...
SELECT name, CLASS, rank FROM captain
CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, rank VARCHAR)
Find the name, class and rank of all captains.
<s>[INST] Given the following SQL query and context: Query: SELECT name, CLASS, rank FROM captain Context: CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, class and rank of all captains. The answer to your question is...
SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE captain (rank VARCHAR)
Which rank is the most common among captains?
<s>[INST] Given the following SQL query and context: Query: SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE captain (rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which rank is the most common among captains? The answer to your question ...
SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2
CREATE TABLE captain (CLASS VARCHAR)
Which classes have more than two captains?
<s>[INST] Given the following SQL query and context: Query: SELECT CLASS FROM captain GROUP BY CLASS HAVING COUNT(*) > 2 Context: CREATE TABLE captain (CLASS VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which classes have more than two captains? The answer to your question is: SELECT ...
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
CREATE TABLE captain (name VARCHAR, rank VARCHAR)
Find the name of captains whose rank are either Midshipman or Lieutenant.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant' Context: CREATE TABLE captain (name VARCHAR, rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of captains whose rank are either Midshipm...
SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS
CREATE TABLE captain (CLASS VARCHAR, age INTEGER)
What are the average and minimum age of captains in different class?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(age), MIN(age), CLASS FROM captain GROUP BY CLASS Context: CREATE TABLE captain (CLASS VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the average and minimum age of captains in different class? ...
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR)
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
<s>[INST] Given the following SQL query and context: Query: SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner' Context: CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the captai...
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR)
Find the captain rank that has no captain in Third-rate ship of the line class.
<s>[INST] Given the following SQL query and context: Query: SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line' Context: CREATE TABLE captain (rank VARCHAR, CLASS VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the captain rank that h...
SELECT name FROM captain ORDER BY age LIMIT 1
CREATE TABLE captain (name VARCHAR, age VARCHAR)
What is the name of the youngest captain?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM captain ORDER BY age LIMIT 1 Context: CREATE TABLE captain (name VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the youngest captain? The answer to your question is: SELECT name...
SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1
CREATE TABLE ship (name VARCHAR, TYPE VARCHAR, flag VARCHAR, built_year VARCHAR)
Find the name, type, and flag of the ship that is built in the most recent year.
<s>[INST] Given the following SQL query and context: Query: SELECT name, TYPE, flag FROM ship ORDER BY built_year DESC LIMIT 1 Context: CREATE TABLE ship (name VARCHAR, TYPE VARCHAR, flag VARCHAR, built_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, type, and flag of...
SELECT COUNT(*), flag FROM ship GROUP BY flag
CREATE TABLE ship (flag VARCHAR)
Group by ships by flag, and return number of ships that have each flag.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), flag FROM ship GROUP BY flag Context: CREATE TABLE ship (flag VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Group by ships by flag, and return number of ships that have each flag. The answer to your question i...
SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE ship (flag VARCHAR)
Which flag is most widely used among all ships?
<s>[INST] Given the following SQL query and context: Query: SELECT flag FROM ship GROUP BY flag ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE ship (flag VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which flag is most widely used among all ships? The answer to your question is: ...
SELECT name FROM ship ORDER BY built_year, CLASS
CREATE TABLE ship (name VARCHAR, built_year VARCHAR, CLASS VARCHAR)
List all ship names in the order of built year and class.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM ship ORDER BY built_year, CLASS Context: CREATE TABLE ship (name VARCHAR, built_year VARCHAR, CLASS VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all ship names in the order of built year and class. The a...
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
CREATE TABLE ship (TYPE VARCHAR, flag VARCHAR)
Find the ship type that are used by both ships with Panama and Malta flags.
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta' Context: CREATE TABLE ship (TYPE VARCHAR, flag VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the ship type that are used by ...
SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE ship (built_year VARCHAR)
In which year were most of ships built?
<s>[INST] Given the following SQL query and context: Query: SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE ship (built_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: In which year were most of ships built? The answer to your que...
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1
CREATE TABLE captain (ship_id VARCHAR); CREATE TABLE ship (name VARCHAR, ship_id VARCHAR)
Find the name of the ships that have more than one captain.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING COUNT(*) > 1 Context: CREATE TABLE captain (ship_id VARCHAR); CREATE TABLE ship (name VARCHAR, ship_id VARCHAR) [/INST] Based on the provided SQL query and ...
SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain)
CREATE TABLE ship (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR); CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR)
what are the names and classes of the ships that do not have any captain yet?
<s>[INST] Given the following SQL query and context: Query: SELECT name, CLASS FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain) Context: CREATE TABLE ship (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR); CREATE TABLE captain (name VARCHAR, CLASS VARCHAR, ship_id VARCHAR) [/INST] Based on the provided SQL que...
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, age VARCHAR)
Find the name of the ship that is steered by the youngest captain.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1 Context: CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and con...
SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
CREATE TABLE captain (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR); CREATE TABLE ship (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR)
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
<s>[INST] Given the following SQL query and context: Query: SELECT name, flag FROM ship WHERE NOT ship_id IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman') Context: CREATE TABLE captain (name VARCHAR, flag VARCHAR, ship_id VARCHAR, rank VARCHAR); CREATE TABLE ship (name VARCHAR, flag VARCHAR, ship_id VARCHAR, ...
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
CREATE TABLE ship (name VARCHAR, ship_id VARCHAR); CREATE TABLE captain (ship_id VARCHAR, rank VARCHAR)
Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant' Context: CREATE TABLE ship (name VARCH...
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
CREATE TABLE hosting_city (host_city VARCHAR, YEAR VARCHAR)
What is id of the city that hosted events in the most recent year?
<s>[INST] Given the following SQL query and context: Query: SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1 Context: CREATE TABLE hosting_city (host_city VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is id of the city that hosted events in the most rece...
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
CREATE TABLE MATCH (match_id VARCHAR, competition VARCHAR)
Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?
<s>[INST] Given the following SQL query and context: Query: SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification" Context: CREATE TABLE MATCH (match_id VARCHAR, competition VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the match ids of the cities that ...
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, year INTEGER)
Find the cities which were once a host city after 2010?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010 Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, year INTEGER) [/INST] Based on the provided SQL q...
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR)
Which city has hosted the most events?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR) [/INST] Based on ...
SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE MATCH (venue VARCHAR, match_id VARCHAR, competition VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR, match_id VARCHAR)
What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification" Context: CREATE TABLE city (city_i...
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE temperature (Jan VARCHAR, city_id VARCHAR)
Give me the temperature of Shanghai in January.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai" Context: CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE temperature (Jan VARCHAR, city_id VARCHAR) [/INST] Based on the provided SQL que...
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE hosting_city (year VARCHAR, host_city VARCHAR)
What is the host year of city "Taizhou ( Zhejiang )"?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )" Context: CREATE TABLE city (city_id VARCHAR, city VARCHAR); CREATE TABLE hosting_city (year VARCHAR, host_city VARCHAR) [/INST] Based on ...
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
CREATE TABLE city (city VARCHAR, regional_population VARCHAR)
Which three cities have the largest regional population?
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM city ORDER BY regional_population DESC LIMIT 3 Context: CREATE TABLE city (city VARCHAR, regional_population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which three cities have the largest regional populatio...
SELECT city, GDP FROM city ORDER BY GDP LIMIT 1
CREATE TABLE city (city VARCHAR, GDP VARCHAR)
Which city has the lowest GDP? Please list the city name and its GDP.
<s>[INST] Given the following SQL query and context: Query: SELECT city, GDP FROM city ORDER BY GDP LIMIT 1 Context: CREATE TABLE city (city VARCHAR, GDP VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which city has the lowest GDP? Please list the city name and its GDP. The answer to yo...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb VARCHAR)
Which city has the highest temperature in February?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1 Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb VARCHAR) [/INST] Based on the provided SQL ...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar VARCHAR, Jul VARCHAR, Oct VARCHAR)
Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar VARCHAR, Jul VARCHAR, Oct VARCH...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar INTEGER, Jul VARCHAR)
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CRE...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Mar INTEGER, Dec VARCHAR)
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE...
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE temperature (city_id VARCHAR, Feb INTEGER, Jun VARCHAR)
Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city Context: CREATE TABLE city (city VARCHAR, city_id VARCHAR); CREATE ...
SELECT city FROM city WHERE regional_population > 10000000
CREATE TABLE city (city VARCHAR, regional_population INTEGER)
Please give me a list of cities whose regional population is over 10000000.
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM city WHERE regional_population > 10000000 Context: CREATE TABLE city (city VARCHAR, regional_population INTEGER) [/INST] Based on the provided SQL query and context, your question is: Please give me a list of cities whose regional population i...
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
CREATE TABLE city (city VARCHAR, regional_population INTEGER)
Please give me a list of cities whose regional population is over 8000000 or under 5000000.
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000 Context: CREATE TABLE city (city VARCHAR, regional_population INTEGER) [/INST] Based on the provided SQL query and context, your question...
SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition
CREATE TABLE MATCH (Competition VARCHAR)
Find the number of matches in different competitions.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), Competition FROM MATCH GROUP BY Competition Context: CREATE TABLE MATCH (Competition VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of matches in different competitions. The answer to your quest...
SELECT venue FROM MATCH ORDER BY date DESC
CREATE TABLE MATCH (venue VARCHAR, date VARCHAR)
List venues of all matches in the order of their dates starting from the most recent one.
<s>[INST] Given the following SQL query and context: Query: SELECT venue FROM MATCH ORDER BY date DESC Context: CREATE TABLE MATCH (venue VARCHAR, date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List venues of all matches in the order of their dates starting from the most recent one...
SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
CREATE TABLE city (gdp VARCHAR, Regional_Population VARCHAR)
what is the GDP of the city with the largest population.
<s>[INST] Given the following SQL query and context: Query: SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1 Context: CREATE TABLE city (gdp VARCHAR, Regional_Population VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what is the GDP of the city with the largest population....
SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1
CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE city (city_id VARCHAR)
What are the GDP and population of the city that already served as a host more than once?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.gdp, t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING COUNT(*) > 1 Context: CREATE TABLE hosting_city (host_city VARCHAR); CREATE TABLE city (city_id VARCHAR) [/INST] Based on th...
SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name
CREATE TABLE individuals (individual_first_name VARCHAR, individual_middle_name VARCHAR, individual_last_name VARCHAR)
List every individual's first name, middle name and last name in alphabetical order by last name.
<s>[INST] Given the following SQL query and context: Query: SELECT individual_first_name, individual_middle_name, individual_last_name FROM individuals ORDER BY individual_last_name Context: CREATE TABLE individuals (individual_first_name VARCHAR, individual_middle_name VARCHAR, individual_last_name VARCHAR) [/INST] Ba...
SELECT DISTINCT form_type_code FROM forms
CREATE TABLE forms (form_type_code VARCHAR)
List all the types of forms.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT form_type_code FROM forms Context: CREATE TABLE forms (form_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the types of forms. The answer to your question is: SELECT DISTINCT form_type_code FR...
SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE forms (form_name VARCHAR, form_id VARCHAR)
Find the name of the most popular party form.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE forms (form_name VARCHAR, form_id VARCHAR) [/INST] Based...
SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com"
CREATE TABLE parties (payment_method_code VARCHAR, party_phone VARCHAR, party_email VARCHAR)
Find the payment method and phone of the party with email "enrico09@example.com".
<s>[INST] Given the following SQL query and context: Query: SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com" Context: CREATE TABLE parties (payment_method_code VARCHAR, party_phone VARCHAR, party_email VARCHAR) [/INST] Based on the provided SQL query and context, your ques...
SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1)
CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_forms (party_id VARCHAR, form_id VARCHAR)
Find the emails of parties with the most popular party form.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY COUNT(*) DESC LIMIT 1) Context: CREATE TABLE party_forms (form_id VARCHAR); CREATE TABLE ...
SELECT organization_name FROM organizations ORDER BY date_formed
CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR)
List all the name of organizations in order of the date formed.
<s>[INST] Given the following SQL query and context: Query: SELECT organization_name FROM organizations ORDER BY date_formed Context: CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the name of organizations in o...
SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR)
Find the name of the youngest organization.
<s>[INST] Given the following SQL query and context: Query: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1 Context: CREATE TABLE organizations (organization_name VARCHAR, date_formed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the young...
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
CREATE TABLE organizations (organization_id VARCHAR, organization_name VARCHAR); CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization_contact_individuals (organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR)
Find the last name of the latest contact individual of the organization "Labour Party".
<s>[INST] Given the following SQL query and context: Query: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2...
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to LIMIT 1
CREATE TABLE organizations (uk_vat_number INTEGER); CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organizations (organization_id VARCHAR, uk_vat_number INTEGER); CREATE TABLE organization_contact_individuals (organization_id VARCHAR, individual_id VARCHAR, date_contact_to ...
Find the last name of the first ever contact person of the organization with the highest UK Vat number.
<s>[INST] Given the following SQL query and context: Query: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FRO...
SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id
CREATE TABLE services (service_name VARCHAR); CREATE TABLE party_services (service_id VARCHAR); CREATE TABLE services (service_name VARCHAR, service_id VARCHAR)
Find name of the services that has never been used.
<s>[INST] Given the following SQL query and context: Query: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id Context: CREATE TABLE services (service_name VARCHAR); CREATE TABLE party_services (service_id VARCHAR); CREATE TABLE...
SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
CREATE TABLE addresses (town_city VARCHAR, state_province_county VARCHAR)
Find the name of all the cities and states.
<s>[INST] Given the following SQL query and context: Query: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses Context: CREATE TABLE addresses (town_city VARCHAR, state_province_county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of all the...
SELECT COUNT(*) FROM addresses WHERE state_province_county = "Colorado"
CREATE TABLE addresses (state_province_county VARCHAR)
How many cities are there in state "Colorado"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM addresses WHERE state_province_county = "Colorado" Context: CREATE TABLE addresses (state_province_county VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many cities are there in state "Colorado"? The an...
SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3
CREATE TABLE parties (payment_method_code VARCHAR)
Find the payment method code used by more than 3 parties.
<s>[INST] Given the following SQL query and context: Query: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING COUNT(*) > 3 Context: CREATE TABLE parties (payment_method_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the payment method code used by mor...
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
CREATE TABLE organizations (organization_name VARCHAR)
Find the name of organizations whose names contain "Party".
<s>[INST] Given the following SQL query and context: Query: SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%" Context: CREATE TABLE organizations (organization_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of organizations whose names...
SELECT COUNT(DISTINCT payment_method_code) FROM parties
CREATE TABLE parties (payment_method_code VARCHAR)
How many distinct payment methods are used by parties?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT payment_method_code) FROM parties Context: CREATE TABLE parties (payment_method_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many distinct payment methods are used by parties? The answer to your...
SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_services (customer_id VARCHAR)
Which is the email of the party that has used the services the most number of times?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE parties (party_email VARCHAR, party_id VARCHAR); CREATE TABLE party_services (custom...
SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%"
CREATE TABLE addresses (state_province_county VARCHAR, line_1_number_building VARCHAR)
Which state can address "6862 Kaitlyn Knolls" possibly be in?
<s>[INST] Given the following SQL query and context: Query: SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%" Context: CREATE TABLE addresses (state_province_county VARCHAR, line_1_number_building VARCHAR) [/INST] Based on the provided SQL query and context, your ques...
SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE organization_contact_individuals (organization_id VARCHAR); CREATE TABLE organizations (organization_name VARCHAR, organization_id VARCHAR)
What is the name of organization that has the greatest number of contact individuals?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE organization_contact_individuals (org...
SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id
CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization_contact_individuals (individual_id VARCHAR)
Find the last name of the individuals that have been contact individuals of an organization.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id Context: CREATE TABLE individuals (individual_last_name VARCHAR, individual_id VARCHAR); CREATE TABLE organization...
SELECT COUNT(*) FROM driver
CREATE TABLE driver (Id VARCHAR)
How many drivers are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM driver Context: CREATE TABLE driver (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many drivers are there? The answer to your question is: SELECT COUNT(*) FROM driver. [/s>
SELECT name, home_city, age FROM driver
CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR)
Show the name, home city, and age for all drivers.
<s>[INST] Given the following SQL query and context: Query: SELECT name, home_city, age FROM driver Context: CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name, home city, and age for all drivers. The answer to your que...
SELECT party, COUNT(*) FROM driver GROUP BY party
CREATE TABLE driver (party VARCHAR)
Show the party and the number of drivers in each party.
<s>[INST] Given the following SQL query and context: Query: SELECT party, COUNT(*) FROM driver GROUP BY party Context: CREATE TABLE driver (party VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the party and the number of drivers in each party. The answer to your question is: SELECT...