instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_32 ( fastest_lap VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Jimmy Vasser's fastest lap?
SELECT fastest_lap FROM table_name_32 WHERE winning_driver = "jimmy vasser"
sql_create_context
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CO...
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY COUNT(CRS_CODE) DESC
nvbench
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d_...
mimic_iii
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 AN...
atis
CREATE TABLE table_1622 ( "Official Name" text, "Status" text, "Area km 2" text, "Population" real, "Census Ranking" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of status for eldon
SELECT COUNT("Status") FROM table_1622 WHERE "Official Name" = 'Eldon'
wikisql
CREATE TABLE table_77263 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT POSITION HAS A ROUND LARGER THAN 2, FOR VALDOSTA COLLEGE?
SELECT "Position" FROM table_77263 WHERE "Round" > '2' AND "College" = 'valdosta'
wikisql
CREATE TABLE table_28846752_8 ( average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many entries is under 50s column when the average is 39.60?
SELECT 50 AS s FROM table_28846752_8 WHERE average = "39.60"
sql_create_context
CREATE TABLE table_10254 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest capacity when the largest number in attendance is 6,192?
SELECT MAX("Capacity") FROM table_10254 WHERE "Highest" > '6,192'
wikisql
CREATE TABLE table_27422 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" real, "Score-Final" text, "Rank-Qualifying" real, "Score-Qualifying" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Location" FROM table_27422 WHERE "Score-Qualifying" = '58.425'
wikisql
CREATE TABLE table_name_96 ( iucn VARCHAR, est VARCHAR, reserve VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IUCN for the gales point reserve when the Est. is 1998?
SELECT iucn FROM table_name_96 WHERE est = 1998 AND reserve = "gales point"
sql_create_context
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_F...
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_202_28 ( id number, "year" number, "output growth rate %" number, "unemployment rate %" number, "inflation rate %" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- were the highest unemployment rates in japan before or after the y...
SELECT (SELECT "year" FROM table_202_28 WHERE "unemployment rate %" = (SELECT MAX("unemployment rate %") FROM table_202_28)) < 2000
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0366537' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-27' AND '2017-04-29' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 19 UNION SELECT gyb.MED_ORG_DEPT_CD,...
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue)
nvbench
CREATE TABLE table_27662 ( "Date" text, "Tournament" text, "Location" text, "Opponent" text, "Stadium" text, "Score" text, "Indian Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the Indian scorers is the Chinadorai Sabeeth, what ...
SELECT "Score" FROM table_27662 WHERE "Indian Scorers" = 'Chinadorai Sabeeth'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '姜淑华' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 2959.88)
css
CREATE TABLE table_12060 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the player from Finland, what is the highest overall pick rank?
SELECT MAX("Overall") FROM table_12060 WHERE "Nationality" = 'finland'
wikisql
CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) CREATE TABLE pilot ( Pilot_Id int(11), Name varchar(50...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description
nvbench
CREATE TABLE table_27713583_8 ( game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game number was on January 14?
SELECT game FROM table_27713583_8 WHERE date = "January 14"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT *, COUNT(*) AS count, DAY(LAST_DATE_OF_MONTH(month)) AS DaysInMonth FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS month FROM Posts WHERE Tags LIKE '%javascript%' AND NOT Tags LIKE '%ecmascript-6%' AND NOT Tags LIKE '%ecmascript-2...
sede
CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connection text ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int ) CREATE TABLE browser ( id int, name text, market_shar...
SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id
nvbench
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_len...
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name
nvbench
CREATE TABLE table_33364 ( "Station" text, "Municipality" text, "County" text, "Former railroad" text, "Closed" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What municipality is the Benson Street station located in?
SELECT "Municipality" FROM table_33364 WHERE "Station" = 'benson street'
wikisql
CREATE TABLE table_15395 ( "Date" text, "Opponent" text, "Site" text, "Score" text, "Loss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the date that had a Loss of Shirley (0-1)?
SELECT "Date" FROM table_15395 WHERE "Loss" = 'shirley (0-1)'
wikisql
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChang...
SELECT Id AS "post_link", Score, Id FROM Posts WHERE Body LIKE '%\\(%' OR Body LIKE '%\\[%' ORDER BY Score DESC
sede
CREATE TABLE Reviewer ( name VARCHAR, rID VARCHAR ) CREATE TABLE Rating ( rID VARCHAR, stars VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of reviewers who had rated 3 star and 4 star?
SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4
sql_create_context
CREATE TABLE table_name_77 ( name VARCHAR, kanji VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which name has a Kanji of ?
SELECT name FROM table_name_77 WHERE kanji = "朧"
sql_create_context
CREATE TABLE Circulation_History ( document_id INTEGER, draft_number INTEGER, copy_number INTEGER, employee_id INTEGER ) CREATE TABLE Ref_Document_Types ( document_type_code CHAR(15), document_type_description VARCHAR(255) ) CREATE TABLE Documents_Mailed ( document_id INTEGER, mailed_t...
SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
nvbench
CREATE TABLE table_59332 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Opponent is 'Ivo Min '?
SELECT "Score" FROM table_59332 WHERE "Opponent" = 'ivo minář'
wikisql
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_desc...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_1 ( profession VARCHAR, name VARCHAR, entered_the_house VARCHAR, evicted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the profession of Skaj Vikler, who entered the house on day 1 and was evicted on day 29?
SELECT profession FROM table_name_1 WHERE entered_the_house = "day 1" AND evicted = "day 29" AND name = "skaj vikler"
sql_create_context
CREATE TABLE table_name_85 ( notes VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the notes for the time at 3:19.167?
SELECT notes FROM table_name_85 WHERE time = "3:19.167"
sql_create_context
CREATE TABLE Elimination ( Team VARCHAR, Eliminated_By VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the teams that have both wrestlers eliminated by 'Orton' and wrestlers eliminated by 'Benjamin'.
SELECT Team FROM Elimination WHERE Eliminated_By = "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By = "Benjamin"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Closed biopsy of tongue"
mimicsql_data
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '金夏彤' AND hz_info.YLJGDM = '9134683' AND zyjzjlb.CYKSMC LIKE '%计划生育%'
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, pat...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '016-9636' AND patient.wardid = 613 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_53148 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team plays at victoria park?
SELECT "Home team" FROM table_53148 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_13258823_2 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for september 15, 1985
SELECT record FROM table_13258823_2 WHERE date = "September 15, 1985"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38212')) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CU...
eicu
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'a...
mimic_iii
CREATE TABLE table_65310 ( "Points" real, "Name" text, "Club" text, "Tries" real, "Drop" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many drops have Tries smaller than 5, and Points larger than 212?
SELECT COUNT("Drop") FROM table_65310 WHERE "Tries" < '5' AND "Points" > '212'
wikisql
CREATE TABLE table_name_44 ( leading_scorer VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the leading scorer of the game on 20 February 2008?
SELECT leading_scorer FROM table_name_44 WHERE date = "20 february 2008"
sql_create_context
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) ...
SELECT Season, COUNT(Season) FROM game GROUP BY Away_team ORDER BY Season DESC
nvbench
CREATE TABLE table_18149 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What party is Frank Lobiondo a member of?
SELECT "Party" FROM table_18149 WHERE "Incumbent" = 'Frank LoBiondo'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Na...
SELECT OwnerUserId AS userid, MAX(Users.DisplayName) AS displayname, MAX(Users.Reputation) AS reputation, MAX(Users.AboutMe) AS aboutme, MAX(Users.Location) AS location, COUNT(Posts.Id) AS numanswers FROM Posts, Users WHERE Posts.Id IN (SELECT AcceptedAnswerId FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%devops%') A...
sede
CREATE TABLE table_2665085_1 ( park VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What park is Boardwalk Bullet located in?
SELECT park FROM table_2665085_1 WHERE name = "Boardwalk Bullet"
sql_create_context
CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) -...
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_702 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Henry Hyde's opponent in the race?
SELECT "Opponent" FROM table_702 WHERE "Incumbent" = 'Henry Hyde'
wikisql
CREATE TABLE table_2008069_2 ( pinyin VARCHAR, uyghur___yenɡi_yezik̢__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pinyin for k kyar k ir iz yezisi
SELECT pinyin FROM table_2008069_2 WHERE uyghur___yenɡi_yezik̢__ = "Kɵkyar K̡irƣiz yezisi"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 86744 AND STRFTIME('%y', admissions.admittime) <= '2104'
mimic_iii
CREATE TABLE table_14896 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rank of a mountain range located in Maine?
SELECT AVG("Rank") FROM table_14896 WHERE "State" = 'maine'
wikisql
CREATE TABLE table_204_310 ( id number, "month" text, "year" number, "player" text, "county" text, "club" text, "position" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the total number of winners from club ballyhale shamrocks ?
SELECT COUNT("player") FROM table_204_310 WHERE "club" = 'ballyhale shamrocks'
squall
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM location AS LOCATIONalias1, restaurant AS RESTAURANTalias1 W...
restaurants
CREATE TABLE table_203_655 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- besides belgium what other team did he score on ...
SELECT "opponent" FROM table_203_655 WHERE "opponent" <> 'belgium' AND "date" = 2001
squall
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id nu...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acute kidney failu...
mimic_iii
CREATE TABLE table_17985 ( "No." real, "Air Date" text, "Rating" text, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Night" real, "Timeslot" real, "Overall" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many vi...
SELECT COUNT("Viewers (m)") FROM table_17985 WHERE "Overall" = '91/101'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId numbe...
SELECT answers.date, answers.count AS answers, questions.count AS questions FROM (SELECT DATETIMEFROMPARTS(TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m'), 1, 0, 0, 0, 0) AS date, COUNT(*) AS count FROM Posts WHERE PostTypeId = 2 GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m')...
sede
CREATE TABLE table_237 ( "Power Source" text, "Number of Generators" real, "Power Capacity (GW)" text, "% of total Capacity" text, "Capacity factor" text, "Annual Energy (billion kWh)" text, "% of annual production" text ) -- Using valid SQLite, answer the following questions for the table...
SELECT "% of total Capacity" FROM table_237 WHERE "Annual Energy (billion kWh)" = '120.2'
wikisql
CREATE TABLE table_17712 ( "Name of System" text, "Location" text, "Traction Type" text, "Date (From)" text, "Date (To)" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date (from) where date (to) is 1919?
SELECT "Date (From)" FROM table_17712 WHERE "Date (To)" = '1919'
wikisql
CREATE TABLE table_24754 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Languages" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the director of the original title ...
SELECT "Director" FROM table_24754 WHERE "Original title" = 'Perl oder Pica'
wikisql
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What a...
SELECT name, price FROM products
spider
CREATE TABLE table_name_45 ( type VARCHAR, year_s_ VARCHAR, bie_recognised VARCHAR, festival_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the type when the bie recognised is yes, festival name is floriade and the year(s) is 2002?
SELECT type FROM table_name_45 WHERE bie_recognised = "yes" AND festival_name = "floriade" AND year_s_ = "2002"
sql_create_context
CREATE TABLE table_47971 ( "Date" text, "Opponent" text, "Home / Away" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Opponent" FROM table_47971 WHERE "Score" = '95-101'
wikisql
CREATE TABLE table_203_608 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what country ranks first in total medals won ?
SELECT "nation" FROM table_203_608 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Return a histogram on what ...
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC
nvbench
CREATE TABLE table_name_80 ( role VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the role in 1996?
SELECT role FROM table_name_80 WHERE year = "1996"
sql_create_context
CREATE TABLE table_15926991_1 ( weight__kg_ VARCHAR, jockey VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the entry for weight in kilograms of jockey D. Nikolic?
SELECT weight__kg_ FROM table_15926991_1 WHERE jockey = "D. Nikolic"
sql_create_context
CREATE TABLE table_75060 ( "Team" text, "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text, "Week 6" text, "Week 7" text, "Week 8 Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the week 3 of 36
SELECT "Week 1" FROM table_75060 WHERE "Week 3" = '36'
wikisql
CREATE TABLE table_23986 ( "Model Type" text, "Model Designation" text, "Engine" text, "Wheelbase (mm/inch)" text, "GVW (kg/ton)" text, "Axle Ratio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Wheelbase for Model 97300?
SELECT "Wheelbase (mm/inch)" FROM table_23986 WHERE "Model Designation" = '97300'
wikisql
CREATE TABLE table_17228 ( "State" text, "Norwegian Americans (1980)" real, "Percent (1980)" text, "Norwegian Americans (1990)" real, "Percent (1990)" text, "Norwegian Americans (2000)" real, "Percent (2000)" text, "Norwegian Americans (2009)" real, "Percent (2009)" text ) -- Using...
SELECT "Percent (1990)" FROM table_17228 WHERE "State" = 'Mississippi'
wikisql
CREATE TABLE table_name_19 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was South Melbourne's score as the home team?
SELECT home_team AS score FROM table_name_19 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE table_48243 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Format, when Region is United States?
SELECT "Format" FROM table_48243 WHERE "Region" = 'united states'
wikisql
CREATE TABLE table_26280 ( "Level" text, "Luma samples/s" real, "Macroblocks/s" real, "Luma samples" real, "Macroblocks" real, "Baseline, Extended and Main Profiles" real, "High Profile" real, "High 10 Profile" real, "Examples for high resolution @ highest frame rate (max stored fram...
SELECT "Level" FROM table_26280 WHERE "Macroblocks/s" = '11880' AND "High 10 Profile" = '6000'
wikisql
CREATE TABLE table_train_10 ( "id" int, "severe_sepsis" bool, "consent" bool, "raising_legs_or_head" bool, "intention_to_arterial_catheter" bool, "allergy_to_adhesive" bool, "intention_to_central_venous_catheter" bool, "septic_shock" bool, "age" float, "NOUSE" float ) -- Using ...
SELECT * FROM table_train_10 WHERE consent = 0
criteria2sql
CREATE TABLE elimination ( Team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show different teams in eliminations and the number of eliminations from each team.
SELECT Team, COUNT(*) FROM elimination GROUP BY Team
sql_create_context
CREATE TABLE table_name_1 ( score VARCHAR, outcome VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score with an Outcome of runner-up, and a Partner that is elizabeth little?
SELECT score FROM table_name_1 WHERE outcome = "runner-up" AND partner = "elizabeth little"
sql_create_context
CREATE TABLE table_name_63 ( copa_del_rey INTEGER, name VARCHAR, fifa_club_world_championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Copa del Rey has a Name of guti, and a FIFA Club World Championship smaller than 0?
SELECT SUM(copa_del_rey) FROM table_name_63 WHERE name = "guti" AND fifa_club_world_championship < 0
sql_create_context
CREATE TABLE table_41855 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity in use" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Which rank was there a location of porto alegre?
SELECT "Rank" FROM table_41855 WHERE "Location" = 'porto alegre'
wikisql
CREATE TABLE table_train_76 ( "id" int, "mini_mental_state_examination_mmse" int, "language" string, "csf" int, "rosen_modified_hachinski_ischemic_score" int, "ad" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT * FROM table_train_76 WHERE ad = 1 AND csf < 600
criteria2sql
CREATE TABLE table_46461 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Manufacturer that has the Rider of stefan bradl?
SELECT "Manufacturer" FROM table_46461 WHERE "Rider" = 'stefan bradl'
wikisql
CREATE TABLE table_204_786 ( id number, "riding" text, "candidate" text, "gender" text, "residence" text, "occupation" text, "votes" number, "%" number, "rank" text, "biographical notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "votes" FROM table_204_786 WHERE "candidate" = 'megan leslie'
squall
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_8067 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Assists, when Name is 'Pablo Prigioni', and when Games is greater than 21?
SELECT COUNT("Assists") FROM table_8067 WHERE "Name" = 'pablo prigioni' AND "Games" > '21'
wikisql
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGE...
SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY AVG(Amount_Payment)
nvbench
CREATE TABLE table_name_36 ( engine VARCHAR, team VARCHAR, drivers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine does Chip Mead of Parts Washer Service use?
SELECT engine FROM table_name_36 WHERE team = "parts washer service" AND drivers = "chip mead"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '04369427' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片')
css
CREATE TABLE table_26375386_28 ( number_of_dances VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers of dances for place 1?
SELECT COUNT(number_of_dances) FROM table_26375386_28 WHERE place = 1
sql_create_context
CREATE TABLE table_40189 ( "Club" text, "City" text, "Stadium" text, "2009 season" text, "Group" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City has a Stadium of estadio san crist bal?
SELECT "City" FROM table_40189 WHERE "Stadium" = 'estadio san cristóbal'
wikisql
CREATE TABLE table_69067 ( "Stage" text, "Date" text, "Course" text, "Distance" text, "Winner" text, "Race Leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner for the Rome to Teramo course?
SELECT "Winner" FROM table_69067 WHERE "Course" = 'rome to teramo'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '06203278' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '蜜炼川贝枇杷膏') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '06203278' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.ME...
css
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname DESC
nvbench
CREATE TABLE table_name_62 ( counties INTEGER, candidate VARCHAR, delegates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Counties when Mitt Romney was the candidate with less than 0 delegates?
SELECT MAX(counties) FROM table_name_62 WHERE candidate = "mitt romney" AND delegates < 0
sql_create_context
CREATE TABLE table_3749 ( "District" text, "Armenian" text, "Population (2001)" real, "Area (km\u00b2)" text, "Neighborhoods" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is known in Armenian as - ?
SELECT "District" FROM table_3749 WHERE "Armenian" = 'Քանաքեր-Զեյթուն'
wikisql
CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id nu...
SELECT date, mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
spider
CREATE TABLE table_1898 ( "Position" real, "Sail Number" text, "Yacht" text, "State/Country" text, "Yacht Type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed Time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 6606...
SELECT "Yacht Type" FROM table_1898 WHERE "Sail Number" = '6606'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, pat...
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE STRFTIME('%y', microlab.culturetakentime) = '2104' GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_78538 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school has a quarterback?
SELECT "School" FROM table_78538 WHERE "Position" = 'quarterback'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff blood agent nec'))
mimic_iii
CREATE TABLE table_name_18 ( number INTEGER, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number for Black Milk?
SELECT AVG(number) FROM table_name_18 WHERE artist = "black milk"
sql_create_context