db_id
stringclasses
127 values
query
stringlengths
20
523
question
stringlengths
16
224
schema
stringclasses
127 values
culture_company
SELECT COUNT (DISTINCT director) FROM movie
How many movie directors are there?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT COUNT (DISTINCT director) FROM movie
Count the number of different directors.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT title , director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1
What is the title and director for the movie with highest worldwide gross in the year 2000 or before?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT title , director FROM movie WHERE YEAR <= 2000 ORDER BY gross_worldwide DESC LIMIT 1
Return the title and director of the movie released in the year 2000 or earlier that had the highest worldwide gross.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999
Show all director names who have a movie in both year 1999 and 2000.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT director FROM movie WHERE YEAR = 2000 INTERSECT SELECT director FROM movie WHERE YEAR = 1999
Which directors had a movie both in the year 1999 and 2000?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000
Show all director names who have a movie in the year 1999 or 2000.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000
Which directors had a movie in either 1999 or 2000?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT avg(budget_million) , max(budget_million) , min(budget_million) FROM movie WHERE YEAR < 2000
What is the average, maximum, and minimum budget for all movies before 2000.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT avg(budget_million) , max(budget_million) , min(budget_million) FROM movie WHERE YEAR < 2000
Return the average, maximum, and minimum budgets in millions for movies made before the year 2000.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'
List all company names with a book published by Alyson.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT T1.company_name FROM culture_company AS T1 JOIN book_club AS T2 ON T1.book_club_id = T2.book_club_id WHERE T2.publisher = 'Alyson'
What are all the company names that have a book published by Alyson?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT T1.title , T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'
Show the movie titles and book titles for all companies in China.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT T1.title , T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'
What are the titles of movies and books corresponding to companies incorporated in China?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
Show all company names with a movie directed in year 1999.
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);
culture_company
SELECT T2.company_name FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.year = 1999
What are all company names that have a corresponding movie directed in the year 1999?
CREATE TABLE "book_club" ( "book_club_id" int, "Year" int, "Author_or_Editor" text, "Book_Title" text, "Publisher" text, "Category" text, "Result" text, PRIMARY KEY ("book_club_id") ); CREATE TABLE "movie" ( "movie_id" int, "Title" text, "Year" int, "Director" text, "Budget_million" real, "Gross_worldwide" int, PRIMARY KEY("movie_id") ); CREATE TABLE "culture_company" ( "Company_name" text, "Type" text, "Incorporated_in" text, "Group_Equity_Shareholding" real, "book_club_id" text, "movie_id" text, PRIMARY KEY("Company_name"), FOREIGN KEY ("book_club_id") REFERENCES "book_club"("book_club_id"), FOREIGN KEY ("movie_id") REFERENCES "movie"("movie_id") ); INSERT INTO "book_club" VALUES (1, "1989","Michael Nava","Goldenboy","Alyson","Gay M/SF","Won [A ]"); INSERT INTO "movie" VALUES (1, "The Boondock Saints","1999","Troy Duffy","6","30471"); INSERT INTO "culture_company" VALUES ("Culture China","Corporate","China","18.77",1,2);