db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
icfp_1
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
Question: retrieve the country that has published the most papers. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = Auth...
retrieve the country that has published the most papers.
icfp_1
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
Question: find the country that the most papers are affiliated with. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = Au...
find the country that the most papers are affiliated with.
icfp_1
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
Question: find the name of the organization that has published the largest number of papers. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID...
find the name of the organization that has published the largest number of papers.
icfp_1
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
Question: which institution has the most papers? find the name of the institution. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorsh...
which institution has the most papers? find the name of the institution.
icfp_1
select title from papers where title like '%ml%'
Question: find the titles of the papers that contain the word 'ml'. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = Aut...
find the titles of the papers that contain the word 'ml'.
icfp_1
select title from papers where title like '%ml%'
Question: which papers have the substring 'ml' in their titles? return the titles of the papers. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.in...
which papers have the substring 'ml' in their titles? return the titles of the papers.
icfp_1
select title from papers where title like '%database%'
Question: which paper's title contains the word 'database'? | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = Authors.aut...
which paper's title contains the word 'database'?
icfp_1
select title from papers where title like '%database%'
Question: which papers have the substring 'database' in their titles? show the titles of the papers. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Ins...
which papers have the substring 'database' in their titles? show the titles of the papers.
icfp_1
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%'
Question: find the first names of all the authors who have written a paper with title containing the word 'functional'. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Auth...
find the first names of all the authors who have written a paper with title containing the word 'functional'.
icfp_1
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%'
Question: who has written a paper that has the word 'functional' in its title? return the first names of the authors. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Author...
who has written a paper that has the word 'functional' in its title? return the first names of the authors.
icfp_1
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%'
Question: find the last names of all the authors that have written a paper with title containing the word 'monadic'. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authors...
find the last names of all the authors that have written a paper with title containing the word 'monadic'.
icfp_1
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%'
Question: which authors have written a paper with title containing the word 'monadic'? return their last names. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.i...
which authors have written a paper with title containing the word 'monadic'? return their last names.
icfp_1
select t2.title from authorship as t1 join papers as t2 on t1.paperid = t2.paperid where t1.authorder = (select max(authorder) from authorship)
Question: retrieve the title of the paper that has the largest number of authors. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorshi...
retrieve the title of the paper that has the largest number of authors.
icfp_1
select t2.title from authorship as t1 join papers as t2 on t1.paperid = t2.paperid where t1.authorder = (select max(authorder) from authorship)
Question: which paper has the most authors? give me the paper title. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = Au...
which paper has the most authors? give me the paper title.
icfp_1
select fname from authors where lname = 'ueno'
Question: what is the first name of the author with last name 'ueno'? | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = A...
what is the first name of the author with last name 'ueno'?
icfp_1
select fname from authors where lname = 'ueno'
Question: which authors have last name 'ueno'? list their first names. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = ...
which authors have last name 'ueno'? list their first names.
icfp_1
select lname from authors where fname = 'amal'
Question: find the last name of the author with first name 'amal'. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = Auth...
find the last name of the author with first name 'amal'.
icfp_1
select lname from authors where fname = 'amal'
Question: which authors have first name 'amal'? list their last names. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID = ...
which authors have first name 'amal'? list their last names.
icfp_1
select fname from authors order by fname
Question: find the first names of all the authors ordered in alphabetical order. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship...
find the first names of all the authors ordered in alphabetical order.
icfp_1
select fname from authors order by fname
Question: sort the first names of all the authors in alphabetical order. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID ...
sort the first names of all the authors in alphabetical order.
icfp_1
select lname from authors order by lname
Question: retrieve all the last names of authors in alphabetical order. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Authorship.authID =...
retrieve all the last names of authors in alphabetical order.
icfp_1
select lname from authors order by lname
Question: give me a list of all the last names of authors sorted in alphabetical order | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst.instID, Auth...
give me a list of all the last names of authors sorted in alphabetical order
icfp_1
select fname , lname from authors order by lname
Question: retrieve all the first and last names of authors in the alphabetical order of last names. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instID = Inst...
retrieve all the first and last names of authors in the alphabetical order of last names.
icfp_1
select fname , lname from authors order by lname
Question: sort the list of all the first and last names of authors in alphabetical order of the last names. | Tables: Inst -> instID, name, country. Authors -> authID, lname, fname. Papers -> paperID, title. Authorship -> authID, instID, paperID, authOrder. | Joins: Authorship.paperID = Papers.paperID, Authorship.instI...
sort the list of all the first and last names of authors in alphabetical order of the last names.
sakila_1
select count(distinct last_name) from actor
Question: how many different last names do the actors and actresses have? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_upd...
how many different last names do the actors and actresses have?
sakila_1
select count(distinct last_name) from actor
Question: count the number of different last names actors have. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. count...
count the number of different last names actors have.
sakila_1
select first_name from actor group by first_name order by count(*) desc limit 1
Question: what is the most popular first name of the actors? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country ...
what is the most popular first name of the actors?
sakila_1
select first_name from actor group by first_name order by count(*) desc limit 1
Question: return the most common first name among all actors. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country...
return the most common first name among all actors.
sakila_1
select first_name , last_name from actor group by first_name , last_name order by count(*) desc limit 1
Question: what is the most popular full name of the actors? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -...
what is the most popular full name of the actors?
sakila_1
select first_name , last_name from actor group by first_name , last_name order by count(*) desc limit 1
Question: return the most common full name among all actors. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country ...
return the most common full name among all actors.
sakila_1
select district from address group by district having count(*) >= 2
Question: which districts have at least two addresses? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> cou...
which districts have at least two addresses?
sakila_1
select district from address group by district having count(*) >= 2
Question: give the districts which have two or more addresses. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. countr...
give the districts which have two or more addresses.
sakila_1
select phone , postal_code from address where address = '1031 daugavpils parkway'
Question: what is the phone number and postal code of the address 1031 daugavpils parkway? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, cou...
what is the phone number and postal code of the address 1031 daugavpils parkway?
sakila_1
select phone , postal_code from address where address = '1031 daugavpils parkway'
Question: give the phone and postal code corresponding to the address '1031 daugavpils parkway'. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, cit...
give the phone and postal code corresponding to the address '1031 daugavpils parkway'.
sakila_1
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
Question: which city has the most addresses? list the city name, number of addresses, and city id. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, c...
which city has the most addresses? list the city name, number of addresses, and city id.
sakila_1
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
Question: what are the city name, id, and number of addresses corresponding to the city with the most addressed? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city...
what are the city name, id, and number of addresses corresponding to the city with the most addressed?
sakila_1
select count(*) from address where district = 'california'
Question: how many addresses are in the district of california? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. count...
how many addresses are in the district of california?
sakila_1
select count(*) from address where district = 'california'
Question: count the number of addressed in the california district. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. c...
count the number of addressed in the california district.
sakila_1
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
Question: which film is rented at a fee of 0.99 and has less than 3 in the inventory? list the film title and id. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. cit...
which film is rented at a fee of 0.99 and has less than 3 in the inventory? list the film title and id.
sakila_1
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
Question: what are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> ...
what are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3?
sakila_1
select count(*) from city as t1 join country as t2 on t1.country_id = t2.country_id where t2.country = 'australia'
Question: how many cities are in australia? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, co...
how many cities are in australia?
sakila_1
select count(*) from city as t1 join country as t2 on t1.country_id = t2.country_id where t2.country = 'australia'
Question: count the number of cities in australia. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country...
count the number of cities in australia.
sakila_1
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
Question: which countries have at least 3 cities? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_...
which countries have at least 3 cities?
sakila_1
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
Question: what are the countries that contain 3 or more cities? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. count...
what are the countries that contain 3 or more cities?
sakila_1
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'
Question: 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. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category...
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.
sakila_1
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'
Question: what are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name elsa? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category ->...
what are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name elsa?
sakila_1
select count(*) from customer where active = '1'
Question: how many customers have an active value of 1? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> co...
how many customers have an active value of 1?
sakila_1
select count(*) from customer where active = '1'
Question: count the number of customers who are active. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> co...
count the number of customers who are active.
sakila_1
select title , rental_rate from film order by rental_rate desc limit 1
Question: which film has the highest rental rate? and what is the rate? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_updat...
which film has the highest rental rate? and what is the rate?
sakila_1
select title , rental_rate from film order by rental_rate desc limit 1
Question: what are the title and rental rate of the film with the highest rental rate? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country...
what are the title and rental rate of the film with the highest rental rate?
sakila_1
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
Question: which film has the most number of actors or actresses? list the film name, film id and description. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city ->...
which film has the most number of actors or actresses? list the film name, film id and description.
sakila_1
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
Question: what are the title, id, and description of the movie with the greatest number of actors? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, c...
what are the title, id, and description of the movie with the greatest number of actors?
sakila_1
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
Question: which film actor (actress) starred the most films? list his or her first name, last name and actor id. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city...
which film actor (actress) starred the most films? list his or her first name, last name and actor id.
sakila_1
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
Question: return the full name and id of the actor or actress who starred in the greatest number of films. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> ci...
return the full name and id of the actor or actress who starred in the greatest number of films.
sakila_1
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
Question: which film actors (actresses) played a role in more than 30 films? list his or her first name and last name. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update...
which film actors (actresses) played a role in more than 30 films? list his or her first name and last name.
sakila_1
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
Question: what are the full names of actors who had roles in more than 30 films? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, l...
what are the full names of actors who had roles in more than 30 films?
sakila_1
select store_id from inventory group by store_id order by count(*) desc limit 1
Question: which store owns most items? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, country...
which store owns most items?
sakila_1
select store_id from inventory group by store_id order by count(*) desc limit 1
Question: what is the id of the store that has the most items in inventory? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_u...
what is the id of the store that has the most items in inventory?
sakila_1
select sum(amount) from payment
Question: what is the total amount of all payments? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> countr...
what is the total amount of all payments?
sakila_1
select sum(amount) from payment
Question: return the sum of all payment amounts. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_i...
return the sum of all payment amounts.
sakila_1
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) asc limit 1
Question: 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. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_i...
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.
sakila_1
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) asc limit 1
Question: what is the full name and id of the customer who has the lowest total amount of payment? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, c...
what is the full name and id of the customer who has the lowest total amount of payment?
sakila_1
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'
Question: what is the genre name of the film hunger roof? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> ...
what is the genre name of the film hunger roof?
sakila_1
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'
Question: return the name of the category to which the film 'hunger roof' belongs. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id,...
return the name of the category to which the film 'hunger roof' belongs.
sakila_1
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
Question: how many films are there in each category? list the genre name, genre id and the count. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, ci...
how many films are there in each category? list the genre name, genre id and the count.
sakila_1
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
Question: what are the names and ids of the different categories, and how many films are in each? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, ci...
what are the names and ids of the different categories, and how many films are in each?
sakila_1
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
Question: which film has the most copies in the inventory? list both title and id. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id,...
which film has the most copies in the inventory? list both title and id.
sakila_1
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
Question: what is the title and id of the film that has the greatest number of copies in inventory? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, ...
what is the title and id of the film that has the greatest number of copies in inventory?
sakila_1
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
Question: what is the film title and inventory id of the item in the inventory which was rented most frequently? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city...
what is the film title and inventory id of the item in the inventory which was rented most frequently?
sakila_1
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
Question: return the title and inventory id of the film that is rented most often. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id,...
return the title and inventory id of the film that is rented most often.
sakila_1
select count(distinct language_id) from film
Question: how many languages are in these films? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_i...
how many languages are in these films?
sakila_1
select count(distinct language_id) from film
Question: count the number of different languages in these films. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. cou...
count the number of different languages in these films.
sakila_1
select title from film where rating = 'r'
Question: what are all the movies rated as r? list the titles. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. countr...
what are all the movies rated as r? list the titles.
sakila_1
select title from film where rating = 'r'
Question: return the titles of any movies with an r rating. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -...
return the titles of any movies with an r rating.
sakila_1
select t2.address from store as t1 join address as t2 on t1.address_id = t2.address_id where store_id = 1
Question: where is store 1 located? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, country, l...
where is store 1 located?
sakila_1
select t2.address from store as t1 join address as t2 on t1.address_id = t2.address_id where store_id = 1
Question: return the address of store 1. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, count...
return the address of store 1.
sakila_1
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(*) asc limit 1
Question: which staff handled least number of payments? list the full name and the id. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country...
which staff handled least number of payments? list the full name and the id.
sakila_1
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(*) asc limit 1
Question: give the full name and staff id of the staff who has handled the fewest payments. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, co...
give the full name and staff id of the staff who has handled the fewest payments.
sakila_1
select t2.name from film as t1 join language as t2 on t1.language_id = t2.language_id where t1.title = 'airport pollock'
Question: which language does the film airport pollock use? list the language name. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id...
which language does the film airport pollock use? list the language name.
sakila_1
select t2.name from film as t1 join language as t2 on t1.language_id = t2.language_id where t1.title = 'airport pollock'
Question: what is the name of the language that the film 'airport pollock' is in? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, ...
what is the name of the language that the film 'airport pollock' is in?
sakila_1
select count(*) from store
Question: how many stores are there? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, country, ...
how many stores are there?
sakila_1
select count(*) from store
Question: count the number of stores. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, country,...
count the number of stores.
sakila_1
select count(distinct rating) from film
Question: how many kinds of different ratings are listed? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> ...
how many kinds of different ratings are listed?
sakila_1
select count(distinct rating) from film
Question: count the number of different film ratings. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> coun...
count the number of different film ratings.
sakila_1
select title from film where special_features like '%deleted scenes%'
Question: which movies have 'deleted scenes' as a substring in the special feature? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id...
which movies have 'deleted scenes' as a substring in the special feature?
sakila_1
select title from film where special_features like '%deleted scenes%'
Question: return the titles of films that include 'deleted scenes' in their special feature section. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id,...
return the titles of films that include 'deleted scenes' in their special feature section.
sakila_1
select count(*) from inventory where store_id = 1
Question: how many items in inventory does store 1 have? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> c...
how many items in inventory does store 1 have?
sakila_1
select count(*) from inventory where store_id = 1
Question: count the number of items store 1 has in stock. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> ...
count the number of items store 1 has in stock.
sakila_1
select payment_date from payment order by payment_date asc limit 1
Question: when did the first payment happen? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, c...
when did the first payment happen?
sakila_1
select payment_date from payment order by payment_date asc limit 1
Question: what was the date of the earliest payment? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> count...
what was the date of the earliest payment?
sakila_1
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'
Question: where does the customer with the first name linda live? and what is her email? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, count...
where does the customer with the first name linda live? and what is her email?
sakila_1
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'
Question: return the address and email of the customer with the first name linda. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, ...
return the address and email of the customer with the first name linda.
sakila_1
select title from film where length > 100 or rating = 'pg' except select title from film where replacement_cost > 200
Question: find all the films longer than 100 minutes, or rated pg, except those who cost more than 200 for replacement. list the titles. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id,...
find all the films longer than 100 minutes, or rated pg, except those who cost more than 200 for replacement. list the titles.
sakila_1
select title from film where length > 100 or rating = 'pg' except select title from film where replacement_cost > 200
Question: what are the titles of films that are either longer than 100 minutes or rated pg other than those that cost more than 200 to replace? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> categ...
what are the titles of films that are either longer than 100 minutes or rated pg other than those that cost more than 200 to replace?
sakila_1
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 asc limit 1
Question: what is the first name and the last name of the customer who made the earliest rental? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, cit...
what is the first name and the last name of the customer who made the earliest rental?
sakila_1
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 asc limit 1
Question: return the full name of the customer who made the first rental. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_upd...
return the full name of the customer who made the first rental.
sakila_1
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'
Question: 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? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_i...
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?
sakila_1
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'
Question: return the full name of the staff who provided a customer with the first name april and the last name burns with a film rental. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id...
return the full name of the staff who provided a customer with the first name april and the last name burns with a film rental.
sakila_1
select store_id from customer group by store_id order by count(*) desc limit 1
Question: which store has most the customers? | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country -> country_id, ...
which store has most the customers?
sakila_1
select store_id from customer group by store_id order by count(*) desc limit 1
Question: return the id of the store with the most customers. | Tables: actor -> actor_id, first_name, last_name, last_update. address -> address_id, address, address2, district, city_id, postal_code, phone, last_update. category -> category_id, name, last_update. city -> city_id, city, country_id, last_update. country...
return the id of the store with the most customers.