answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (firstname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR)
Find the first name of the band mate that has performed in most songs.
<s>[INST] Given the following SQL query and context: Query: SELECT t2.firstname FROM Performance AS t1 JOIN Band AS t2 ON t1.bandmate = t2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY firstname ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Songs (SongId VARCHAR); CREATE TABLE Band (firstname VARCHAR, id...
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Marianne" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR)
Which vocal type has the band mate with first name "Marianne" played the most?
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Marianne" GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE vocals (bandmate VARCHAR); CREATE TABLE band (id VARCHAR) [/INST] Based on the provided SQL que...
SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Der Kapitan" AND T1.StagePosition = "back"
CREATE TABLE Band (firstname VARCHAR, lastname VARCHAR, id VARCHAR); CREATE TABLE Performance (bandmate VARCHAR, SongId VARCHAR, StagePosition VARCHAR); CREATE TABLE Songs (SongId VARCHAR, Title VARCHAR)
Who is performing in the back stage position for the song "Der Kapitan"? Show the first name and last name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.firstname, T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Der Kapitan" AND T1.StagePosition = "back" Context: CREATE TABLE Band (firstname VARCHAR, lastname VARCHA...
SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = "A Kiss Before You Go: Live in Hamburg"
CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR, title VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR)
What are the songs in album "A Kiss Before You Go: Live in Hamburg"?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = "A Kiss Before You Go: Live in Hamburg" Context: CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (...
SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = "Universal Music Group"
CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR)
What are all the songs in albums under label "Universal Music Group"?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.label = "Universal Music Group" Context: CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CR...
SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = "Studio"
CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CREATE TABLE tracklists (albumid VARCHAR, songid VARCHAR)
Find the number of songs in all the studio albums.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT T3.title) FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE t1.type = "Studio" Context: CREATE TABLE songs (title VARCHAR, songid VARCHAR); CREATE TABLE albums (aid VARCHAR); CR...
SELECT founder FROM manufacturers WHERE name = 'Sony'
CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR)
Who is the founder of Sony?
<s>[INST] Given the following SQL query and context: Query: SELECT founder FROM manufacturers WHERE name = 'Sony' Context: CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who is the founder of Sony? The answer to your question is: SELECT ...
SELECT headquarter FROM manufacturers WHERE founder = 'James'
CREATE TABLE manufacturers (headquarter VARCHAR, founder VARCHAR)
Where is the headquarter of the company founded by James?
<s>[INST] Given the following SQL query and context: Query: SELECT headquarter FROM manufacturers WHERE founder = 'James' Context: CREATE TABLE manufacturers (headquarter VARCHAR, founder VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Where is the headquarter of the company founded by J...
SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC
CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR)
Find all manufacturers' names and their headquarters, sorted by the ones with highest revenue first.
<s>[INST] Given the following SQL query and context: Query: SELECT name, headquarter FROM manufacturers ORDER BY revenue DESC Context: CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all manufacturers' names and ...
SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers
CREATE TABLE manufacturers (revenue INTEGER)
What are the average, maximum and total revenues of all companies?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(revenue), MAX(revenue), SUM(revenue) FROM manufacturers Context: CREATE TABLE manufacturers (revenue INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the average, maximum and total revenues of all companies? T...
SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy'
CREATE TABLE manufacturers (founder VARCHAR)
How many companies were created by Andy?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM manufacturers WHERE founder = 'Andy' Context: CREATE TABLE manufacturers (founder VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many companies were created by Andy? The answer to your question is: SELE...
SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin'
CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR)
Find the total revenue created by the companies whose headquarter is located at Austin.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(revenue) FROM manufacturers WHERE headquarter = 'Austin' Context: CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total revenue created by the companie...
SELECT DISTINCT headquarter FROM manufacturers
CREATE TABLE manufacturers (headquarter VARCHAR)
What are the different cities listed?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT headquarter FROM manufacturers Context: CREATE TABLE manufacturers (headquarter VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the different cities listed? The answer to your question is: SELECT DISTINC...
SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'
CREATE TABLE manufacturers (headquarter VARCHAR)
Find the number of manufactures that are based in Tokyo or Beijing.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing' Context: CREATE TABLE manufacturers (headquarter VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of manufactures that are ...
SELECT founder FROM manufacturers WHERE name LIKE 'S%'
CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR)
Find the founder of the company whose name begins with the letter 'S'.
<s>[INST] Given the following SQL query and context: Query: SELECT founder FROM manufacturers WHERE name LIKE 'S%' Context: CREATE TABLE manufacturers (founder VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the founder of the company whose name begins with the letter ...
SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150
CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER)
Find the name of companies whose revenue is between 100 and 150.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM manufacturers WHERE revenue BETWEEN 100 AND 150 Context: CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of companies whose revenue is between 100 ...
SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan'
CREATE TABLE manufacturers (revenue INTEGER, Headquarter VARCHAR)
What is the total revenue of all companies whose main office is at Tokyo or Taiwan?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(revenue) FROM manufacturers WHERE Headquarter = 'Tokyo' OR Headquarter = 'Taiwan' Context: CREATE TABLE manufacturers (revenue INTEGER, Headquarter VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total rev...
SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'
CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR)
Find the name of product that is produced by both companies Creative Labs and Sony.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony' Context: CREATE T...
SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1
CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, founder VARCHAR, revenue VARCHAR)
Find the name, headquarter and founder of the manufacturer that has the highest revenue.
<s>[INST] Given the following SQL query and context: Query: SELECT name, headquarter, founder FROM manufacturers ORDER BY revenue DESC LIMIT 1 Context: CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, founder VARCHAR, revenue VARCHAR) [/INST] Based on the provided SQL query and context, your question is: ...
SELECT name, headquarter, revenue FROM manufacturers ORDER BY revenue DESC
CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR)
Find the name, headquarter and revenue of all manufacturers sorted by their revenue in the descending order.
<s>[INST] Given the following SQL query and context: Query: SELECT name, headquarter, revenue FROM manufacturers ORDER BY revenue DESC Context: CREATE TABLE manufacturers (name VARCHAR, headquarter VARCHAR, revenue VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, headquarte...
SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers)
CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER)
Find the name of companies whose revenue is greater than the average revenue of all companies.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM manufacturers WHERE revenue > (SELECT AVG(revenue) FROM manufacturers) Context: CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of companies whose ...
SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')
CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER, headquarter VARCHAR)
Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM manufacturers WHERE revenue < (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin') Context: CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER, headquarter VARCHAR) [/INST] Based on the provided SQL query and context, y...
SELECT SUM(revenue) FROM manufacturers WHERE revenue > (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin')
CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR)
Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(revenue) FROM manufacturers WHERE revenue > (SELECT MIN(revenue) FROM manufacturers WHERE headquarter = 'Austin') Context: CREATE TABLE manufacturers (revenue INTEGER, headquarter VARCHAR) [/INST] Based on the provided SQL query and context, your qu...
SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder
CREATE TABLE manufacturers (founder VARCHAR, revenue INTEGER)
Find the total revenue of companies of each founder.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(revenue), founder FROM manufacturers GROUP BY founder Context: CREATE TABLE manufacturers (founder VARCHAR, revenue INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the total revenue of companies of each founder. ...
SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter
CREATE TABLE manufacturers (name VARCHAR, Headquarter VARCHAR, revenue INTEGER)
Find the name and revenue of the company that earns the highest revenue in each city.
<s>[INST] Given the following SQL query and context: Query: SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter Context: CREATE TABLE manufacturers (name VARCHAR, Headquarter VARCHAR, revenue INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name and rev...
SELECT SUM(revenue), name FROM manufacturers GROUP BY name
CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER)
Find the total revenue for each manufacturer.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(revenue), name FROM manufacturers GROUP BY name Context: CREATE TABLE manufacturers (name VARCHAR, revenue INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the total revenue for each manufacturer. The answer to yo...
SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name
CREATE TABLE products (price INTEGER, Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR)
Find the average prices of all products from each manufacture, and list each company's name.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name Context: CREATE TABLE products (price INTEGER, Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR) [/INST] Based...
SELECT COUNT(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter
CREATE TABLE manufacturers (Headquarter VARCHAR, code VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR)
Find the number of different products that are produced by companies at different headquarter cities.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT T1.name), T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter Context: CREATE TABLE manufacturers (Headquarter VARCHAR, code VARCHAR); CREATE TABLE products (name VARCHAR, Manuf...
SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony')
CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE products (name VARCHAR); CREATE TABLE products (name VARCHAR, Manufacturer VARCHAR)
Find number of products which Sony does not make.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') Context: CREATE TABLE manufacturers (code VARCHAR, name VARCHAR); CREATE TABLE product...
SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive'
CREATE TABLE manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Manufacturer VARCHAR, name VARCHAR); CREATE TABLE manufacturers (name VARCHAR)
Find the name of companies that do not make DVD drive.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive' Context: CREATE TABLE manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Manufacturer VAR...
SELECT COUNT(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name
CREATE TABLE products (Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR)
Find the number of products for each manufacturer, showing the name of each company.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name Context: CREATE TABLE products (Manufacturer VARCHAR); CREATE TABLE manufacturers (name VARCHAR, code VARCHAR) [/INST] Based on the provided SQL...
SELECT Name FROM Products
CREATE TABLE Products (Name VARCHAR)
Select the names of all the products in the store.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM Products Context: CREATE TABLE Products (Name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Select the names of all the products in the store. The answer to your question is: SELECT Name FROM Products. [/s>
SELECT name, price FROM products
CREATE TABLE products (name VARCHAR, price VARCHAR)
Select the names and the prices of all the products in the store.
<s>[INST] Given the following SQL query and context: Query: SELECT name, price FROM products Context: CREATE TABLE products (name VARCHAR, price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Select the names and the prices of all the products in the store. The answer to your question i...
SELECT name FROM products WHERE price <= 200
CREATE TABLE products (name VARCHAR, price VARCHAR)
Select the name of the products with a price less than or equal to $200.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM products WHERE price <= 200 Context: CREATE TABLE products (name VARCHAR, price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Select the name of the products with a price less than or equal to $200. The answer...
SELECT * FROM products WHERE price BETWEEN 60 AND 120
CREATE TABLE products (price INTEGER)
Find all information of all the products with a price between $60 and $120.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM products WHERE price BETWEEN 60 AND 120 Context: CREATE TABLE products (price INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find all information of all the products with a price between $60 and $120. The answer t...
SELECT AVG(price) FROM products
CREATE TABLE products (price INTEGER)
Compute the average price of all the products.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(price) FROM products Context: CREATE TABLE products (price INTEGER) [/INST] Based on the provided SQL query and context, your question is: Compute the average price of all the products. The answer to your question is: SELECT AVG(price) FROM products...
SELECT AVG(price) FROM products WHERE Manufacturer = 2
CREATE TABLE products (price INTEGER, Manufacturer VARCHAR)
Compute the average price of all products with manufacturer code equal to 2.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(price) FROM products WHERE Manufacturer = 2 Context: CREATE TABLE products (price INTEGER, Manufacturer VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Compute the average price of all products with manufacturer code ...
SELECT COUNT(*) FROM products WHERE price >= 180
CREATE TABLE products (price VARCHAR)
Compute the number of products with a price larger than or equal to $180.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM products WHERE price >= 180 Context: CREATE TABLE products (price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Compute the number of products with a price larger than or equal to $180. The answer to your ...
SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name
CREATE TABLE products (name VARCHAR, price VARCHAR)
Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).
<s>[INST] Given the following SQL query and context: Query: SELECT name, price FROM products WHERE price >= 180 ORDER BY price DESC, name Context: CREATE TABLE products (name VARCHAR, price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Select the name and price of all products with a p...
SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code
CREATE TABLE products (manufacturer VARCHAR); CREATE TABLE Manufacturers (code VARCHAR)
Select all the data from the products and each product's manufacturer.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code Context: CREATE TABLE products (manufacturer VARCHAR); CREATE TABLE Manufacturers (code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Select al...
SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer
CREATE TABLE Products (Manufacturer VARCHAR, Price INTEGER)
Select the average price of each manufacturer's products, showing only the manufacturer's code.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer Context: CREATE TABLE Products (Manufacturer VARCHAR, Price INTEGER) [/INST] Based on the provided SQL query and context, your question is: Select the average price of each manufacturer's prod...
SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR)
Select the average price of each manufacturer's products, showing the manufacturer's name.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name Context: CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR) [/INST] Based...
SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150
CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufacturer VARCHAR, price INTEGER)
Select the names of manufacturer whose products have an average price higher than or equal to $150.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150 Context: CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Price INTEGER, manufac...
SELECT name, price FROM Products ORDER BY price LIMIT 1
CREATE TABLE Products (name VARCHAR, price VARCHAR)
Select the name and price of the cheapest product.
<s>[INST] Given the following SQL query and context: Query: SELECT name, price FROM Products ORDER BY price LIMIT 1 Context: CREATE TABLE Products (name VARCHAR, price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Select the name and price of the cheapest product. The answer to your qu...
SELECT T1.Name, MAX(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Name VARCHAR, Price INTEGER, manufacturer VARCHAR)
Select the name of each manufacturer along with the name and price of its most expensive product.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, MAX(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name Context: CREATE TABLE Manufacturers (name VARCHAR, code VARCHAR); CREATE TABLE products (Name VARCHAR, Price INTEGER, manufacturer...
SELECT code, name, MIN(price) FROM products GROUP BY name
CREATE TABLE products (code VARCHAR, name VARCHAR, price INTEGER)
Select the code of the product that is cheapest in each product category.
<s>[INST] Given the following SQL query and context: Query: SELECT code, name, MIN(price) FROM products GROUP BY name Context: CREATE TABLE products (code VARCHAR, name VARCHAR, price INTEGER) [/INST] Based on the provided SQL query and context, your question is: Select the code of the product that is cheapest in each ...
SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1
CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR)
What is the id of the problem log that is created most recently?
<s>[INST] Given the following SQL query and context: Query: SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1 Context: CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the problem ...
SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1
CREATE TABLE problem_log (problem_log_id VARCHAR, problem_id VARCHAR, log_entry_date VARCHAR)
What is the oldest log id and its corresponding problem id?
<s>[INST] Given the following SQL query and context: Query: SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1 Context: CREATE TABLE problem_log (problem_log_id VARCHAR, problem_id VARCHAR, log_entry_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Wha...
SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10
CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR, problem_id VARCHAR)
Find all the ids and dates of the logs for the problem whose id is 10.
<s>[INST] Given the following SQL query and context: Query: SELECT problem_log_id, log_entry_date FROM problem_log WHERE problem_id = 10 Context: CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_date VARCHAR, problem_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all ...
SELECT problem_log_id, log_entry_description FROM problem_log
CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_description VARCHAR)
List all the log ids and their descriptions from the problem logs.
<s>[INST] Given the following SQL query and context: Query: SELECT problem_log_id, log_entry_description FROM problem_log Context: CREATE TABLE problem_log (problem_log_id VARCHAR, log_entry_description VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the log ids and their descri...
SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1
CREATE TABLE problem_log (assigned_to_staff_id VARCHAR, problem_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR)
List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1 Context: CREATE TABLE problem_log (assigned_to_staff_id VARCHAR, problem_id VARCHAR); CREATE TABLE staff ...
SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
CREATE TABLE problem_log (problem_id VARCHAR, problem_log_id VARCHAR, assigned_to_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR)
List the problem id and log id which are assigned to the staff named Rylan Homenick.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.problem_id, T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick" Context: CREATE TABLE problem_log (problem_id VARCHAR, pro...
SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR)
How many problems are there for product voluptatem?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem" Context: CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR) [/INST] Based on t...
SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id VARCHAR)
How many problems does the product with the most problems have? List the number of the problems and product name.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, pr...
SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR); CREATE TABLE problems (problem_description VARCHAR, reported_by_staff_id VARCHAR)
Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" Context: CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR); CREATE TABLE problems (problem_descript...
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco"
CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_last_name VARCHAR)
Find the ids of the problems that are reported by the staff whose last name is Bosco.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco" Context: CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff...
SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26"
CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER)
What are the ids of the problems which are reported after 1978-06-26?
<s>[INST] Given the following SQL query and context: Query: SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26" Context: CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the ids of the problem...
SELECT problem_id FROM problems WHERE date_problem_reported < "1978-06-26"
CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER)
What are the ids of the problems which are reported before 1978-06-26?
<s>[INST] Given the following SQL query and context: Query: SELECT problem_id FROM problems WHERE date_problem_reported < "1978-06-26" Context: CREATE TABLE problems (problem_id VARCHAR, date_problem_reported INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the ids of the problem...
SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id
CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR)
For each product which has problems, what are the number of problems and the product id?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id Context: CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_id VARCHAR) [/INST] Based on the provided SQL query...
SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id
CREATE TABLE product (product_id VARCHAR); CREATE TABLE problems (product_id VARCHAR, date_problem_reported INTEGER)
For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id Context: CREATE TABLE product (product_id VARCHAR); CREATE TABLE problems (product_id VA...
SELECT DISTINCT product_name FROM product ORDER BY product_name
CREATE TABLE product (product_name VARCHAR)
List the names of all the distinct product names in alphabetical order?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT product_name FROM product ORDER BY product_name Context: CREATE TABLE product (product_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all the distinct product names in alphabetical order? ...
SELECT DISTINCT product_name FROM product ORDER BY product_id
CREATE TABLE product (product_name VARCHAR, product_id VARCHAR)
List all the distinct product names ordered by product id?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT product_name FROM product ORDER BY product_id Context: CREATE TABLE product (product_name VARCHAR, product_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the distinct product names ordered by product...
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_las...
CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR)
What are the id of problems reported by the staff named Dameon Frami or Jolie Weber?
<s>[INST] Given the following SQL query and context: Query: SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.s...
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley"...
CREATE TABLE problems (reported_by_staff_id VARCHAR, closure_authorised_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR)
What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?
<s>[INST] Given the following SQL query and context: Query: SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by...
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte")
CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR)
What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < (SELECT MIN(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_fir...
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Rylan" AND T4.staff_last_name = "Homenick")
CREATE TABLE problems (problem_id VARCHAR, reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (reported_by_staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR)
What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > (SELECT MAX(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_fir...
SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC LIMIT 3
CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id VARCHAR)
Find the top 3 products which have the largest number of problems?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY COUNT(*) DESC LIMIT 3 Context: CREATE TABLE problems (product_id VARCHAR); CREATE TABLE product (product_name VARCHAR, product_id V...
SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995"
CREATE TABLE problems (problem_id VARCHAR, product_id VARCHAR, date_problem_reported VARCHAR); CREATE TABLE product (product_id VARCHAR, product_name VARCHAR)
List the ids of the problems from the product "voluptatem" that are reported after 1995?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995" Context: CREATE TABLE problems (problem_id VARCHAR, product_id VARCHAR, date_problem_reporte...
SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON...
CREATE TABLE product (product_name VARCHAR, product_id VARCHAR); CREATE TABLE staff (staff_first_name VARCHAR, staff_last_name VARCHAR, staff_id VARCHAR); CREATE TABLE problems (product_id VARCHAR, reported_by_staff_id VARCHAR)
Find the first and last name of the staff members who reported problems from the product "rem" but not "aut"?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.staff_first_name, T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name, T3.staff_last_nam...
SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.pr...
CREATE TABLE product (product_name VARCHAR, product_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, staff_first_name VARCHAR, staff_last_name VARCHAR); CREATE TABLE problems (product_id VARCHAR, reported_by_staff_id VARCHAR)
Find the products which have problems reported by both Lacey Bosco and Kenton Champlin?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM...
SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch)
CREATE TABLE branch (membership_amount INTEGER)
How many branches where have more than average number of memberships are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM branch WHERE membership_amount > (SELECT AVG(membership_amount) FROM branch) Context: CREATE TABLE branch (membership_amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many branches where have more ...
SELECT name, address_road, city FROM branch ORDER BY open_year
CREATE TABLE branch (name VARCHAR, address_road VARCHAR, city VARCHAR, open_year VARCHAR)
Show name, address road, and city for all branches sorted by open year.
<s>[INST] Given the following SQL query and context: Query: SELECT name, address_road, city FROM branch ORDER BY open_year Context: CREATE TABLE branch (name VARCHAR, address_road VARCHAR, city VARCHAR, open_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show name, address road, an...
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
CREATE TABLE branch (name VARCHAR, membership_amount VARCHAR)
What are names for top three branches with most number of membership?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3 Context: CREATE TABLE branch (name VARCHAR, membership_amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are names for top three branches with most number...
SELECT DISTINCT city FROM branch WHERE membership_amount >= 100
CREATE TABLE branch (city VARCHAR, membership_amount VARCHAR)
Show all distinct city where branches with at least 100 memberships are located.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT city FROM branch WHERE membership_amount >= 100 Context: CREATE TABLE branch (city VARCHAR, membership_amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all distinct city where branches with at least 10...
SELECT open_year FROM branch GROUP BY open_year HAVING COUNT(*) >= 2
CREATE TABLE branch (open_year VARCHAR)
List all open years when at least two shops are opened.
<s>[INST] Given the following SQL query and context: Query: SELECT open_year FROM branch GROUP BY open_year HAVING COUNT(*) >= 2 Context: CREATE TABLE branch (open_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all open years when at least two shops are opened. The answer to y...
SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London'
CREATE TABLE branch (membership_amount INTEGER, open_year VARCHAR, city VARCHAR)
Show minimum and maximum amount of memberships for all branches opened in 2011 or located at city London.
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(membership_amount), MAX(membership_amount) FROM branch WHERE open_year = 2011 OR city = 'London' Context: CREATE TABLE branch (membership_amount INTEGER, open_year VARCHAR, city VARCHAR) [/INST] Based on the provided SQL query and context, your ques...
SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city
CREATE TABLE branch (city VARCHAR, open_year INTEGER)
Show the city and the number of branches opened before 2010 for each city.
<s>[INST] Given the following SQL query and context: Query: SELECT city, COUNT(*) FROM branch WHERE open_year < 2010 GROUP BY city Context: CREATE TABLE branch (city VARCHAR, open_year INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the city and the number of branches opened before ...
SELECT COUNT(DISTINCT LEVEL) FROM member
CREATE TABLE member (LEVEL VARCHAR)
How many different levels do members have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT LEVEL) FROM member Context: CREATE TABLE member (LEVEL VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different levels do members have? The answer to your question is: SELECT COUNT(DISTINCT LEVEL)...
SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC
CREATE TABLE member (card_number VARCHAR, name VARCHAR, hometown VARCHAR, LEVEL VARCHAR)
Show card number, name, and hometown for all members in a descending order of level.
<s>[INST] Given the following SQL query and context: Query: SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC Context: CREATE TABLE member (card_number VARCHAR, name VARCHAR, hometown VARCHAR, LEVEL VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show card number, name, ...
SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE member (LEVEL VARCHAR)
Show the membership level with most number of members.
<s>[INST] Given the following SQL query and context: Query: SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE member (LEVEL VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the membership level with most number of members. The answer to your...
SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year
CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR, register_year VARCHAR); CREATE TABLE branch (name VARCHAR, branch_id VARCHAR)
Show all member names and registered branch names sorted by register year.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year Context: CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TAB...
SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id
CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, register_year INTEGER)
Show all branch names with the number of members in each branch registered after 2015.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id Context: CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register...
SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)
CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (name VARCHAR, member_id VARCHAR)
Show member names without any registered branch.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch) Context: CREATE TABLE member (name VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (name VARCHAR, member_id VARCHAR) [/INST] Based on the pro...
SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)
CREATE TABLE membership_register_branch (name VARCHAR, city VARCHAR, branch_id VARCHAR); CREATE TABLE branch (name VARCHAR, city VARCHAR, branch_id VARCHAR)
List the branch name and city without any registered members.
<s>[INST] Given the following SQL query and context: Query: SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch) Context: CREATE TABLE membership_register_branch (name VARCHAR, city VARCHAR, branch_id VARCHAR); CREATE TABLE branch (name VARCHAR, city VARCHAR, branch_id...
SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE membership_register_branch (branch_id VARCHAR, register_year VARCHAR); CREATE TABLE branch (name VARCHAR, open_year VARCHAR, branch_id VARCHAR)
What is the name and open year for the branch with most number of memberships registered in 2016?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE membership_register_branch (branch_id V...
SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016
CREATE TABLE member (name VARCHAR, hometown VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_branch (member_id VARCHAR, register_year VARCHAR)
Show the member name and hometown who registered a branch in 2016.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016 Context: CREATE TABLE member (name VARCHAR, hometown VARCHAR, member_id VARCHAR); CREATE TABLE membership_register_...
SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
CREATE TABLE branch (city VARCHAR, open_year VARCHAR, membership_amount VARCHAR)
Show all city with a branch opened in 2001 and a branch with more than 100 membership.
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100 Context: CREATE TABLE branch (city VARCHAR, open_year VARCHAR, membership_amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all city with a bra...
SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100
CREATE TABLE branch (city VARCHAR, membership_amount INTEGER)
Show all cities without a branch having more than 100 memberships.
<s>[INST] Given the following SQL query and context: Query: SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100 Context: CREATE TABLE branch (city VARCHAR, membership_amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all cities without a branch ...
SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018
CREATE TABLE purchase (branch_id VARCHAR, year VARCHAR); CREATE TABLE branch (branch_id VARCHAR, city VARCHAR)
What is the sum of total pounds of purchase in year 2018 for all branches in London?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018 Context: CREATE TABLE purchase (branch_id VARCHAR, year VARCHAR); CREATE TABLE branch (branch_id VARCHAR, city VARCHAR) [/...
SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
CREATE TABLE member (member_id VARCHAR, level VARCHAR); CREATE TABLE purchase (member_id VARCHAR)
What is the total number of purchases for members with level 6?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6 Context: CREATE TABLE member (member_id VARCHAR, level VARCHAR); CREATE TABLE purchase (member_id VARCHAR) [/INST] Based on the provided SQL query and conte...
SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member ...
CREATE TABLE member (member_id VARCHAR, Hometown VARCHAR); CREATE TABLE branch (name VARCHAR, branch_id VARCHAR); CREATE TABLE membership_register_branch (branch_id VARCHAR, member_id VARCHAR)
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 J...
SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%"
CREATE TABLE member (card_number VARCHAR, Hometown VARCHAR)
list the card number of all members whose hometown address includes word "Kentucky".
<s>[INST] Given the following SQL query and context: Query: SELECT card_number FROM member WHERE Hometown LIKE "%Kentucky%" Context: CREATE TABLE member (card_number VARCHAR, Hometown VARCHAR) [/INST] Based on the provided SQL query and context, your question is: list the card number of all members whose hometown addre...
SELECT COUNT(*) FROM STUDENT
CREATE TABLE STUDENT (Id VARCHAR)
Find the number of students in total.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM STUDENT Context: CREATE TABLE STUDENT (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of students in total. The answer to your question is: SELECT COUNT(*) FROM STUDENT. [/s>
SELECT COUNT(*) FROM VOTING_RECORD
CREATE TABLE VOTING_RECORD (Id VARCHAR)
Find the number of voting records in total.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM VOTING_RECORD Context: CREATE TABLE VOTING_RECORD (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of voting records in total. The answer to your question is: SELECT COUNT(*) FROM VOTING_R...
SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD
CREATE TABLE VOTING_RECORD (President_Vote VARCHAR)
Find the distinct number of president votes.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD Context: CREATE TABLE VOTING_RECORD (President_Vote VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the distinct number of president votes. The answer to your questio...
SELECT MAX(Age) FROM STUDENT
CREATE TABLE STUDENT (Age INTEGER)
Find the maximum age of all the students.
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Age) FROM STUDENT Context: CREATE TABLE STUDENT (Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the maximum age of all the students. The answer to your question is: SELECT MAX(Age) FROM STUDENT. [/s>
SELECT LName FROM STUDENT WHERE Major = 50
CREATE TABLE STUDENT (LName VARCHAR, Major VARCHAR)
Find the last names of students with major 50.
<s>[INST] Given the following SQL query and context: Query: SELECT LName FROM STUDENT WHERE Major = 50 Context: CREATE TABLE STUDENT (LName VARCHAR, Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the last names of students with major 50. The answer to your question is: SELECT...
SELECT Fname FROM STUDENT WHERE Age > 22
CREATE TABLE STUDENT (Fname VARCHAR, Age INTEGER)
Find the first names of students with age above 22.
<s>[INST] Given the following SQL query and context: Query: SELECT Fname FROM STUDENT WHERE Age > 22 Context: CREATE TABLE STUDENT (Fname VARCHAR, Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the first names of students with age above 22. The answer to your question is: SELEC...
SELECT Major FROM STUDENT WHERE Sex = "M"
CREATE TABLE STUDENT (Major VARCHAR, Sex VARCHAR)
What are the majors of male (sex is M) students?
<s>[INST] Given the following SQL query and context: Query: SELECT Major FROM STUDENT WHERE Sex = "M" Context: CREATE TABLE STUDENT (Major VARCHAR, Sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the majors of male (sex is M) students? The answer to your question is: SELECT ...
SELECT AVG(Age) FROM STUDENT WHERE Sex = "F"
CREATE TABLE STUDENT (Age INTEGER, Sex VARCHAR)
What is the average age of female (sex is F) students?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Age) FROM STUDENT WHERE Sex = "F" Context: CREATE TABLE STUDENT (Age INTEGER, Sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average age of female (sex is F) students? The answer to your question is: ...