answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT COUNT(*) FROM inst
CREATE TABLE inst (Id VARCHAR)
How many institutions are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM inst Context: CREATE TABLE inst (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many institutions are there? The answer to your question is: SELECT COUNT(*) FROM inst. [/s>
SELECT COUNT(*) FROM papers
CREATE TABLE papers (Id VARCHAR)
How many papers are published in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM papers Context: CREATE TABLE papers (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many papers are published in total? The answer to your question is: SELECT COUNT(*) FROM papers. [/s>
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
What are the titles of papers published by "Jeremy Gibbons"?
<s>[INST] Given the following SQL query and context: Query: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE p...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
Find all the papers published by "Aaron Turon".
<s>[INST] Given the following SQL query and context: Query: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE pape...
SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE papers (paperid VARCHAR)
How many papers have "Atsushi Ohori" published?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE au...
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)
What is the name of the institution that "Matthias Blume" belongs to?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume" Context: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABL...
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)
Which institution does "Katsuhiro Ueno" belong to?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno" Context: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABL...
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)
Who belong to the institution "University of Oxford"? Show the first names and last names.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford" Context: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE...
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)
Which authors belong to the institution "Google"? Show the first names and last names.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google" Context: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fnam...
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)
What are the last names of the author of the paper titled "Binders Unbound"?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VA...
SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Nameless , Painless"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR)
Find the first and last name of the author(s) who wrote the paper "Nameless, Painless".
<s>[INST] Given the following SQL query and context: Query: SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Nameless , Painless" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE pa...
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
What are the papers published under the institution "Indiana University"?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University" Context: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperi...
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
Find all the papers published by the institution "Google".
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google" Context: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, i...
SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Tokohu University"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
How many papers are published by the institution "Tokohu University"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Tokohu University" Context: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (...
SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania"
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
Find the number of papers published by the institution "University of Pennsylvania".
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania" Context: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE aut...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
Find the papers which have "Olin Shivers" as an author.
<s>[INST] Given the following SQL query and context: Query: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE pap...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
Which papers have "Stephanie Weirich" as an author?
<s>[INST] Given the following SQL query and context: Query: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABL...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)
Which paper is published in an institution in "USA" and have "Turon" as its second author?
<s>[INST] Given the following SQL query and context: Query: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon" Context: CREATE TABLE a...
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)
Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"?
<s>[INST] Given the following SQL query and context: Query: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori" Context: CREATE TABLE...
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
What is the last name of the author that has published the most papers?
<s>[INST] Given the following SQL query and context: Query: SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE...
SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
Retrieve the country that has published the most papers.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorsh...
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
Find the name of the organization that has published the largest number of papers.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (insti...
SELECT title FROM papers WHERE title LIKE "%ML%"
CREATE TABLE papers (title VARCHAR)
Find the titles of the papers that contain the word "ML".
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM papers WHERE title LIKE "%ML%" Context: CREATE TABLE papers (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the titles of the papers that contain the word "ML". The answer to your question is: SELEC...
SELECT title FROM papers WHERE title LIKE "%Database%"
CREATE TABLE papers (title VARCHAR)
Which paper's title contains the word "Database"?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM papers WHERE title LIKE "%Database%" Context: CREATE TABLE papers (title VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which paper's title contains the word "Database"? The answer to your question is: SELECT ...
SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%"
CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR)
Find the first names of all the authors who have written a paper with title containing the word "Functional".
<s>[INST] Given the following SQL query and context: Query: SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%" Context: CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHA...
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Monadic%"
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)
Find the last names of all the authors that have written a paper with title containing the word "Monadic".
<s>[INST] Given the following SQL query and context: Query: SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Monadic%" Context: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCH...
SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship)
CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
Retrieve the title of the paper that has the largest number of authors.
<s>[INST] Given the following SQL query and context: Query: SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship) Context: CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); ...
SELECT fname FROM authors WHERE lname = "Ueno"
CREATE TABLE authors (fname VARCHAR, lname VARCHAR)
What is the first name of the author with last name "Ueno"?
<s>[INST] Given the following SQL query and context: Query: SELECT fname FROM authors WHERE lname = "Ueno" Context: CREATE TABLE authors (fname VARCHAR, lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the first name of the author with last name "Ueno"? The answer to your qu...
SELECT lname FROM authors WHERE fname = "Amal"
CREATE TABLE authors (lname VARCHAR, fname VARCHAR)
Find the last name of the author with first name "Amal".
<s>[INST] Given the following SQL query and context: Query: SELECT lname FROM authors WHERE fname = "Amal" Context: CREATE TABLE authors (lname VARCHAR, fname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the last name of the author with first name "Amal". The answer to your quest...
SELECT fname FROM authors ORDER BY fname
CREATE TABLE authors (fname VARCHAR)
Find the first names of all the authors ordered in alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT fname FROM authors ORDER BY fname Context: CREATE TABLE authors (fname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the first names of all the authors ordered in alphabetical order. The answer to your question is:...
SELECT lname FROM authors ORDER BY lname
CREATE TABLE authors (lname VARCHAR)
Retrieve all the last names of authors in alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT lname FROM authors ORDER BY lname Context: CREATE TABLE authors (lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Retrieve all the last names of authors in alphabetical order. The answer to your question is: SELECT l...
SELECT fname, lname FROM authors ORDER BY lname
CREATE TABLE authors (fname VARCHAR, lname VARCHAR)
Retrieve all the first and last names of authors in the alphabetical order of last names.
<s>[INST] Given the following SQL query and context: Query: SELECT fname, lname FROM authors ORDER BY lname Context: CREATE TABLE authors (fname VARCHAR, lname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Retrieve all the first and last names of authors in the alphabetical order of la...
SELECT COUNT(DISTINCT last_name) FROM actor
CREATE TABLE actor (last_name VARCHAR)
How many different last names do the actors and actresses have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT last_name) FROM actor Context: CREATE TABLE actor (last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different last names do the actors and actresses have? The answer to your question is: S...
SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE actor (first_name VARCHAR)
What is the most popular first name of the actors?
<s>[INST] Given the following SQL query and context: Query: SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE actor (first_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the most popular first name of the actors? The answe...
SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR)
What is the most popular full name of the actors?
<s>[INST] Given the following SQL query and context: Query: SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the most po...
SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2
CREATE TABLE address (district VARCHAR)
Which districts have at least two addresses?
<s>[INST] Given the following SQL query and context: Query: SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2 Context: CREATE TABLE address (district VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which districts have at least two addresses? The answer to your question...
SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'
CREATE TABLE address (phone VARCHAR, postal_code VARCHAR, address VARCHAR)
What is the phone number and postal code of the address 1031 Daugavpils Parkway?
<s>[INST] Given the following SQL query and context: Query: SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway' Context: CREATE TABLE address (phone VARCHAR, postal_code VARCHAR, address VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the phone number...
SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE address (city_id VARCHAR); CREATE TABLE city (city VARCHAR, city_id VARCHAR)
Which city has the most addresses? List the city name, number of addresses, and city id.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY T1.city_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE address (city_id VARCHAR); CREATE TABLE city (city VARCHAR, city_id VARCHAR) [/INST] Bas...
SELECT COUNT(*) FROM address WHERE district = 'California'
CREATE TABLE address (district VARCHAR)
How many addresses are in the district of California?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM address WHERE district = 'California' Context: CREATE TABLE address (district VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many addresses are in the district of California? The answer to your question...
SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3
CREATE TABLE film (title VARCHAR, film_id VARCHAR, rental_rate VARCHAR); CREATE TABLE inventory (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR)
Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id.
<s>[INST] Given the following SQL query and context: Query: SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3 Context: CREATE TABLE film (title VARCHAR, film_id VARCHAR, r...
SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'
CREATE TABLE country (country_id VARCHAR, country VARCHAR); CREATE TABLE city (country_id VARCHAR)
How many cities are in Australia?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia' Context: CREATE TABLE country (country_id VARCHAR, country VARCHAR); CREATE TABLE city (country_id VARCHAR) [/INST] Based on the provided SQL que...
SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3
CREATE TABLE country (country VARCHAR, country_id VARCHAR); CREATE TABLE city (country_id VARCHAR)
Which countries have at least 3 cities?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3 Context: CREATE TABLE country (country VARCHAR, country_id VARCHAR); CREATE TABLE city (country_id VARCHAR) [/INST] Based on the p...
SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa'
CREATE TABLE payment (payment_date VARCHAR, staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, first_name VARCHAR); CREATE TABLE payment (payment_date VARCHAR, amount INTEGER)
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa.
<s>[INST] Given the following SQL query and context: Query: SELECT payment_date FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' Context: CREATE TABLE payment (payment_date VARCHAR, staff_id VARCHAR); CREATE TABLE s...
SELECT COUNT(*) FROM customer WHERE active = '1'
CREATE TABLE customer (active VARCHAR)
How many customers have an active value of 1?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM customer WHERE active = '1' Context: CREATE TABLE customer (active VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many customers have an active value of 1? The answer to your question is: SELECT COUNT(*...
SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
CREATE TABLE film (title VARCHAR, rental_rate VARCHAR)
Which film has the highest rental rate? And what is the rate?
<s>[INST] Given the following SQL query and context: Query: SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1 Context: CREATE TABLE film (title VARCHAR, rental_rate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which film has the highest rental rate? And what is the...
SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film_actor (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR, description VARCHAR)
Which film has the most number of actors or actresses? List the film name, film id and description.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.film_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE film_actor (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHA...
SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR)
Which film actor (actress) starred the most films? List his or her first name, last name and actor id.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR,...
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30
CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR)
Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.first_name, T2.last_name FROM film_actor AS T1 JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.actor_id HAVING COUNT(*) > 30 Context: CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, act...
SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE inventory (store_id VARCHAR)
Which store owns most items?
<s>[INST] Given the following SQL query and context: Query: SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE inventory (store_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which store owns most items? The answer to your question i...
SELECT SUM(amount) FROM payment
CREATE TABLE payment (amount INTEGER)
What is the total amount of all payments?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(amount) FROM payment Context: CREATE TABLE payment (amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the total amount of all payments? The answer to your question is: SELECT SUM(amount) FROM payment. [/s...
SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) LIMIT 1
CREATE TABLE payment (customer_id VARCHAR); CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR)
Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, T1.customer_id FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY SUM(amount) LIMIT 1 Context: CREATE TABLE payment (customer_id VARCHAR); CREATE TABLE customer (first_...
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'
CREATE TABLE film_category (category_id VARCHAR, film_id VARCHAR); CREATE TABLE film (film_id VARCHAR, title VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR)
What is the genre name of the film HUNGER ROOF?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF' Context: CREATE TABLE film_category (category_id VARCHAR, film_id VARCHAR); CREATE TABLE fi...
SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id
CREATE TABLE film_category (category_id VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR)
How many films are there in each category? List the genre name, genre id and the count.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id Context: CREATE TABLE film_category (category_id VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR...
SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (film_id VARCHAR)
Which film has the most copies in the inventory? List both title and id.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (film_id VARCHAR) [/INST] Based o...
SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (inventory_id VARCHAR, film_id VARCHAR); CREATE TABLE rental (inventory_id VARCHAR)
What is the film title and inventory id of the item in the inventory which was rented most frequently?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.title, T2.inventory_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T2.inventory_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE film (title VARCHAR, film_id V...
SELECT COUNT(DISTINCT language_id) FROM film
CREATE TABLE film (language_id VARCHAR)
How many languages are in these films?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT language_id) FROM film Context: CREATE TABLE film (language_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many languages are in these films? The answer to your question is: SELECT COUNT(DISTINCT la...
SELECT title FROM film WHERE rating = 'R'
CREATE TABLE film (title VARCHAR, rating VARCHAR)
What are all the movies rated as R? List the titles.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM film WHERE rating = 'R' Context: CREATE TABLE film (title VARCHAR, rating VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the movies rated as R? List the titles. The answer to your question is: SEL...
SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1
CREATE TABLE store (address_id VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR)
Where is store 1 located?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1 Context: CREATE TABLE store (address_id VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) [/INST] Based on the provided SQL query and c...
SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY COUNT(*) LIMIT 1
CREATE TABLE payment (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR)
Which staff handled least number of payments? List the full name and the id.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.staff_id = T2.staff_id GROUP BY T1.staff_id ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE payment (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name ...
SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK'
CREATE TABLE film (language_id VARCHAR, title VARCHAR); CREATE TABLE LANGUAGE (name VARCHAR, language_id VARCHAR)
Which language does the film AIRPORT POLLOCK use? List the language name.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'AIRPORT POLLOCK' Context: CREATE TABLE film (language_id VARCHAR, title VARCHAR); CREATE TABLE LANGUAGE (name VARCHAR, language_id VARCHAR) [/INST] Based on...
SELECT COUNT(*) FROM store
CREATE TABLE store (Id VARCHAR)
How many stores are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM store Context: CREATE TABLE store (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many stores are there? The answer to your question is: SELECT COUNT(*) FROM store. [/s>
SELECT COUNT(DISTINCT rating) FROM film
CREATE TABLE film (rating VARCHAR)
How many kinds of different ratings are listed?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT rating) FROM film Context: CREATE TABLE film (rating VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many kinds of different ratings are listed? The answer to your question is: SELECT COUNT(DISTINCT rat...
SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
CREATE TABLE film (title VARCHAR, special_features VARCHAR)
Which movies have 'Deleted Scenes' as a substring in the special feature?
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%' Context: CREATE TABLE film (title VARCHAR, special_features VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which movies have 'Deleted Scenes' as a substring ...
SELECT COUNT(*) FROM inventory WHERE store_id = 1
CREATE TABLE inventory (store_id VARCHAR)
How many items in inventory does store 1 have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM inventory WHERE store_id = 1 Context: CREATE TABLE inventory (store_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many items in inventory does store 1 have? The answer to your question is: SELECT CO...
SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1
CREATE TABLE payment (payment_date VARCHAR)
When did the first payment happen?
<s>[INST] Given the following SQL query and context: Query: SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1 Context: CREATE TABLE payment (payment_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When did the first payment happen? The answer to your question is: SELECT...
SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA'
CREATE TABLE customer (email VARCHAR, address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR)
Where does the customer with the first name Linda live? And what is her email?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id = T1.address_id WHERE T1.first_name = 'LINDA' Context: CREATE TABLE customer (email VARCHAR, address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, add...
SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200
CREATE TABLE film (title VARCHAR, replacement_cost INTEGER, LENGTH VARCHAR, rating VARCHAR)
Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.
<s>[INST] Given the following SQL query and context: Query: SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SELECT title FROM film WHERE replacement_cost > 200 Context: CREATE TABLE film (title VARCHAR, replacement_cost INTEGER, LENGTH VARCHAR, rating VARCHAR) [/INST] Based on the provided SQL query a...
SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1
CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE rental (customer_id VARCHAR, rental_date VARCHAR)
What is the first name and the last name of the customer who made the earliest rental?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.rental_date LIMIT 1 Context: CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE rental (custom...
SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS'
CREATE TABLE customer (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE rental (staff_id VARCHAR, customer_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR)
What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.first_name, T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id = T2.staff_id JOIN customer AS T3 ON T2.customer_id = T3.customer_id WHERE T3.first_name = 'APRIL' AND T3.last_name = 'BURNS' Context: CREATE TABLE customer (customer...
SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE customer (store_id VARCHAR)
Which store has most the customers?
<s>[INST] Given the following SQL query and context: Query: SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE customer (store_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which store has most the customers? The answer to your quest...
SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
CREATE TABLE payment (amount VARCHAR)
What is the largest payment amount?
<s>[INST] Given the following SQL query and context: Query: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1 Context: CREATE TABLE payment (amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the largest payment amount? The answer to your question is: SELECT amount FROM...
SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa'
CREATE TABLE staff (address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR)
Where does the staff member with the first name Elsa live?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa' Context: CREATE TABLE staff (address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) [/INST] Based o...
SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01')
CREATE TABLE customer (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER); CREATE TABLE rental (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER)
What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?
<s>[INST] Given the following SQL query and context: Query: SELECT first_name FROM customer WHERE NOT customer_id IN (SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01') Context: CREATE TABLE customer (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER); CREATE TABLE rental (first_name V...
SELECT COUNT(*) FROM bank
CREATE TABLE bank (Id VARCHAR)
How many bank branches are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM bank Context: CREATE TABLE bank (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many bank branches are there? The answer to your question is: SELECT COUNT(*) FROM bank. [/s>
SELECT SUM(no_of_customers) FROM bank
CREATE TABLE bank (no_of_customers INTEGER)
How many customers are there?
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(no_of_customers) FROM bank Context: CREATE TABLE bank (no_of_customers INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many customers are there? The answer to your question is: SELECT SUM(no_of_customers) FROM ban...
SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City'
CREATE TABLE bank (no_of_customers INTEGER, city VARCHAR)
Find the number of customers in the banks at New York City.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City' Context: CREATE TABLE bank (no_of_customers INTEGER, city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of customers in the banks at New York C...
SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah'
CREATE TABLE bank (no_of_customers INTEGER, state VARCHAR)
Find the average number of customers in all banks of Utah state.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah' Context: CREATE TABLE bank (no_of_customers INTEGER, state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the average number of customers in all banks of Utah stat...
SELECT AVG(no_of_customers) FROM bank
CREATE TABLE bank (no_of_customers INTEGER)
Find the average number of customers cross all banks.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(no_of_customers) FROM bank Context: CREATE TABLE bank (no_of_customers INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average number of customers cross all banks. The answer to your question is: SELECT AVG(n...
SELECT city, state FROM bank WHERE bname = 'morningside'
CREATE TABLE bank (city VARCHAR, state VARCHAR, bname VARCHAR)
Find the city and state of the bank branch named morningside.
<s>[INST] Given the following SQL query and context: Query: SELECT city, state FROM bank WHERE bname = 'morningside' Context: CREATE TABLE bank (city VARCHAR, state VARCHAR, bname VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the city and state of the bank branch named morningside...
SELECT bname FROM bank WHERE state = 'New York'
CREATE TABLE bank (bname VARCHAR, state VARCHAR)
Find the branch names of banks in the New York state.
<s>[INST] Given the following SQL query and context: Query: SELECT bname FROM bank WHERE state = 'New York' Context: CREATE TABLE bank (bname VARCHAR, state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the branch names of banks in the New York state. The answer to your question i...
SELECT cust_name FROM customer ORDER BY acc_bal
CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR)
List the name of all customers sorted by their account balance in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name FROM customer ORDER BY acc_bal Context: CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of all customers sorted by their account balance in ascendi...
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount)
CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR)
List the name of all different customers who have some loan sorted by their total loan amount.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) Context: CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) [/INST] Ba...
SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0
CREATE TABLE customer (state VARCHAR, acc_type VARCHAR, credit_score VARCHAR, no_of_loans VARCHAR)
Find the state, account type, and credit score of the customer whose number of loan is 0.
<s>[INST] Given the following SQL query and context: Query: SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0 Context: CREATE TABLE customer (state VARCHAR, acc_type VARCHAR, credit_score VARCHAR, no_of_loans VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the...
SELECT COUNT(DISTINCT city) FROM bank
CREATE TABLE bank (city VARCHAR)
Find the number of different cities which banks are located at.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT city) FROM bank Context: CREATE TABLE bank (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of different cities which banks are located at. The answer to your question is: SELECT COUNT(...
SELECT COUNT(DISTINCT state) FROM bank
CREATE TABLE bank (state VARCHAR)
Find the number of different states which banks are located at.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT state) FROM bank Context: CREATE TABLE bank (state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of different states which banks are located at. The answer to your question is: SELECT COUN...
SELECT COUNT(DISTINCT acc_type) FROM customer
CREATE TABLE customer (acc_type VARCHAR)
How many distinct types of accounts are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT acc_type) FROM customer Context: CREATE TABLE customer (acc_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many distinct types of accounts are there? The answer to your question is: SELECT COUNT(D...
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'
CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR)
Find the name and account balance of the customer whose name includes the letter ‘a’.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' Context: CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and account balance of the customer whos...
SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'
CREATE TABLE customer (acc_bal INTEGER, state VARCHAR)
Find the total account balance of each customer from Utah or Texas.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' Context: CREATE TABLE customer (acc_bal INTEGER, state VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total account balance of each customer fro...
SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'
CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR)
Find the name of customers who have both saving and checking account types.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking' Context: CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR) [/INST] Based on the provided SQL query and context, your questio...
SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'
CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR)
Find the name of customers who do not have an saving account.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' Context: CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of customer...
SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages'
CREATE TABLE loan (cust_id VARCHAR, loan_type VARCHAR); CREATE TABLE customer (cust_name VARCHAR); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR)
Find the name of customers who do not have a loan with a type of Mortgages.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' Context: CREATE TABLE loan (cust_id VARCHAR, loan_type VARCHAR); CREATE TABLE customer (cust_name VARCHAR)...
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto'
CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR)
Find the name of customers who have loans of both Mortgages and Auto.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto' Context: CREATE TABLE custome...
SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer)
CREATE TABLE customer (cust_name VARCHAR, credit_score INTEGER)
Find the name of customers whose credit score is below the average credit scores of all customers.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer) Context: CREATE TABLE customer (cust_name VARCHAR, credit_score INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of custom...
SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
CREATE TABLE bank (bname VARCHAR, no_of_customers VARCHAR)
Find the branch name of the bank that has the most number of customers.
<s>[INST] Given the following SQL query and context: Query: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 Context: CREATE TABLE bank (bname VARCHAR, no_of_customers VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the branch name of the bank that has the most number of...
SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR)
Find the name of customer who has the lowest credit score.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 Context: CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of customer who has the lowest credit sco...
SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, acc_bal VARCHAR, credit_score VARCHAR)
Find the name, account type, and account balance of the customer who has the highest credit score.
<s>[INST] Given the following SQL query and context: Query: SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 Context: CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, acc_bal VARCHAR, credit_score VARCHAR) [/INST] Based on the provided SQL query and context, your question ...
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1
CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR)
Find the name of customer who has the highest amount of loans.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1 Context: CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHA...
SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1
CREATE TABLE bank (state VARCHAR, no_of_customers INTEGER)
Find the state which has the most number of customers.
<s>[INST] Given the following SQL query and context: Query: SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1 Context: CREATE TABLE bank (state VARCHAR, no_of_customers INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the state which has the most number...
SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type
CREATE TABLE customer (acc_type VARCHAR, acc_bal INTEGER, credit_score INTEGER)
For each account type, find the average account balance of customers with credit score lower than 50.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type Context: CREATE TABLE customer (acc_type VARCHAR, acc_bal INTEGER, credit_score INTEGER) [/INST] Based on the provided SQL query and context, your question is: For each accou...
SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state
CREATE TABLE customer (state VARCHAR, acc_bal INTEGER, credit_score INTEGER)
For each state, find the total account balance of customers whose credit score is above 100.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state Context: CREATE TABLE customer (state VARCHAR, acc_bal INTEGER, credit_score INTEGER) [/INST] Based on the provided SQL query and context, your question is: For each state, find t...