db_id stringclasses 215
values | question stringlengths 3 325 | gold_sql stringlengths 18 804 | source stringclasses 2
values | schema_text stringclasses 215
values |
|---|---|---|---|---|
imdb | Find all movies directed by " Steven Spielberg " after 2006 | SELECT t3.title FROM director AS t2 JOIN directed_by AS t1 ON t2.did = t1.did JOIN movie AS t3 ON t3.mid = t1.msid WHERE t2.name = "Steven Spielberg" AND t3.release_year > 2006; | spider | 【DB_ID】 imdb
# Table: actor
[
(aid:INT, PK, examples=[]),
(gender:TEXT, examples=[]),
(name:TEXT, examples=[]),
(nationality:TEXT, examples=[]),
(birth_city:TEXT, examples=[]),
(birth_year:INT, examples=[]),
]
# Table: copyright
[
(id:INT, PK, examples=[]),
(msid:INT, examples=[]),
(cid:INT, examples=... |
regional_sales | Sate the order number and calculate the net profit for each order under Joshua Bennett. | SELECT T1.OrderNumber , REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'Joshua Bennett' | bird | 【DB_ID】 regional_sales
# Table: Customers
[
(CustomerID:INTEGER, PK, examples=[1, 2, 3]),
(Customer Names:TEXT, examples=['Avon Corp', 'WakeFern ', 'Elorac, Corp']),
]
# Table: Products
[
(ProductID:INTEGER, PK, examples=[1, 2, 3]),
(Product Name:TEXT, examples=['Cookware', 'Photo Frames', 'Table Lamps']),
]
# ... |
retails | In the parts supply by Supplier#000000654, list the top five parts with the most supply cost in descending order of supply cost. | SELECT T2.ps_partkey FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey WHERE T1.s_name = 'Supplier#000000654' ORDER BY T2.ps_supplycost DESC LIMIT 5 | bird | 【DB_ID】 retails
# Table: customer
[
(c_custkey:INTEGER, PK, examples=[1, 2, 3]),
(c_mktsegment:TEXT, examples=['BUILDING', 'MACHINERY', 'FURNITURE']),
(c_nationkey:INTEGER, examples=[8, 16, 11]),
(c_name:TEXT, examples=['Customer#000000001', 'Customer#000000002', 'Customer#000000003']),
(c_address:TEXT, examp... |
culture_company | Show publishers with a book published in 1989 and a book in 1990. | SELECT publisher FROM book_club WHERE YEAR = 1989 INTERSECT SELECT publisher FROM book_club WHERE YEAR = 1990 | spider | 【DB_ID】 culture_company
# Table: book_club
[
(book_club_id:INT, PK, examples=[1, 2, 3]),
(Year:INT, examples=[1989, 1990]),
(Author_or_Editor:TEXT, examples=['Michael Nava', 'Donald Ward', 'Michael Bishop']),
(Book_Title:TEXT, examples=['Goldenboy', 'Death Takes the Stage', 'Unicorn Mountain']),
(Publisher:TE... |
music_2 | Find the name of songs that does not have a back vocal. | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "back" | spider | 【DB_ID】 music_2
# Table: Songs
[
(SongId:INTEGER, PK, examples=[]),
(Title:TEXT, examples=[]),
]
# Table: Albums
[
(AId:INTEGER, PK, examples=[]),
(Title:TEXT, examples=[]),
(Year:INTEGER, examples=[]),
(Label:TEXT, examples=[]),
(Type:TEXT, examples=[]),
]
# Table: Band
[
(Id:INTEGER, PK, examples=[]),... |
cre_Docs_and_Epenses | What are the different statement ids on accounts, and the number of accounts for each? | SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID | spider | 【DB_ID】 cre_Docs_and_Epenses
# Table: Ref_Document_Types
[
(Document_Type_Code:CHAR(15), PK, examples=['BK', 'CV', 'PT']),
(Document_Type_Name:VARCHAR(255), examples=['Book', 'CV', 'Presentation']),
(Document_Type_Description:VARCHAR(255), examples=['excellent', 'very good', 'good']),
]
# Table: Ref_Budget_Codes
... |
body_builder | What are the birth places that are shared by at least two people? | SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2 | spider | 【DB_ID】 body_builder
# Table: body_builder
[
(Body_Builder_ID:INT, PK, examples=[1, 2, 3]),
(People_ID:INT, examples=[1, 2, 3]),
(Snatch:REAL, examples=[142.5, 137.5, 140.0]),
(Clean_Jerk:REAL, examples=[175.0, 177.5, 162.5]),
(Total:REAL, examples=[317.5, 315.0, 312.5]),
]
# Table: people
[
(People_ID:INT,... |
ship_1 | What is the year in which most ships were built? | SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1 | spider | 【DB_ID】 ship_1
# Table: captain
[
(Captain_ID:INT, PK, examples=[1, 2, 3]),
(Name:TEXT, examples=['Captain Sir Henry Langford', 'Captain Beves Conway', 'Lieutenant Hugh Bolitho']),
(Ship_ID:INT, examples=[1, 2, 3]),
(age:TEXT, examples=['40', '54', '43']),
(Class:TEXT, examples=['Third-rate ship of the line',... |
geo | which states adjoin kentucky | SELECT border FROM border_info WHERE state_name = "kentucky"; | spider | 【DB_ID】 geo
# Table: state
[
(state_name:TEXT, PK, examples=[]),
(population:INTEGER, examples=[]),
(area:double, examples=[]),
(country_name:varchar(3), examples=[]),
(capital:TEXT, examples=[]),
(density:double, examples=[]),
]
# Table: city
[
(city_name:TEXT, PK1, examples=[]),
(population:INTEGER, e... |
body_builder | How many persons are not body builders? | SELECT count(*) FROM people WHERE people_id NOT IN (SELECT People_ID FROM body_builder) | spider | 【DB_ID】 body_builder
# Table: body_builder
[
(Body_Builder_ID:INT, PK, examples=[1, 2, 3]),
(People_ID:INT, examples=[1, 2, 3]),
(Snatch:REAL, examples=[142.5, 137.5, 140.0]),
(Clean_Jerk:REAL, examples=[175.0, 177.5, 162.5]),
(Total:REAL, examples=[317.5, 315.0, 312.5]),
]
# Table: people
[
(People_ID:INT,... |
flight_1 | What is the number of flights? | SELECT count(*) FROM Flight | spider | 【DB_ID】 flight_1
# Table: flight
[
(flno:number(4,0), PK, examples=[99, 13, 346]),
(origin:varchar2(20), examples=['Los Angeles', 'Chicago']),
(destination:varchar2(20), examples=['Washington D.C.', 'Chicago', 'Dallas']),
(distance:number(6,0), examples=[2308, 1749, 1251]),
(departure_date:date, examples=['04... |
talkingdata | What is the average age of the female users who uses a vivo device? | SELECT AVG(T1.age) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T1.gender = 'F' | bird | 【DB_ID】 talkingdata
# Table: app_all
[
(app_id:INTEGER, PK, examples=[-9223281467940916832, -9222877069545393219, -9222785464897897681]),
]
# Table: app_events
[
(event_id:INTEGER, PK1, examples=[2, 6, 7]),
(app_id:INTEGER, PK2, examples=[-8942695423876075857, -8022267440849930066, -5720078949152207372]),
(is_i... |
behavior_monitoring | What are the id and first name of the student whose addresses have the highest average monthly rental? | SELECT T1.student_id , T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1 | spider | 【DB_ID】 behavior_monitoring
# Table: Ref_Address_Types
[
(address_type_code:VARCHAR(15), PK, examples=['BILL', 'HOME']),
(address_type_description:VARCHAR(80), examples=['Billing', 'Home or Residence']),
]
# Table: Ref_Detention_Type
[
(detention_type_code:VARCHAR(10), PK, examples=['BREAK ', 'AFTER', 'LUNCH']),
... |
hockey | What is the percentage of American players among all the players who have gotten in the Hall of Fame? | SELECT CAST(COUNT(CASE WHEN T1.birthCountry = 'USA' THEN T1.playerID ELSE NULL END) AS REAL) * 100 / COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID | bird | 【DB_ID】 hockey
# Table: AwardsMisc
[
(name:TEXT, PK, examples=['1960 U.S. Olympic Hockey Team', "1998 U.S. Olympic Women's Hockey Team", 'Al Arbour']),
(ID:TEXT, examples=['arboual01', 'delveal01', 'rossar01']),
(award:TEXT, examples=['Patrick']),
(year:INTEGER, examples=[2001, 1998, 1991]),
(lgID:TEXT, examp... |
disney | Who is the hero character of the Disney movie directed by Will Finn? | SELECT T1.hero FROM characters AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Will Finn' | bird | 【DB_ID】 disney
# Table: characters
[
(movie_title:TEXT, PK, examples=['Snow White and the Seven Dwarfs', 'Pinocchio', 'Fantasia']),
(release_date:TEXT, examples=['21-Dec-37', '7-Feb-40', '13-Nov-40']),
(hero:TEXT, examples=['Snow White', 'Pinocchio', 'Dumbo']),
(villian:TEXT, examples=['Evil Queen', 'Stromboli'... |
county_public_safety | Show names of cities and names of counties they are in. | SELECT T1.Name , T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID | spider | 【DB_ID】 county_public_safety
# Table: county_public_safety
[
(County_ID:INT, PK, examples=[1, 2, 3]),
(Name:TEXT, examples=['Abbotsford', 'Burnaby', 'Campbell River']),
(Population:INT, examples=[128165, 204320, 30810]),
(Police_officers:INT, examples=[187, 253, 40]),
(Residents_per_officer:INT, examples=[685... |
gymnast | How many distinct hometowns did these people have? | SELECT count(DISTINCT Hometown) FROM people | spider | 【DB_ID】 gymnast
# Table: gymnast
[
(Gymnast_ID:INT, PK, examples=[1, 2, 4]),
(Floor_Exercise_Points:REAL, examples=[9.725, 9.7, 8.987]),
(Pommel_Horse_Points:REAL, examples=[9.737, 9.625, 9.75]),
(Rings_Points:REAL, examples=[9.512, 9.625, 9.75]),
(Vault_Points:REAL, examples=[9.575, 9.65, 9.762]),
(Paralle... |
sales | How many employees sold "ML Road Frame-W - Yellow, 40"? | SELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'ML Road Frame-W - Yellow, 40' | bird | 【DB_ID】 sales
# Table: Customers
[
(CustomerID:INTEGER, PK, examples=[1, 2, 3]),
(FirstName:TEXT, examples=['Aaron', 'Abby', 'Abe']),
(MiddleInitial:TEXT, examples=['A', 'B', 'C']),
(LastName:TEXT, examples=['Alexander', 'Bryant', 'Butler']),
]
# Table: Employees
[
(EmployeeID:INTEGER, PK, examples=[1, 2, 3])... |
authors | Please provide the titles of any two papers that are either preprinted or unpublished along with the full name of the journal to which those papers belong. | SELECT T1.Title, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year < 1 LIMIT 2 | bird | 【DB_ID】 authors
# Table: Author
[
(Id:INTEGER, PK, examples=[9, 14, 15]),
(Name:TEXT, examples=['Ernest Jordan', 'K. MORIBE', 'D. Jakominich']),
(Affiliation:TEXT, examples=['Cavendish Laboratory|Cambridge University', 'Department of Molecular Biology|School of Science|Nagoya University', 'HASLab / INESC TEC and ... |
book_publishing_company | Name the Chief Executive Officer and when he/she was hired. | SELECT T1.fname, T1.lname, T1.hire_date FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Chief Financial Officier' | bird | 【DB_ID】 book_publishing_company
# Table: authors
[
(au_id:TEXT, PK, examples=['172-32-1176', '213-46-8915', '238-95-7766']),
(au_lname:TEXT, examples=['White', 'Green', 'Carson']),
(au_fname:TEXT, examples=['Johnson', 'Marjorie', 'Cheryl']),
(phone:TEXT, examples=['408 496-7223', '415 986-7020', '415 548-7723']... |
synthea | List all the full names of patients with a condition described as cystitis. | SELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.patient WHERE T2.DESCRIPTION = 'Cystitis' | bird | 【DB_ID】 synthea
# Table: all_prevalences
[
(ITEM:TEXT, PK, examples=['Viral Sinusitis (Disorder)', 'Streptococcal Sore Throat (Disorder)', 'Laceration Of Thigh']),
(POPULATION TYPE:TEXT, examples=['LIVING']),
(OCCURRENCES:INTEGER, examples=[868, 487, 117]),
(POPULATION COUNT:INTEGER, examples=[1000]),
(PREVAL... |
club_1 | How many clubs are located at "HHH"? | SELECT count(*) FROM club WHERE clublocation = "HHH" | spider | 【DB_ID】 club_1
# Table: Student
[
(StuID:INTEGER, PK, examples=[1001, 1002, 1003]),
(LName:VARCHAR(12), examples=['Smith', 'Kim', 'Jones']),
(Fname:VARCHAR(12), examples=['Linda', 'Tracy', 'Shiela']),
(Age:INTEGER, examples=[18, 19, 21]),
(Sex:VARCHAR(1), examples=['F', 'M']),
(Major:INTEGER, examples=[600,... |
entertainment_awards | Show the ids and names of festivals that have at least two nominations for artworks. | SELECT T1.Festival_ID , T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID GROUP BY T1.Festival_ID HAVING COUNT(*) >= 2 | spider | 【DB_ID】 entertainment_awards
# Table: festival_detail
[
(Festival_ID:INT, PK, examples=[1, 2, 3]),
(Festival_Name:TEXT, examples=['Panasonic Awards', 'Flower Awards', 'Cherry Awards']),
(Chair_Name:TEXT, examples=['Raymond Floyd', 'Charles Coody', 'Doug Ford']),
(Location:TEXT, examples=['United States']),
(Y... |
university | What is the id of the criteria "Citations Rank"? | SELECT id FROM ranking_criteria WHERE criteria_name = 'Citations Rank' | bird | 【DB_ID】 university
# Table: country
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(country_name:TEXT, examples=['Argentina', 'Australia', 'Austria']),
]
# Table: ranking_system
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(system_name:TEXT, examples=['Times Higher Education World University Ranking', 'Shanghai Ranking', '... |
manufacturer | what is the average number of factories and maximum number of shops for manufacturers that opened before 1990. | SELECT max(num_of_shops) , avg(Num_of_Factories) FROM manufacturer WHERE open_year < 1990 | spider | 【DB_ID】 manufacturer
# Table: manufacturer
[
(Manufacturer_ID:INT, PK, examples=[1, 2, 3]),
(Open_Year:REAL, examples=[1980.0, 1990.0, 1991.0]),
(Name:TEXT, examples=['Chevrolet House', 'IKEA', 'Ford Make']),
(Num_of_Factories:INT, examples=[36, 21, 12]),
(Num_of_Shops:INT, examples=[8, 19, 2]),
]
# Table: fu... |
geo | states bordering kentucky | SELECT border FROM border_info WHERE state_name = "kentucky"; | spider | 【DB_ID】 geo
# Table: state
[
(state_name:TEXT, PK, examples=[]),
(population:INTEGER, examples=[]),
(area:double, examples=[]),
(country_name:varchar(3), examples=[]),
(capital:TEXT, examples=[]),
(density:double, examples=[]),
]
# Table: city
[
(city_name:TEXT, PK1, examples=[]),
(population:INTEGER, e... |
scholar | How many citations does noah a smith has ? | SELECT DISTINCT COUNT ( t4.citedpaperid ) FROM paper AS t3 JOIN cite AS t4 ON t3.paperid = t4.citedpaperid JOIN writes AS t2 ON t2.paperid = t3.paperid JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "noah a smith"; | spider | 【DB_ID】 scholar
# Table: venue
[
(venueId:INTEGER, PK, examples=[]),
(venueName:varchar(100), examples=[]),
]
# Table: author
[
(authorId:INTEGER, PK, examples=[]),
(authorName:varchar(50), examples=[]),
]
# Table: dataset
[
(datasetId:INTEGER, PK, examples=[]),
(datasetName:varchar(50), examples=[]),
]
# T... |
customer_complaints | What are all the different product names, and how many complains has each received? | SELECT t1.product_name , count(*) FROM products AS t1 JOIN complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name | spider | 【DB_ID】 customer_complaints
# Table: Staff
[
(staff_id:INTEGER, PK, examples=[114, 115, 116]),
(gender:VARCHAR(1), examples=['0', '1']),
(first_name:VARCHAR(80), examples=['Ward', 'Lucie', 'Dagmar']),
(last_name:VARCHAR(80), examples=['Boehm', 'Lowe', 'Erdman']),
(email_address:VARCHAR(255), examples=['marcel... |
geo | how many rivers are there in idaho | SELECT COUNT ( river_name ) FROM river WHERE traverse = "idaho"; | spider | 【DB_ID】 geo
# Table: state
[
(state_name:TEXT, PK, examples=[]),
(population:INTEGER, examples=[]),
(area:double, examples=[]),
(country_name:varchar(3), examples=[]),
(capital:TEXT, examples=[]),
(density:double, examples=[]),
]
# Table: city
[
(city_name:TEXT, PK1, examples=[]),
(population:INTEGER, e... |
movie_3 | List the full names of customers who have paid more than 10$. | SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10 | bird | 【DB_ID】 movie_3
# Table: film_text
[
(film_id:INTEGER, PK, examples=[1, 2, 3]),
(title:TEXT, examples=['ACADEMY DINOSAUR', 'ACE GOLDFINGER', 'ADAPTATION HOLES']),
(description:TEXT, examples=['A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies', 'A Astounding Epistle ... |
geo | how big is new mexico | SELECT area FROM state WHERE state_name = "new mexico"; | spider | 【DB_ID】 geo
# Table: state
[
(state_name:TEXT, PK, examples=[]),
(population:INTEGER, examples=[]),
(area:double, examples=[]),
(country_name:varchar(3), examples=[]),
(capital:TEXT, examples=[]),
(density:double, examples=[]),
]
# Table: city
[
(city_name:TEXT, PK1, examples=[]),
(population:INTEGER, e... |
video_games | Provide the genre name of the genre ID 3. | SELECT T.genre_name FROM genre AS T WHERE T.id = 3 | bird | 【DB_ID】 video_games
# Table: genre
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(genre_name:TEXT, examples=['Action', 'Adventure', 'Fighting']),
]
# Table: game
[
(id:INTEGER, PK, examples=[44, 45, 46]),
(genre_id:INTEGER, examples=[4, 5, 11]),
(game_name:TEXT, examples=['2 Games in 1: Sonic Advance & ChuChu Rocke... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 53