instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
View... | SELECT Id AS "post_link", Score FROM Posts WHERE LENGTH(Body) < 50 AND Score > 20 AND PostTypeId = 2 ORDER BY Score DESC LIMIT 20 | sede |
CREATE TABLE table_name_12 (
year INTEGER,
series_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The highest year for the series titled dragon laws ii: kidnapped is what?
| SELECT MAX(year) FROM table_name_12 WHERE series_title = "dragon laws ii: kidnapped" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | SELECT t_kc21.MED_AMOUT FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '96029052101' | css |
CREATE TABLE table_29299 (
"Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." real,
"Series No." real,
"Episode" text,
"Director" text,
"Writer(s)" text,
"Original airdate" text
)
-- Using v... | SELECT "Original airdate" FROM table_29299 WHERE "Episode" = 'The Raid' | wikisql |
CREATE TABLE table_6961 (
"Date" text,
"Title" text,
"Director" text,
"Producer" text,
"Production Cost" text,
"Singapore Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the Singapore Gross for the film that Siu Wing directed?
| SELECT "Singapore Gross" FROM table_6961 WHERE "Director" = 'siu wing' | wikisql |
CREATE TABLE table_50422 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE RANK WITH A GROSS OF $96,773,200?
| SELECT COUNT("Rank") FROM table_50422 WHERE "Gross" = '$96,773,200' | wikisql |
CREATE TABLE table_name_97 (
week_14__final__dec_7 VARCHAR,
week_8_oct_26 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the week 14 (final) dec 7 standing with Florida (6-1) on week 8 Oct 26?
| SELECT week_14__final__dec_7 FROM table_name_97 WHERE week_8_oct_26 = "florida (6-1)" | sql_create_context |
CREATE TABLE table_52008 (
"Number" real,
"Type" text,
"Clock" text,
"Scratch" text,
"Memory" text,
"Cache" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Cache for a Number 64 with a Memory of 24 gb qpi 5.86 gt/s?
| SELECT "Cache" FROM table_52008 WHERE "Memory" = '24 gb qpi 5.86 gt/s' AND "Number" = '64' | wikisql |
CREATE TABLE table_8265 (
"Name" text,
"Company" text,
"Tracking Method" text,
"Latest stable release" text,
"Price in USD" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Tracking Method which has a Company of mapmyuser, llc?
| SELECT "Tracking Method" FROM table_8265 WHERE "Company" = 'mapmyuser, llc' | wikisql |
CREATE TABLE table_name_22 (
previous_conference VARCHAR,
ihsaa_class___football_soccer VARCHAR,
year_joined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Previous Conference has an IHSAA Class/ Football/ Soccer of 4a/5a/2a, and a Year Joined larg... | SELECT previous_conference FROM table_name_22 WHERE ihsaa_class___football_soccer = "4a/5a/2a" AND year_joined > 1926 | sql_create_context |
CREATE TABLE table_49677 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Comp" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was G teborg the opponent with a score of 3-1?
| SELECT "Date" FROM table_49677 WHERE "Opponents" = 'göteborg' AND "Score" = '3-1' | wikisql |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_15635768_1 (
place_of_issue VARCHAR,
ecosystem VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location has the ecosystem of kelp forest?
| SELECT place_of_issue FROM table_15635768_1 WHERE ecosystem = "Kelp Forest" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-129568')) AND STRFTIME('%y-%m', allergy.allergytime) = '2101-06' | eicu |
CREATE TABLE table_77822 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the Chiefs November 27, 1994 game?
| SELECT "Result" FROM table_77822 WHERE "Date" = 'november 27, 1994' | wikisql |
CREATE TABLE table_204_57 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was madhurima 's biggest year in terms of number of roles ?
| SELECT "year" FROM table_204_57 GROUP BY "year" ORDER BY COUNT("film") DESC LIMIT 1 | squall |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE <= 20) | css |
CREATE TABLE table_67674 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MIN("Goals against") FROM table_67674 WHERE "Wins" < '16' AND "Draws" > '14' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_28376 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the m... | SELECT MIN("Poles") FROM table_28376 | 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 AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '5553193' AND IN_HOSP_DATE BETWEEN '2006-05-20' AND '2014-03-09' | css |
CREATE TABLE table_name_21 (
pick__number INTEGER,
college VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average draft pick number from Carson-Newman College before Round 7?
| SELECT AVG(pick__number) FROM table_name_21 WHERE college = "carson-newman" AND round < 7 | sql_create_context |
CREATE TABLE table_name_59 (
concacaf INTEGER,
superliga VARCHAR,
merconorte VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average concacaf for merconorte larger than 0 and player of jared borgetti
| SELECT AVG(concacaf) FROM table_name_59 WHERE merconorte > 0 AND player = "jared borgetti" AND superliga > 0 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear >= "2174" | mimicsql_data |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... | eicu |
CREATE TABLE table_19566 (
"Rank" real,
"Country" text,
"International tourist arrivals (2011)" text,
"International tourist arrivals (2010)" text,
"Change (2010 to 2011)" text,
"Change (2009 to 2010)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Change (2010 to 2011)" FROM table_19566 WHERE "International tourist arrivals (2011)" = '1.7 million' | wikisql |
CREATE TABLE table_name_25 (
year INTEGER,
wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is listed as the lowest Year with a Wins that's smaller than 0?
| SELECT MIN(year) FROM table_name_25 WHERE wins < 0 | sql_create_context |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '76511941624' | css |
CREATE TABLE table_name_23 (
pos INTEGER,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pos has a Driver of brian scott (r)?
| SELECT SUM(pos) FROM table_name_23 WHERE driver = "brian scott (r)" | sql_create_context |
CREATE TABLE table_10702 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date when the Lakers were the home team?
| SELECT "Date" FROM table_10702 WHERE "Home" = 'lakers' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID DESC | nvbench |
CREATE TABLE table_51991 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of bronze Andorra, who has more than 6 total medals, has?
| SELECT MIN("Bronze") FROM table_51991 WHERE "Nation" = 'andorra' AND "Total" > '6' | wikisql |
CREATE TABLE table_33138 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the top goal for the result of 2 3?
| SELECT MAX("Goal") FROM table_33138 WHERE "Result" = '2–3' | wikisql |
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_addr... | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_9151 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Player had a Score of 70-69-75=214?
| SELECT "Player" FROM table_9151 WHERE "Score" = '70-69-75=214' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiolo... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'mv collision nos-driver') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 44625 AND NOT admi... | mimic_iii |
CREATE TABLE table_24278858_2 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week did they play the amsterdam admirals?
| SELECT MAX(week) FROM table_24278858_2 WHERE opponent = "Amsterdam Admirals" | sql_create_context |
CREATE TABLE table_24257833_4 (
minor_version VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the minor version released on April 16, 2008?
| SELECT minor_version FROM table_24257833_4 WHERE release_date = "April 16, 2008" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_tit... | 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 = 14054) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_47167 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Visitor of the game with a Record of 21 17 13?
| SELECT "Visitor" FROM table_47167 WHERE "Record" = '21–17–13' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "12" | mimicsql_data |
CREATE TABLE table_23316034_23 (
dismissals INTEGER,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least dismissals for sammy carter
| SELECT MIN(dismissals) FROM table_23316034_23 WHERE player = "Sammy Carter" | sql_create_context |
CREATE TABLE table_1039 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points were scored by someone who's positi... | SELECT COUNT("Points") FROM table_1039 WHERE "Position" = 'Right tackle' | wikisql |
CREATE TABLE table_16278894_1 (
area__km_2__ VARCHAR,
population_census_2009 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many numbers were listed under area with a population of 240075 as of 2009?
| SELECT COUNT(area__km_2__) FROM table_16278894_1 WHERE population_census_2009 = 240075 | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-41152')) AND medication.routeadmin = 'in' AND DATETIME(med... | eicu |
CREATE TABLE table_name_15 (
overall INTEGER,
name VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the pick was below 42 and the player was Chris Horton, what's the highest Overall pick found?
| SELECT MAX(overall) FROM table_name_15 WHERE name = "chris horton" AND pick < 42 | sql_create_context |
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl ... | SELECT player, years_played FROM player | spider |
CREATE TABLE table_name_37 (
general_classification VARCHAR,
young_rider_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the general classification with riccardo ricc as the young rider classification?
| SELECT general_classification FROM table_name_37 WHERE young_rider_classification = "riccardo riccò" | sql_create_context |
CREATE TABLE table_49129 (
"Team" text,
"City" text,
"State/Province" text,
"League" text,
"Est." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what year was the cfl team in edmonton, alberta established?
| SELECT "Est." FROM table_49129 WHERE "State/Province" = 'alberta' AND "League" = 'cfl' AND "City" = 'edmonton' | wikisql |
CREATE TABLE table_name_23 (
weight VARCHAR,
date_of_birth VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the weight of the entry that has a date of birth of 1981-11-21?
| SELECT weight FROM table_name_23 WHERE date_of_birth = "1981-11-21" | sql_create_context |
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Engineer_Visits (
... | SELECT part_name, COUNT(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY part_name | nvbench |
CREATE TABLE table_name_65 (
time VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long did it take to ride when the laps were 23 and the grid of 13?
| SELECT time FROM table_name_65 WHERE laps = 23 AND grid = 13 | sql_create_context |
CREATE TABLE table_name_58 (
opponent_in_the_final VARCHAR,
outcome VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Opponent in final with an All England Open Outcome?
| SELECT opponent_in_the_final FROM table_name_58 WHERE outcome = "all england open" | sql_create_context |
CREATE TABLE table_25524 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the episode whose number of the se... | SELECT "Title" FROM table_25524 WHERE "No. in series" = '31' | wikisql |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | 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 ((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 22 AND da... | atis |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-46802')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe... | eicu |
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
... | SELECT COUNT(*), SUM(student_capacity), gender FROM dorm GROUP BY gender | spider |
CREATE TABLE table_73579 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the epis... | SELECT "Written by" FROM table_73579 WHERE "Directed by" = 'Karen Gaviola' | wikisql |
CREATE TABLE table_name_68 (
language VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language was Taken in?
| SELECT language FROM table_name_68 WHERE title = "taken" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 82235 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
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 wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '张采文' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-07-1... | css |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(*) FROM t_kc24 WHERE PERSON_ID = '75766226' AND CLINIC_SLT_DATE BETWEEN '2000-01-12' AND '2019-03-30' AND MED_AMOUT <= 10 | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | SELECT zyjzjlb.JZLSH 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.RYBH = '17949881' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2010-11-01') | css |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '周锐利' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | SELECT COUNT(*) FROM medication WHERE medication.drugname = '15 ml vial : sodium phosphate 3 mmole/ml iv soln' AND STRFTIME('%y', medication.drugstarttime) <= '2104' | eicu |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_train_125 (
"id" int,
"carotid_stenosis" int,
"pulmonary_disease" bool,
"neurodegenerative_disease" bool,
"active_infection" bool,
"skin_cancer" bool,
"heart_disease" bool,
"clinical_dementia_rating_scale" float,
"renal_disease" bool,
"cerebrovascular_disease" ... | SELECT * FROM table_train_125 WHERE ((amnestic_mild_cognitive_impairment = 1 OR alzheimer_disease_ad = 1) AND (clinical_dementia_rating_scale = 0.5 OR clinical_dementia_rating_scale = 1)) OR (cognitive_impairment = 0 AND clinical_dementia_rating_scale = 0) | criteria2sql |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE table_75437 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a December smaller than 14, and a Game of 12?
| SELECT "Score" FROM table_75437 WHERE "December" < '14' AND "Game" = '12' | wikisql |
CREATE TABLE table_19345 (
"Week" real,
"Date" text,
"Kickoff ( ET )" text,
"TV" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team did they play at Rich Stadium?
| SELECT "Opponent" FROM table_19345 WHERE "Game Site" = 'Rich Stadium' | wikisql |
CREATE TABLE table_64060 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponent in Final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date had Alexander Krasnorutskiy as a partner with a score of 6 3, 4... | SELECT "Date" FROM table_64060 WHERE "Partner" = 'alexander krasnorutskiy' AND "Score" = '6–3, 4–6, 6–2' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2158.0" AND lab.itemid = "51078" | mimicsql_data |
CREATE TABLE table_63199 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Athlete with a rowing Time of 6:36.05?
| SELECT "Athlete" FROM table_63199 WHERE "Time" = '6:36.05' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | SELECT DISTINCT name FROM instructor WHERE NOT name IN (SELECT INSTRUCTORalias1.name FROM course AS COURSEalias0 INNER JOIN course_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id INNER JOIN offering_instructor AS OFFERING_INSTRUCTOR ON OFFERING_OFFERING_ID = COURSE_OFFERING... | advising |
CREATE TABLE table_name_44 (
year VARCHAR,
deputy VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Year was james mcclure Deputy, and the Name is robert mcphearson?
| SELECT year FROM table_name_44 WHERE deputy = "james mcclure" AND name = "robert mcphearson" | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
C... | SELECT DISTINCT booking_class FROM class_of_service WHERE booking_class = 'Q' | atis |
CREATE TABLE table_2702 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party was the winner when A. Krishnaswamy was the runner-up?
| SELECT "Party" FROM table_2702 WHERE "Runner-up a" = 'A. Krishnaswamy' | wikisql |
CREATE TABLE table_name_20 (
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who came in 3rd place in 1990?
| SELECT 3 AS rd_place FROM table_name_20 WHERE year = "1990" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id... | 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BO... | atis |
CREATE TABLE table_name_62 (
origin VARCHAR,
hanzi VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the Hanzi of originate?
| SELECT origin FROM table_name_62 WHERE hanzi = "凤凰卫视电影台" | sql_create_context |
CREATE TABLE table_8134 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date of the game with a Score of 3 1 and Record of 1 1 0?
| SELECT "Date" FROM table_8134 WHERE "Score" = '3–1' AND "Record" = '1–1–0' | wikisql |
CREATE TABLE church (
church_id number,
name text,
organized_by text,
open_date number,
continuation_of text
)
CREATE TABLE wedding (
church_id number,
male_id number,
female_id number,
year number
)
CREATE TABLE people (
people_id number,
name text,
country text,
i... | SELECT name, age FROM people WHERE is_male = 'T' AND NOT people_id IN (SELECT male_id FROM wedding) | spider |
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 Home_team ORDER BY Season DESC | nvbench |
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_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7856907' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE table_4020 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team picked Blaine Russell?
| SELECT "NHL team" FROM table_4020 WHERE "Player" = 'Blaine Russell' | wikisql |
CREATE TABLE table_33687 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of week 5?
| SELECT "Result" FROM table_33687 WHERE "Week" = '5' | wikisql |
CREATE TABLE table_7079 (
"Name" text,
"Built by HM Dockyard" text,
"Ordered" text,
"Laid down" text,
"Launched" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ordered has algerine (2nd of name) as the name?
| SELECT "Ordered" FROM table_7079 WHERE "Name" = 'algerine (2nd of name)' | wikisql |
CREATE TABLE table_name_56 (
name VARCHAR,
pressure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name has a pressure of 985hpa (29.09inhg)?
| SELECT name FROM table_name_56 WHERE pressure = "985hpa (29.09inhg)" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2184" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_56 (
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For sep 18 what is the total number of 1 prize ($)
| SELECT COUNT(1 AS st_prize__) AS $__ FROM table_name_56 WHERE date = "sep 18" | sql_create_context |
CREATE TABLE table_1573 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the p... | SELECT "Position in table" FROM table_1573 WHERE "Date of appointment" = '1 July 2008' AND "Manner of departure" = 'Resigned' | wikisql |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_s... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci... | atis |
CREATE TABLE table_15914 (
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many schools are in Bloomington, ... | SELECT COUNT("Founded") FROM table_15914 WHERE "Location" = 'Bloomington, IN' | wikisql |
CREATE TABLE table_name_80 (
product VARCHAR,
java_ee_compatibility VARCHAR,
vendor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Oracle Corporation product has a Java EE compatibility of 1.4?
| SELECT product FROM table_name_80 WHERE java_ee_compatibility = "1.4" AND vendor = "oracle corporation" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party_events (
Event_ID in... | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name | nvbench |
CREATE TABLE table_9654 (
"Artist" text,
"Title" text,
"Label" text,
"Number" text,
"Date" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title was created in 2001 by Mellow?
| SELECT "Title" FROM table_9654 WHERE "Date" = '2001' AND "Artist" = 'mellow' | wikisql |
CREATE TABLE table_name_27 (
result VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team won on the day when attendance was 42,308?
| SELECT result FROM table_name_27 WHERE attendance = "42,308" | sql_create_context |
CREATE TABLE table_68790 (
"Institution" text,
"Team" text,
"City" text,
"Province" text,
"First season" real,
"Head coach" text,
"Enrollment" real,
"Football stadium" text,
"Capacity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT MIN("First season") FROM table_68790 WHERE "City" = 'montreal' AND "Capacity" > '5,100' | wikisql |
CREATE TABLE table_53500 (
"Location" text,
"Londonborough" text,
"Post town" text,
"Postcodedistrict" text,
"Dialcode" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Londongborough has a Dialcode of 01992?
| SELECT "Londonborough" FROM table_53500 WHERE "Dialcode" = '01992' | wikisql |
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
date_of_birth DATETIME,
date_joined_staff DATETIME,
date_left_staff DATETIME
)
CREATE TABLE Lessons (
lesson_id INTEGER,... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.