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... |
shipping | Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000? | SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Cicero' AND T2.state = 'Illinois' AND T1.weight BETWEEN 9000 AND 15000 | bird | 【DB_ID】 shipping
# Table: city
[
(city_id:INTEGER, PK, examples=[100, 101, 102]),
(city_name:TEXT, examples=['Union City', 'Huntington Park', 'Passaic']),
(state:TEXT, examples=['New Jersey', 'California', 'New York']),
(population:INTEGER, examples=[67088, 61348, 67861]),
(area:REAL, examples=[1.3, 3.0, 3.1]... |
club_1 | Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name. | SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO" | 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,... |
car_retails | How many French customers does Gerard Hernandez take care of? | SELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.country = 'France' AND t2.firstName = 'Gerard' AND t2.lastName = 'Hernandez' | bird | 【DB_ID】 car_retails
# Table: offices
[
(officeCode:TEXT, PK, examples=['1', '2', '3']),
(city:TEXT, examples=['San Francisco', 'Boston', 'NYC']),
(phone:TEXT, examples=['+1 650 219 4782', '+1 215 837 0825', '+1 212 555 3000']),
(addressLine1:TEXT, examples=['100 Market Street', '1550 Court Place', '523 East 53r... |
scholar | Show me chi papers . | SELECT DISTINCT t1.paperid FROM venue AS t2 JOIN paper AS t1 ON t2.venueid = t1.venueid WHERE t2.venuename = "chi"; | 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... |
synthea | How many male patients have been described as immune to quadrivalent HPV? | SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'HPV quadrivalent' AND T1.gender = 'M' | 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... |
school_player | Show the locations of schools that have more than 1 player. | SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1 | spider | 【DB_ID】 school_player
# Table: school
[
(School_ID:INT, PK, examples=[1, 2, 3]),
(School:TEXT, examples=["St Aloysius' College", 'Barker College', 'Cranbrook School']),
(Location:TEXT, examples=['Milsons Point', 'Hornsby', 'Bellevue Hill']),
(Enrollment:REAL, examples=[1200.0, 2300.0, 1000.0]),
(Founded:REAL,... |
music_2 | How many different instruments are used in the song "Badlands"? | SELECT count(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Badlands" | 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=[]),... |
flight_1 | What is the name of the aircraft that was on flight number 99? | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99 | 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... |
scholar | How many papers does Christopher D. Manning have | SELECT DISTINCT COUNT ( DISTINCT t2.paperid ) FROM writes AS t2 JOIN author AS t1 ON t2.authorid = t1.authorid WHERE t1.authorname = "Christopher D. Manning"; | 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... |
e_government | Count the number of different payment method codes used by parties. | SELECT count(DISTINCT payment_method_code) FROM parties | spider | 【DB_ID】 e_government
# Table: Addresses
[
(address_id:INTEGER, PK, examples=[1, 2, 3]),
(line_1_number_building:VARCHAR(80), examples=['25518 Ortiz Centers', '033 Stracke Parkways', '269 Flatley Port Suite 062']),
(town_city:VARCHAR(50), examples=['West Stacy', 'Lake Meaghan', 'Breanneberg']),
(zip_postcode:VAR... |
airline | What are the names of the top 5 airlines with the highest number of aircraft? | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code GROUP BY T2.Description ORDER BY T1.TAIL_NUM DESC LIMIT 5 | bird | 【DB_ID】 airline
# Table: Air Carriers
[
(Code:INTEGER, PK, examples=[19031, 19032, 19033]),
(Description:TEXT, examples=['Mackey International Inc.: MAC', 'Munz Northern Airlines Inc.: XY', 'Cochise Airlines Inc.: COC']),
]
# Table: Airports
[
(Code:TEXT, PK, examples=['01A', '03A', '04A']),
(Description:TEXT, ... |
entrepreneur | What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"? | SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" | spider | 【DB_ID】 entrepreneur
# Table: entrepreneur
[
(Entrepreneur_ID:INT, PK, examples=[1, 2, 3]),
(People_ID:INT, examples=[1, 2, 3]),
(Company:TEXT, examples=['Umbrolly', 'Grails Ltd', 'Le Beanock']),
(Money_Requested:REAL, examples=[150000.0, 120000.0, 54000.0]),
(Investor:TEXT, examples=['Duncan Bannatyne', 'Dou... |
codebase_comments | How many methods with solutions with path 'maravillas_linq-to-delicious\tasty.sln'? | SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious\tasty.sln' | bird | 【DB_ID】 codebase_comments
# Table: Method
[
(Id:INTEGER, PK, examples=[1, 2, 3]),
(Name:TEXT, examples=['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement', 'IQ.Data.DbQueryProvider.GetQueryText']),
(FullComment:TEXT, examples=['Feeds data into the parser', ' interneral -- scan past <!ELEMENT ... |
shipping | How many shipments in 2017 were done by Sue Newell? | SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.first_name = 'Sue' AND T2.last_name = 'Newell' | bird | 【DB_ID】 shipping
# Table: city
[
(city_id:INTEGER, PK, examples=[100, 101, 102]),
(city_name:TEXT, examples=['Union City', 'Huntington Park', 'Passaic']),
(state:TEXT, examples=['New Jersey', 'California', 'New York']),
(population:INTEGER, examples=[67088, 61348, 67861]),
(area:REAL, examples=[1.3, 3.0, 3.1]... |
allergy_1 | Which advisor has most number of students? | SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1 | spider | 【DB_ID】 allergy_1
# Table: Allergy_Type
[
(Allergy:VARCHAR(20), PK, examples=['Eggs', 'Nuts', 'Milk']),
(AllergyType:VARCHAR(20), examples=['food', 'environmental', 'animal']),
]
# Table: Has_Allergy
[
(StuID:INTEGER, examples=[1001, 1002, 1003]),
(Allergy:VARCHAR(20), examples=['Cat', 'Shellfish', 'Tree Pollen... |
professional_basketball | Please list the top three shortest black players. | SELECT firstName, lastName FROM players WHERE race = 'B' AND height > 0 ORDER BY height ASC LIMIT 3 | bird | 【DB_ID】 professional_basketball
# Table: awards_players
[
(playerID:TEXT, PK1, examples=['abdulka01', 'abdulma02', 'adamsal01']),
(award:TEXT, PK3, examples=['All-Defensive Second Team', 'All-NBA Second Team', 'Rookie of the Year']),
(year:INTEGER, PK2, examples=[1969, 1970, 1971]),
(lgID:TEXT, examples=['NBA',... |
baseball_1 | For each year, return the year and the average number of attendance at home games. | SELECT YEAR , avg(attendance) FROM home_game GROUP BY YEAR; | spider | 【DB_ID】 baseball_1
# Table: all_star
[
(player_id:TEXT, examples=['gomezle01', 'ferreri01', 'gehrilo01']),
(year:INTEGER, examples=[1933, 1934, 1935]),
(game_num:INTEGER, examples=[0, 2, 1]),
(game_id:TEXT, examples=['ALS193307060', 'NLS193407100', 'ALS193507080']),
(team_id:TEXT, examples=['NYA', 'BOS', 'DET... |
human_resources | What is the education required for David Whitehead to reach his current position? | SELECT T2.educationrequired FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'David' AND T1.lastname = 'Whitehead' AND T1.gender = 'M' | bird | 【DB_ID】 human_resources
# Table: location
[
(locationID:INTEGER, PK, examples=[1, 2, 3]),
(locationcity:TEXT, examples=['Atlanta', 'Boston', 'Chicago']),
(address:TEXT, examples=['450 Peachtree Rd', '3 Commons Blvd', '500 Loop Highway']),
(state:TEXT, examples=['GA', 'MA', 'IL']),
(zipcode:INTEGER, examples=[... |
donor | Which city does the school that project "iMath" donated to in? | SELECT T1.school_city FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'iMath' | bird | 【DB_ID】 donor
# Table: essays
[
(projectid:TEXT, examples=['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']),
(teacher_acctid:TEXT, examples=['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6', '462270f5d5c212162fcab11afa2623cb']),
(ti... |
retail_complains | What is the percentage of complaints about the late fee issue whose priority is 2 in 2017? | SELECT CAST(SUM(CASE WHEN T1.priority = 2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2017' | bird | 【DB_ID】 retail_complains
# Table: state
[
(StateCode:TEXT, PK, examples=['AL', 'AR', 'AZ']),
(State:TEXT, examples=['Alabama', 'Arkansas', 'Arizona']),
(Region:TEXT, examples=['South', 'West', 'Northeast']),
]
# Table: callcenterlogs
[
(Date received:DATE, examples=['2017-03-27', '2017-03-23', '2017-03-22']),
... |
restaurants | where are some restaurants good for french food in the yosemite and mono lake area ? | SELECT t3.house_number , t1.name FROM restaurant AS t1 JOIN geographic AS t2 ON t1.city_name = t2.city_name JOIN LOCATION AS t3 ON t1.id = t3.restaurant_id WHERE t2.region = "yosemite and mono lake area" AND t1.food_type = "french" AND t1.rating > 2.5; | spider | 【DB_ID】 restaurants
# Table: GEOGRAPHIC
[
(CITY_NAME:TEXT, PK, examples=[]),
(COUNTY:TEXT, examples=[]),
(REGION:TEXT, examples=[]),
]
# Table: RESTAURANT
[
(ID:INT, PK, examples=[]),
(NAME:TEXT, examples=[]),
(FOOD_TYPE:TEXT, examples=[]),
(CITY_NAME:TEXT, examples=[]),
(RATING:REAL, examples=[]),
]
# ... |
bike_share_1 | On 8/29/2013 at 6:14:01 PM, how many bikes were borrowed from San Jose Diridon Caltrain Station? | SELECT SUM(T1.dock_count - T2.bikes_available) FROM station AS T1 INNER JOIN status AS T2 ON T1.id = T2.station_id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.time = '2013/08/29 06:14:01' | bird | 【DB_ID】 bike_share_1
# Table: station
[
(id:INTEGER, PK, examples=[2, 3, 4]),
(name:TEXT, examples=['San Jose Diridon Caltrain Station', 'San Jose Civic Center', 'Santa Clara at Almaden']),
(lat:REAL, examples=[37.329732, 37.330698, 37.333988]),
(long:REAL, examples=[-121.90178200000001, -121.888979, -121.89490... |
flight_4 | What is the name of the country with the most number of home airlines? | SELECT country FROM airlines GROUP BY country ORDER BY count(*) DESC LIMIT 1 | spider | 【DB_ID】 flight_4
# Table: routes
[
(rid:INTEGER, PK, examples=[37, 38, 39]),
(dst_apid:INTEGER, examples=[2990, 2962, 4078]),
(dst_ap:varchar(4), examples=['KZ', 'MRV', 'OVB']),
(src_apid:bigint, examples=[2965, 2966, 2968]),
(src_ap:varchar(4), examples=['AER', 'ASF', 'CEK']),
(alid:bigint, examples=[410, ... |
legislator | For how many terms have the oldest current legislator served? | SELECT COUNT(T2.bioguide) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = ( SELECT MIN(birthday_bio) FROM current ) | bird | 【DB_ID】 legislator
# Table: current
[
(ballotpedia_id:TEXT, examples=['Sherrod Brown', 'Maria Cantwell', 'Ben Cardin']),
(bioguide_id:TEXT, PK1, examples=['B000944', 'C000127', 'C000141']),
(birthday_bio:DATE, examples=['1952-11-09', '1958-10-13', '1943-10-05']),
(cspan_id:REAL, PK2, examples=[5051.0, 26137.0, ... |
movie | Which character has the longest screen time in the movie Batman? | SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman' ORDER BY T2.screentime DESC LIMIT 1 | bird | 【DB_ID】 movie
# Table: actor
[
(ActorID:INTEGER, PK, examples=[1, 2, 3]),
(Name:TEXT, examples=['John Travolta', 'Kirstie Alley', 'Olympia Dukakis']),
(Date of Birth:DATE, examples=['1954-02-18', '1951-01-12', '1931-06-20']),
(Birth City:TEXT, examples=['Englewood', 'Wichita', 'Lowell']),
(Birth Country:TEXT,... |
books | How many customers have an address that is located in the city of Villeneuve-la-Garenne? | SELECT COUNT(address_id) FROM address WHERE city = 'Villeneuve-la-Garenne' | bird | 【DB_ID】 books
# Table: address_status
[
(status_id:INTEGER, PK, examples=[1, 2]),
(address_status:TEXT, examples=['Active', 'Inactive']),
]
# Table: author
[
(author_id:INTEGER, PK, examples=[1, 2, 3]),
(author_name:TEXT, examples=['A. Bartlett Giamatti', 'A. Elizabeth Delany', 'A. Merritt']),
]
# Table: book_l... |
chicago_crime | Provide the responsible person and his/her email address of Chicago Lawn. | SELECT commander, email FROM District WHERE district_name = 'Chicago Lawn' | bird | 【DB_ID】 chicago_crime
# Table: Community_Area
[
(community_area_no:INTEGER, PK, examples=[1, 2, 3]),
(community_area_name:TEXT, examples=['Rogers Park', 'West Ridge', 'Uptown']),
(side:TEXT, examples=['Far North ', 'North ', 'Central']),
(population:TEXT, examples=['54,991', '71,942', '56,362']),
]
# Table: Dis... |
activity_1 | What are the first names of the faculty members playing both Canoeing and Kayaking? | SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T... | spider | 【DB_ID】 activity_1
# Table: Activity
[
(actid:INTEGER, PK, examples=[770, 771, 772]),
(activity_name:varchar(25), examples=['Mountain Climbing', 'Canoeing', 'Kayaking']),
]
# Table: Participates_in
[
(stuid:INTEGER, examples=[1001, 1002, 1003]),
(actid:INTEGER, examples=[770, 771, 777]),
]
# Table: Faculty_Part... |
store_1 | How many orders does Luca Mancini have in his invoices? | SELECT count(*) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"; | spider | 【DB_ID】 store_1
# Table: artists
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(name:VARCHAR(120), examples=['AC/DC', 'Accept', 'Aerosmith']),
]
# Table: albums
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(title:VARCHAR(160), examples=['For Those About To Rock We Salute You', 'Balls to the Wall', 'Restless and Wild']),
... |
soccer_2016 | Write down the name of players whose bowling skill is Legbreak. | SELECT T2.Player_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill WHERE T1.Bowling_skill = 'Legbreak' | bird | 【DB_ID】 soccer_2016
# Table: Batting_Style
[
(Batting_Id:INTEGER, PK, examples=[1, 2]),
(Batting_hand:TEXT, examples=['Left-hand bat', 'Right-hand bat']),
]
# Table: Bowling_Style
[
(Bowling_Id:INTEGER, PK, examples=[1, 2, 3]),
(Bowling_skill:TEXT, examples=['Right-arm medium', 'Right-arm offbreak', 'Right-arm ... |
regional_sales | Provide order number, warehouse code of customers Elorac, Corp. | SELECT DISTINCT T1.OrderNumber, T1.WarehouseCode FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Elorac, Corp' | 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']),
]
# ... |
chicago_crime | Among the crimes in the ward with the most population, how many of them are cases of domestic violence? | SELECT COUNT(T1.ward_no) AS num FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' ORDER BY T1.Population = ( SELECT Population FROM Ward ORDER BY Population DESC LIMIT 1 ) | bird | 【DB_ID】 chicago_crime
# Table: Community_Area
[
(community_area_no:INTEGER, PK, examples=[1, 2, 3]),
(community_area_name:TEXT, examples=['Rogers Park', 'West Ridge', 'Uptown']),
(side:TEXT, examples=['Far North ', 'North ', 'Central']),
(population:TEXT, examples=['54,991', '71,942', '56,362']),
]
# Table: Dis... |
movie_3 | List down all of the film titles that are rated for general audiences. | SELECT title FROM film WHERE rating = 'G' | 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 ... |
public_review_platform | Describe ID and active status of the business under category of "Diagnostic Imaging". | SELECT T2.business_id, T3.active FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name = 'Diagnostic Imaging' | bird | 【DB_ID】 public_review_platform
# Table: Attributes
[
(attribute_id:INTEGER, PK, examples=[1, 2, 3]),
(attribute_name:TEXT, examples=['Alcohol', 'Waiter Service', 'Delivery']),
]
# Table: Categories
[
(category_id:INTEGER, PK, examples=[1, 2, 3]),
(category_name:TEXT, examples=['Active Life', 'Arts & Entertainme... |
app_store | Indicate the number of installs and include the percentage of positive sentiments of FREEDOME VPN Unlimited anonymous Wifi Security. | SELECT T1.Installs , CAST(SUM(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE 0 END) * 100 / SUM(CASE WHEN T2.Sentiment IS NOT NULL THEN 1.0 ELSE 0 END) AS REAL) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'FREEDOME VPN Unlimited anonymous Wifi Security' | bird | 【DB_ID】 app_store
# Table: playstore
[
(App:TEXT, examples=['Photo Editor & Candy Camera & Grid & ScrapBook', 'Coloring book moana', 'U Launcher Lite – FREE Live Cool Themes, Hide Apps']),
(Category:TEXT, examples=['ART_AND_DESIGN', 'AUTO_AND_VEHICLES', 'BEAUTY']),
(Rating:REAL, examples=[4.1, 3.9, 4.7]),
(Revi... |
customer_complaints | Find the emails of customers who has filed a complaints of the product with the most complaints. | SELECT t1.email_address FROM customers AS t1 JOIN complaints AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) LIMIT 1 | 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... |
movielens | What is the proportion of action movies directors who are called 'box office success paradox'? | SELECT CAST(SUM(IIF(T2.avg_revenue > T2.d_quality, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN directors AS T2 ON T1.directorid = T2.directorid WHERE T1.genre = 'Action' | bird | 【DB_ID】 movielens
# Table: users
[
(userid:INTEGER, PK, examples=[1, 2, 3]),
(age:TEXT, examples=['1', '56', '25']),
(u_gender:TEXT, examples=['F', 'M']),
(occupation:TEXT, examples=['2', '3', '4']),
]
# Table: directors
[
(directorid:INTEGER, PK, examples=[67, 92, 284]),
(d_quality:INTEGER, examples=[4, 2,... |
simpson_episodes | Which title is the winner of Best International TV Series in 2017? | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Best International TV Series' AND SUBSTR(T1.year, 1, 4) = '2017'; | bird | 【DB_ID】 simpson_episodes
# Table: Episode
[
(episode_id:TEXT, PK, examples=['S20-E1', 'S20-E2', 'S20-E3']),
(season:INTEGER, examples=[20]),
(episode:INTEGER, examples=[1, 2, 3]),
(number_in_series:INTEGER, examples=[421, 422, 423]),
(title:TEXT, examples=['Sex, Pies and Idiot Scrapes', 'Lost Verizon', 'Doubl... |
food_inspection_2 | What is the inspection result for inspection done by Thomas Langley? | SELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Thomas' AND T1.last_name = 'Langley' | bird | 【DB_ID】 food_inspection_2
# Table: employee
[
(employee_id:INTEGER, PK, examples=[103705, 104633, 106581]),
(first_name:TEXT, examples=['Anastasia', 'Joshua', 'Zach']),
(last_name:TEXT, examples=['Hansen', 'Rosa', 'Barber']),
(address:TEXT, examples=['6023 S Elizabeth St', '5000 N Wolcott Ave', '7522 N Oleander... |
perpetrator | Show the date of the tallest perpetrator. | SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 | spider | 【DB_ID】 perpetrator
# Table: perpetrator
[
(Perpetrator_ID:INT, PK, examples=[1, 2, 3]),
(People_ID:INT, examples=[1, 3, 4]),
(Date:TEXT, examples=['04.26 April 26/27', '11.18 Nov. 18', '05.21 May 21']),
(Year:REAL, examples=[1982.0, 1995.0, 1938.0]),
(Location:TEXT, examples=['Uiryeong', 'Zhaodong', 'Kaio'])... |
movie_1 | How many movie ratings have more than 3 stars? | SELECT count(*) FROM Rating WHERE stars > 3 | spider | 【DB_ID】 movie_1
# Table: Movie
[
(mID:INT, PK, examples=[101, 102, 103]),
(title:TEXT, examples=['Gone with the Wind', 'Star Wars', 'The Sound of Music']),
(year:INT, examples=[1939, 1977, 1965]),
(director:TEXT, examples=['Victor Fleming', 'George Lucas', 'Robert Wise']),
]
# Table: Reviewer
[
(rID:INT, PK, ... |
public_review_platform | Please list the categories of the Yelp_Business that closes at 12PM on Sundays. | SELECT T4.category_name FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T4.category_id = T4.category_id WHERE T1.closing_time = '12PM' AND T2.day_of_week = 'Sunday' GROUP BY T4.category_name | bird | 【DB_ID】 public_review_platform
# Table: Attributes
[
(attribute_id:INTEGER, PK, examples=[1, 2, 3]),
(attribute_name:TEXT, examples=['Alcohol', 'Waiter Service', 'Delivery']),
]
# Table: Categories
[
(category_id:INTEGER, PK, examples=[1, 2, 3]),
(category_name:TEXT, examples=['Active Life', 'Arts & Entertainme... |
movie_platform | For movie id 1269, how many users, who was a paying subscriber and was eligible for trial when he rated the movie, gave the movie a rating score of less than or equal to 2? | SELECT COUNT(*) FROM ratings WHERE movie_id = 1269 AND rating_score <= 2 AND user_eligible_for_trial = 1 AND user_has_payment_method = 1 | bird | 【DB_ID】 movie_platform
# Table: lists
[
(user_id:INTEGER, examples=[88260493, 45204418, 48905025]),
(list_id:INTEGER, PK, examples=[1, 2, 3]),
(list_title:TEXT, examples=['Films that made your kid sister cry', 'Headscratchers', 'Sexy Time Movies']),
(list_movie_number:INTEGER, examples=[5, 3, 7]),
(list_updat... |
olympics | How many games has Prithipal Singh participated in? | SELECT COUNT(T2.games_id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Prithipal Singh' | bird | 【DB_ID】 olympics
# Table: city
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(city_name:TEXT, examples=['Barcelona', 'London', 'Antwerpen']),
]
# Table: games
[
(id:INTEGER, PK, examples=[1, 2, 3]),
(games_year:INTEGER, examples=[1992, 2012, 1920]),
(games_name:TEXT, examples=['1992 Summer', '2012 Summer', '1920 Su... |
scholar | How many papers used ImageNet dataset ? | SELECT DISTINCT COUNT ( DISTINCT t3.paperid ) FROM paperdataset AS t2 JOIN dataset AS t1 ON t2.datasetid = t1.datasetid JOIN paper AS t3 ON t3.paperid = t2.paperid WHERE t1.datasetname LIKE "ImageNet"; | 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... |
bike_1 | Count the number of trips that did not end in San Francisco city. | SELECT count(*) FROM trip AS T1 JOIN station AS T2 ON T1.end_station_id = T2.id WHERE T2.city != "San Francisco" | spider | 【DB_ID】 bike_1
# Table: station
[
(id:INTEGER, PK, examples=[2, 3, 4]),
(name:TEXT, examples=['San Jose Diridon Caltrain Station', 'San Jose Civic Center', 'Santa Clara at Almaden']),
(lat:NUMERIC, examples=[37.329732, 37.330698, 37.333988]),
(long:NUMERIC, examples=[-121.90178200000001, -121.888979, -121.89490... |
legislator | Please list the current official YouTube usernames of all the current female legislators. | SELECT T2.youtube FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.gender_bio = 'F' | bird | 【DB_ID】 legislator
# Table: current
[
(ballotpedia_id:TEXT, examples=['Sherrod Brown', 'Maria Cantwell', 'Ben Cardin']),
(bioguide_id:TEXT, PK1, examples=['B000944', 'C000127', 'C000141']),
(birthday_bio:DATE, examples=['1952-11-09', '1958-10-13', '1943-10-05']),
(cspan_id:REAL, PK2, examples=[5051.0, 26137.0, ... |
public_review_platform | How long was the review for business number 2 that user number 612 wrote? | SELECT review_length FROM Reviews WHERE user_id = 612 AND review_stars = 5 AND business_id = 2 | bird | 【DB_ID】 public_review_platform
# Table: Attributes
[
(attribute_id:INTEGER, PK, examples=[1, 2, 3]),
(attribute_name:TEXT, examples=['Alcohol', 'Waiter Service', 'Delivery']),
]
# Table: Categories
[
(category_id:INTEGER, PK, examples=[1, 2, 3]),
(category_name:TEXT, examples=['Active Life', 'Arts & Entertainme... |
sales | How many free or gift products are there? | SELECT COUNT(ProductID) FROM Products WHERE Price = 0 | 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])... |
flight_4 | Find the name of airline which runs the most number of routes. | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name ORDER BY count(*) DESC LIMIT 1 | spider | 【DB_ID】 flight_4
# Table: routes
[
(rid:INTEGER, PK, examples=[37, 38, 39]),
(dst_apid:INTEGER, examples=[2990, 2962, 4078]),
(dst_ap:varchar(4), examples=['KZ', 'MRV', 'OVB']),
(src_apid:bigint, examples=[2965, 2966, 2968]),
(src_ap:varchar(4), examples=['AER', 'ASF', 'CEK']),
(alid:bigint, examples=[410, ... |
college_3 | Find the distinct student first names of all students that have grade point at least 3.8 in one course. | SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade = T2.lettergrade AND T1.StuID = T3.StuID WHERE T2.gradepoint >= 3.8 | spider | 【DB_ID】 college_3
# 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=[6... |
customers_and_invoices | Show ids for all transactions whose amounts are greater than the average. | SELECT transaction_id FROM Financial_transactions WHERE transaction_amount > (SELECT avg(transaction_amount) FROM Financial_transactions) | spider | 【DB_ID】 customers_and_invoices
# Table: Customers
[
(customer_id:INTEGER, PK, examples=[1, 2, 3]),
(customer_first_name:VARCHAR(50), examples=['Dee', 'Brennon', 'Joesph']),
(customer_middle_initial:VARCHAR(1), examples=['A', 'H', 'K']),
(customer_last_name:VARCHAR(50), examples=['Larkin', 'Weimann', 'Schaefer']... |
wine_1 | How many wines are there for each grape? | SELECT count(*) , Grape FROM WINE GROUP BY Grape | spider | 【DB_ID】 wine_1
# Table: grapes
[
(ID:INTEGER, PK, examples=[1, 2, 3]),
(Grape:TEXT, examples=['Barbera', 'Cabernet Franc', 'Cabernet Sauvingnon']),
(Color:TEXT, examples=['Red', 'White']),
]
# Table: appellations
[
(No:INTEGER, PK, examples=[1, 2, 3]),
(Appelation:TEXT, examples=['Alexander Valley', 'Amador C... |
disney | Who is the villain in the movie "The Great Mouse Detective"? | SELECT villian FROM characters WHERE movie_title = 'The Great Mouse Detective' | 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'... |
mondial_geo | What is the GDP per capita in Switzerland? | SELECT T2.GDP / T1.Population FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Switzerland' | bird | 【DB_ID】 mondial_geo
# Table: borders
[
(Country1:TEXT, PK1, examples=['A', 'AFG', 'AL']),
(Country2:TEXT, PK2, examples=['CH', 'CZ', 'D']),
(Length:REAL, examples=[164.0, 362.0, 784.0]),
]
# Table: city
[
(Name:TEXT, PK1, examples=['Aachen', 'Aalborg', 'Aarau']),
(Country:TEXT, examples=['D', 'DK', 'CH']),
... |
geo | what state has the most people | SELECT state_name FROM state WHERE population = ( SELECT MAX ( population ) FROM state ); | 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... |
cre_Doc_Tracking_DB | Show the location codes and the number of documents in each location. | SELECT location_code , count(*) FROM Document_locations GROUP BY location_code | spider | 【DB_ID】 cre_Doc_Tracking_DB
# Table: Ref_Document_Types
[
(Document_Type_Code:CHAR(15), PK, examples=['CV', 'BK', 'PR']),
(Document_Type_Name:VARCHAR(255), examples=['CV', 'Book', 'Paper']),
(Document_Type_Description:VARCHAR(255), examples=['']),
]
# Table: Ref_Calendar
[
(Calendar_Date:DATETIME, PK, examples=... |
flight_4 | What is the name and city of the airport from most of the routes start? | SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid ORDER BY count(*) DESC LIMIT 1 | spider | 【DB_ID】 flight_4
# Table: routes
[
(rid:INTEGER, PK, examples=[37, 38, 39]),
(dst_apid:INTEGER, examples=[2990, 2962, 4078]),
(dst_ap:varchar(4), examples=['KZ', 'MRV', 'OVB']),
(src_apid:bigint, examples=[2965, 2966, 2968]),
(src_ap:varchar(4), examples=['AER', 'ASF', 'CEK']),
(alid:bigint, examples=[410, ... |
legislator | Provide the address of the legislator with the contact form of http://www.carper.senate.gov/contact/. | SELECT address FROM `current-terms` WHERE contact_form = 'http://www.carper.senate.gov/contact/' | bird | 【DB_ID】 legislator
# Table: current
[
(ballotpedia_id:TEXT, examples=['Sherrod Brown', 'Maria Cantwell', 'Ben Cardin']),
(bioguide_id:TEXT, PK1, examples=['B000944', 'C000127', 'C000141']),
(birthday_bio:DATE, examples=['1952-11-09', '1958-10-13', '1943-10-05']),
(cspan_id:REAL, PK2, examples=[5051.0, 26137.0, ... |
inn_1 | What are the room name and base price of the room with the lowest base price? | SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1; | spider | 【DB_ID】 inn_1
# Table: Rooms
[
(RoomId:TEXT, PK, examples=['RND', 'IBS', 'AOB']),
(roomName:TEXT, examples=['Recluse and defiance', 'Interim but salutary', 'Abscond or bolster']),
(beds:INTEGER, examples=[1, 2]),
(bedType:TEXT, examples=['King', 'Queen', 'Double']),
(maxOccupancy:INTEGER, examples=[2, 4]),
... |
soccer_2016 | Which country is the oldest player from? | SELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.Country_Name IS NOT NULL ORDER BY T2.DOB LIMIT 1 | bird | 【DB_ID】 soccer_2016
# Table: Batting_Style
[
(Batting_Id:INTEGER, PK, examples=[1, 2]),
(Batting_hand:TEXT, examples=['Left-hand bat', 'Right-hand bat']),
]
# Table: Bowling_Style
[
(Bowling_Id:INTEGER, PK, examples=[1, 2, 3]),
(Bowling_skill:TEXT, examples=['Right-arm medium', 'Right-arm offbreak', 'Right-arm ... |
ice_hockey_draft | Who has played the most game plays in the 2000-2001 season of the International league? | SELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' ORDER BY T1.GP DESC LIMIT 1 | bird | 【DB_ID】 ice_hockey_draft
# Table: height_info
[
(height_id:INTEGER, PK, examples=[65, 67, 68]),
(height_in_cm:INTEGER, examples=[165, 170, 172]),
(height_in_inch:TEXT, examples=['5\'5"', '5\'7"', '5\'8"']),
]
# Table: weight_info
[
(weight_id:INTEGER, PK, examples=[154, 159, 161]),
(weight_in_kg:INTEGER, exam... |
ice_hockey_draft | List out the name of players who weight 190 lbs. | SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_lbs = 190 | bird | 【DB_ID】 ice_hockey_draft
# Table: height_info
[
(height_id:INTEGER, PK, examples=[65, 67, 68]),
(height_in_cm:INTEGER, examples=[165, 170, 172]),
(height_in_inch:TEXT, examples=['5\'5"', '5\'7"', '5\'8"']),
]
# Table: weight_info
[
(weight_id:INTEGER, PK, examples=[154, 159, 161]),
(weight_in_kg:INTEGER, exam... |
cre_Docs_and_Epenses | What are the statement id and statement detail for the statement that has the most corresponding accounts? | SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1 | 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
... |
geo | what state has the largest population density | SELECT state_name FROM state WHERE density = ( SELECT MAX ( density ) FROM state ); | 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... |
student_assessment | List the id of students who attended some courses? | SELECT student_id FROM student_course_attendance | spider | 【DB_ID】 student_assessment
# Table: Addresses
[
(address_id:INTEGER, PK, examples=[5, 9, 29]),
(line_1:VARCHAR(80), examples=['0900 Roderick Oval\nNew Albina, WA 19200-7914', '966 Dach Ports Apt. 322\nLake Harmonyhaven, VA 65235', '28550 Broderick Underpass Suite 667\nZakaryhaven, WY 22945-1534']),
(line_2:VARCHA... |
works_cycles | How many employees came into the Quality Assurance Group in the year 2007? | SELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T2.GroupName = 'Quality Assurance' AND STRFTIME('%Y', T1.StartDate) = '2007' | bird | 【DB_ID】 works_cycles
# Table: CountryRegion
[
(CountryRegionCode:TEXT, PK, examples=['Cou', 'AD', 'AE']),
(Name:TEXT, examples=['Name', 'Andorra', 'United Arab Emirates']),
(ModifiedDate:DATETIME, examples=['ModifiedDate', '2008-04-30 00:00:00.0']),
]
# Table: Culture
[
(CultureID:TEXT, PK, examples=['', 'ar', ... |
movielens | What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre. | SELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid =... | bird | 【DB_ID】 movielens
# Table: users
[
(userid:INTEGER, PK, examples=[1, 2, 3]),
(age:TEXT, examples=['1', '56', '25']),
(u_gender:TEXT, examples=['F', 'M']),
(occupation:TEXT, examples=['2', '3', '4']),
]
# Table: directors
[
(directorid:INTEGER, PK, examples=[67, 92, 284]),
(d_quality:INTEGER, examples=[4, 2,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.