context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | tell me the age and religious background of patient with patient id 1121. | SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "1121" | mimicsql_data |
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
)
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
) | What are the characters of actors in descending order of age? | SELECT character FROM actor ORDER BY age DESC | spider |
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,... | 依科室的不同编号列一下1456542这家医院所有就诊记录里面,统筹基金的开销与医疗费用总数的平均比值 | SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1456542' GROUP BY t_kc21.MED_ORG_DEPT_CD | css |
CREATE TABLE table_2508633_2 (
player VARCHAR,
nfl_team VARCHAR
) | Name the player for new orleans saints | SELECT player FROM table_2508633_2 WHERE nfl_team = "New Orleans Saints" | sql_create_context |
CREATE TABLE table_17870 (
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Viewers(millions)" text,
"Original airdate" text
) | What's the total number of directors whose episodes have been seen by 9.14 million viewers? | SELECT COUNT("Director") FROM table_17870 WHERE "Viewers(millions)" = '9.14' | wikisql |
CREATE TABLE table_name_67 (
magnitude VARCHAR,
time__utc_ VARCHAR,
epicenter VARCHAR,
intensity VARCHAR
) | What is the magnitude with epicenter at Vrancea County, unknown intensity and which happened at 06:36? | SELECT magnitude FROM table_name_67 WHERE epicenter = "vrancea county" AND intensity = "unknown" AND time__utc_ = "06:36" | sql_create_context |
CREATE TABLE table_15187735_17 (
series_ep VARCHAR,
segment_a VARCHAR
) | are rolled wafers in many episodes | SELECT series_ep FROM table_15187735_17 WHERE segment_a = "Rolled Wafers" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide me with the number of patients younger than 36 years who are diagnosed with hypotension of hemodialysis. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "36" AND diagnoses.long_title = "Hypotension of hemodialysis" | mimicsql_data |
CREATE TABLE table_name_54 (
competition VARCHAR,
date VARCHAR
) | Tell me the competition that happened on 14 june 2008 | SELECT competition FROM table_name_54 WHERE date = "14 june 2008" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | how many patients until 2102 were staying in the careunit ccu? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND STRFTIME('%y', transfers.intime) <= '2102') | mimic_iii |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
... | yes i'm looking for a flight between OAKLAND and BOSTON with a stopover in DALLAS FORT WORTH do you have one of those | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1... | atis |
CREATE TABLE table_48004 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | Which venue did the runner have a note of 1:23:07? | SELECT "Venue" FROM table_48004 WHERE "Notes" = '1:23:07' | wikisql |
CREATE TABLE table_16864968_9 (
score VARCHAR,
opponent VARCHAR
) | Name the score for philadelphia flyers | SELECT score FROM table_16864968_9 WHERE opponent = "Philadelphia Flyers" | sql_create_context |
CREATE TABLE table_19897896_7 (
class VARCHAR,
position VARCHAR
) | in which class is the position forward | SELECT class FROM table_19897896_7 WHERE position = "Forward" | sql_create_context |
CREATE TABLE table_23944006_4 (
score VARCHAR,
championship VARCHAR
) | Name the score for san diego | SELECT score FROM table_23944006_4 WHERE championship = "San Diego" | sql_create_context |
CREATE TABLE table_26598 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
) | How many locations did the team play at on week 7? | SELECT COUNT("Location") FROM table_26598 WHERE "Week" = '7' | wikisql |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients whose diagnoses icd9 code is 0380? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "0380" | mimicsql_data |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | Out of total number of patients admitted in or after the year 2190, how many of them were married? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2190" | mimicsql_data |
CREATE TABLE table_200_33 (
id number,
"district" text,
"area size\n(km2)" text,
"population" text,
"density\nper km2" number
) | which district has the highest population density ? | SELECT "district" FROM table_200_33 ORDER BY "density\nper km2" DESC LIMIT 1 | squall |
CREATE TABLE table_10647 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | Name the winner for london tournament | SELECT "Winner" FROM table_10647 WHERE "Tournament" = 'london' | 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... | 9823666这个医疗机构目前的总在院人数 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9823666' AND t_kc21.HOSP_STS > 0 | css |
CREATE TABLE table_name_80 (
skip VARCHAR,
ends_lost VARCHAR,
blank_ends VARCHAR
) | Which Skip has Ends Lost larger than 44, and Blank Ends of 10? | SELECT skip FROM table_name_80 WHERE ends_lost > 44 AND blank_ends = 10 | sql_create_context |
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... | 患者魏冠宇在二00九年九月二日到二0一八年十二月二十八日期间,总共到医院就诊过多少次 | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '魏冠宇' AND mzjzjlb.JZKSRQ BETWEEN '2009-09-02' AND '2018-12-28') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE table_68309 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Ceased to be Consort" text,
"Spouse" text
) | Name the marriagefor ceased to be consort of 29 september 1898 | SELECT "Marriage" FROM table_68309 WHERE "Ceased to be Consort" = '29 september 1898' | wikisql |
CREATE TABLE table_54703 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What away team is based in moorabbin oval? | SELECT "Away team" FROM table_54703 WHERE "Venue" = 'moorabbin oval' | wikisql |
CREATE TABLE table_name_60 (
surface VARCHAR,
score VARCHAR
) | What was the surface of the match when the score was akgul amanmuradova chuang chia-jung? | SELECT surface FROM table_name_60 WHERE score = "akgul amanmuradova chuang chia-jung" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Return a bar chart about the number of counties for all appellations? | SELECT County, COUNT(County) FROM appellations GROUP BY County | nvbench |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | until 4 years ago, has patient 41132 been ordered with calcium gluconate, lisinopril or iso-osmotic dextrose? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 41132) AND prescriptions.drug IN ('calcium gluconate', 'lisinopril', 'iso-osmotic dextrose') AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_60264 (
"Album#" text,
"English Title" text,
"Chinese (Traditional)" text,
"Chinese (Simplified)" text,
"Release date" text,
"Label" text
) | What is Another She's Label? | SELECT "Label" FROM table_60264 WHERE "English Title" = 'another she' | wikisql |
CREATE TABLE table_68641 (
"Year" real,
"Competition" text,
"Location" text,
"Event" text,
"Final-Rank" real,
"Final-Score" real
) | Competition of u.s championships, and a Event of all around has what average year? | SELECT AVG("Year") FROM table_68641 WHERE "Competition" = 'u.s championships' AND "Event" = 'all around' | wikisql |
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABL... | What are the dates of the latest logon of the students with family name 'Jaskolski' or 'Langosh', and count them by a bar chart, list in descending by the y-axis. | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC | nvbench |
CREATE TABLE table_21959 (
"Name" text,
"Map colour" text,
"First operated" real,
"Type" text,
"Length" text,
"No. Sta" real,
"Current Stock" text,
"Future Stock" text,
"Trips per annum (\u00d71000)" real,
"Avg. trips per mile (\u00d71000)" real
) | When turquoise is the map colour what is the length? | SELECT "Length" FROM table_21959 WHERE "Map colour" = 'Turquoise' | wikisql |
CREATE TABLE table_53443 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score for the away team when the home team scored 31.9 (195)? | SELECT "Away team" FROM table_53443 WHERE "Home team score" = '31.9 (195)' | 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 diagnoses (
... | what is the number of patients whose item id is 51256 and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51256" AND lab.flag = "abnormal" | mimicsql_data |
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... | 能告诉我病人邹清舒所有医疗记录中医疗费总额超过1552.66元的入院诊断名称是什么吗?疾病编码呢 | SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '邹清舒' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 1552.66) | css |
CREATE TABLE table_17340355_9 (
record VARCHAR,
date VARCHAR
) | After the March 15 game, what was the team's record? | SELECT record FROM table_17340355_9 WHERE date = "March 15" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 哪一个是检验结果指标记录09168747102的检测人其工号以及姓名是啥? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '09168747102' | css |
CREATE TABLE table_1139835_3 (
season_result VARCHAR,
margin VARCHAR
) | who is the season result where margin is 51 | SELECT season_result FROM table_1139835_3 WHERE margin = 51 | sql_create_context |
CREATE TABLE table_62306 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the date of the match with west bromwich albion as the home team? | SELECT "Date" FROM table_62306 WHERE "Home team" = 'west bromwich albion' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 门诊给患者王灵慧诊断为混合性焦虑和抑郁障碍,666198这个检测指标的结果定量和单位分别是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about School_ID over the All_Neutral by a bar chart. | SELECT All_Neutral, School_ID FROM basketball_match | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | is patient 021-69410's phosphate second measured on the first hospital visit less than first measured on the first hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-69410' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE table_name_20 (
opening INTEGER,
stadium VARCHAR,
capacity VARCHAR
) | What is the average opening at Stadyum Samsun with a capacity smaller than 34,658? | SELECT AVG(opening) FROM table_name_20 WHERE stadium = "stadyum samsun" AND capacity < 34 OFFSET 658 | sql_create_context |
CREATE TABLE table_name_83 (
grid INTEGER,
laps INTEGER
) | What is the minimum grid when there was more than 22 laps? | SELECT MIN(grid) FROM table_name_83 WHERE laps > 22 | sql_create_context |
CREATE TABLE table_dev_9 (
"id" int,
"heart_disease" bool,
"hba1c" float,
"coronary_artery_disease_cad" bool,
"triglyceride_tg" float,
"hypertension" bool,
"NOUSE" float
) | triglycerides < 150 mg / dl. | SELECT * FROM table_dev_9 WHERE triglyceride_tg < 150 | criteria2sql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
... | had patient 24268 had a normal arterial bp [systolic] on 03/19/last year? | 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 = 24268)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... | mimic_iii |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 患者85722841被门诊诊断为疾病T18.984,他的免疫球蛋白A(敏感)的结果定量及单位是怎样的 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.Y... | css |
CREATE TABLE customers (
Id VARCHAR
) | Find the number of customers in total. | SELECT COUNT(*) FROM customers | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departu... | yes i'd like to find a flight from MEMPHIS to TACOMA stopping in LOS ANGELES | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND CITY_... | atis |
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_... | i'd like to fly between BOSTON and SAN FRANCISCO | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA... | atis |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
chartt... | was there any organism found in patient 30460's first mrsa screen microbiological examination in 03/last year? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30460) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = ... | mimic_iii |
CREATE TABLE table_30228 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | How many millions of U.S. viewers watched the episode with the production code of 6AKY07? | SELECT "U.S. viewers (millions)" FROM table_30228 WHERE "Production code" = '6AKY07' | wikisql |
CREATE TABLE table_6427 (
"Make/ Model" text,
"length" text,
"Year" real,
"Numbers (Quantity Ordered)" text,
"Fuel Propulsion" text
) | Which Fuel Propulsion has Numbers (Quantity Ordered) of 7124-7156 (33 buses)? | SELECT "Fuel Propulsion" FROM table_6427 WHERE "Numbers (Quantity Ordered)" = '7124-7156 (33 buses)' | wikisql |
CREATE TABLE table_64538 (
"Rank" text,
"Group" text,
"Name" text,
"Nationality" text,
"Mark" text
) | What rank does Tatyana Lebedeva have? | SELECT "Rank" FROM table_64538 WHERE "Name" = 'tatyana lebedeva' | wikisql |
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE T... | Return the lot details, group the lot details, and compute the number of each lot details, list X-axis from low to high order please. | SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details ORDER BY lot_details | nvbench |
CREATE TABLE table_name_85 (
studio VARCHAR,
director VARCHAR
) | What studio is director Reginald Hudlin from? | SELECT studio FROM table_name_85 WHERE director = "reginald hudlin" | sql_create_context |
CREATE TABLE table_23321 (
"Vehicle Category" text,
"Till Aligarh" real,
"Till Mathura" real,
"Till Agra" real,
"For Round Trip" real
) | If the till agra is 1050, what is the max round trip? | SELECT MAX("For Round Trip") FROM table_23321 WHERE "Till Agra" = '1050' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flig... | list types of aircraft that fly between BOSTON and SAN FRANCISCO | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_... | atis |
CREATE TABLE table_7312 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"Career W-L" text
) | What is the value in 2006 when Career Statistics is in Career W-L? | SELECT "2006" FROM table_7312 WHERE "Career W-L" = 'career statistics' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)... | Is CMBIOL 682 taught only in the Summer ? | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'CMBIOL' AND course.number = 682 AND semester.semester <> 'Summer' | advising |
CREATE TABLE table_2500 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
) | What was the highest position for the person who performed in 16 races? | SELECT "Position" FROM table_2500 WHERE "Races" = '16' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
C... | provide the number of patients who have been in the hospital for more than 29 days and whose discharge location was home health care. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.days_stay > "29" | mimicsql_data |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Po... | Which of my answers have helped the internet?. Shows you which questions you've answered that have significant view counts. | SELECT q.ViewCount AS "views", ROUND(q.ViewCount / q.AnswerCount, 2) AS "views_per_answer", q.AnswerCount AS "answer_count", q.Id AS "post_link", a.Score AS "answer_score", (CASE WHEN q.AcceptedAnswerId = a.Id THEN 'Yes' ELSE NULL END) AS "accepted" FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.Own... | sede |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,... | IS ORTHO 763 available next semester ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ORTHO' AND course.number = 763 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank i... | Show the number of gas stations for each manager in a bar chart, I want to rank by the Y from low to high. | SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) | nvbench |
CREATE TABLE table_name_1 (
chassis VARCHAR,
year VARCHAR
) | Which chassis was used in 1971? | SELECT chassis FROM table_name_1 WHERE year = 1971 | sql_create_context |
CREATE TABLE table_30008 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Current Conference" text,
"Pac-12 Sports" text
) | When was the Titans founded? | SELECT MAX("Founded") FROM table_30008 WHERE "Nickname" = 'Titans' | wikisql |
CREATE TABLE table_11214772_1 (
semi_finalist__number2 VARCHAR,
runner_up VARCHAR
) | what is the total number of semi-finalist #2 where runner-up is east carolina | SELECT COUNT(semi_finalist__number2) FROM table_11214772_1 WHERE runner_up = "East Carolina" | sql_create_context |
CREATE TABLE table_203_644 (
id number,
"pos." number,
"driver" text,
"co-driver" text,
"car" text,
"time" text,
"difference" text,
"points" number
) | who finished with the least time ? | SELECT "driver" FROM table_203_644 ORDER BY "time" LIMIT 1 | squall |
CREATE TABLE table_name_61 (
city VARCHAR,
stadium VARCHAR
) | In what city is the Don Valley Stadium located? | SELECT city FROM table_name_61 WHERE stadium = "don valley stadium" | sql_create_context |
CREATE TABLE table_name_50 (
began_play VARCHAR,
club VARCHAR
) | When did the Club of western new york flash begin to play? | SELECT began_play FROM table_name_50 WHERE club = "western new york flash" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 查查医疗机构3554465在2008年7月28日到2019年5月22日这段时间,住院的患者平均要住多长时间 | SELECT AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '3554465' AND IN_HOSP_DATE BETWEEN '2008-07-28' AND '2019-05-22' | css |
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
)
... | count the number of patients whose marital status is single and diagnoses long title is malignant neoplasm of descending colon? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Malignant neoplasm of descending colon" | mimicsql_data |
CREATE TABLE table_15412381_5 (
wheels VARCHAR,
lms_nos VARCHAR
) | How many figures are there for wheels for LMS numbers 16377-9? | SELECT COUNT(wheels) FROM table_15412381_5 WHERE lms_nos = "16377-9" | sql_create_context |
CREATE TABLE table_49880 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
) | Which Circuit has the Winning Team of carlin motorsport, and the Winning Driver of oliver turvey, and a Date of 24 march? | SELECT "Circuit" FROM table_49880 WHERE "Winning Team" = 'carlin motorsport' AND "Winning Driver" = 'oliver turvey' AND "Date" = '24 march' | wikisql |
CREATE TABLE table_44645 (
"Election" real,
"Number of PNC votes" text,
"Share of votes" text,
"Seats" text,
"Outcome of election" text
) | How many PNC votes did the election before 1996 have? | SELECT "Number of PNC votes" FROM table_44645 WHERE "Election" < '1996' | wikisql |
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... | calculate the difference between the total amount of input and the total output of patient 010-32430 on the first intensive care unit visit. | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32430') AND NOT patient.unitdischarg... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | give me the number of patients whose marital status is married and procedure long title is pericardiocentesis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Pericardiocentesis" | mimicsql_data |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | What Fall PATH classes are offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PATH' AND semester.semester = 'Fall' | advising |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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 ... | 列出患者98735350就诊科室名称包含脑外的在医院5087372中总共有哪些医疗就诊记录? | SELECT * FROM t_kc21 WHERE t_kc21.PERSON_ID = '98735350' AND t_kc21.MED_SER_ORG_NO = '5087372' AND t_kc21.MED_ORG_DEPT_NM LIKE '%脑外%' | css |
CREATE TABLE table_52690 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the sum of the crowd when the away team score was 12.11 (83)? | SELECT SUM("Crowd") FROM table_52690 WHERE "Away team score" = '12.11 (83)' | wikisql |
CREATE TABLE table_64705 (
"Date" text,
"Event" text,
"Heat/Semifinal/Final" text,
"Nation" text,
"Time" text
) | What heat, semifinal or final has a time of 25.00? | SELECT "Heat/Semifinal/Final" FROM table_64705 WHERE "Time" = '25.00' | wikisql |
CREATE TABLE images (
image_id number,
image_alt_text text,
image_name text,
image_url text
)
CREATE TABLE roles (
role_code text,
role_description text
)
CREATE TABLE document_sections (
section_id number,
document_code text,
section_sequence number,
section_code text,
sec... | Return the type code of the document named 'David CV'. | SELECT document_type_code FROM documents WHERE document_name = "David CV" | spider |
CREATE TABLE table_24197 (
"Chinese industrial designation" text,
"Export type designation" text,
"NATO reporting name" text,
"NATO/U.S DOD code" text,
"Remarks" text
) | Name the nato/ us dod code for sabbot | SELECT "NATO/U.S DOD code" FROM table_24197 WHERE "NATO reporting name" = 'SABBOT' | wikisql |
CREATE TABLE table_name_30 (
pick INTEGER,
player VARCHAR
) | What was John Jones's pick#? | SELECT SUM(pick) FROM table_name_30 WHERE player = "john jones" | sql_create_context |
CREATE TABLE table_75527 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text
) | What round has the highest Res loss, and a time of 40:00? | SELECT MAX("Round") FROM table_75527 WHERE "Res." = 'loss' AND "Time" = '40:00' | wikisql |
CREATE TABLE table_name_15 (
round VARCHAR,
opponent VARCHAR
) | What is the Round with a Opponent with blackburn? | SELECT round FROM table_name_15 WHERE opponent = "blackburn" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | how many patients the previous year were prescribed fluoxetine hcl after venous cath nec during the same month? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath... | mimic_iii |
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 hz_info (
KH text,
KLX number... | 医院8988339从两千年五月十六日到一一年八月六日的门诊就诊中,有多少科室开出的检验报告单没超过1张 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '8988339' AND jybgb.BGRQ BETWEEN '2000-05-16' AND '2011-08-06' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 1 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ... | css |
CREATE TABLE table_name_28 (
region VARCHAR,
icao VARCHAR
) | I want the region for ICAO of vmmc | SELECT region FROM table_name_28 WHERE icao = "vmmc" | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | what time did patient 31300 first had the minimum tacrofk value until 11/2103? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31300) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'tacrofk') AND STRFTIME('%y-%m', labevents.charttime) <= '2103-11' ORDER BY labe... | mimic_iii |
CREATE TABLE table_name_36 (
year INTEGER,
score_in_final VARCHAR,
championship VARCHAR,
outcome VARCHAR
) | What is the sum of Year(s), when Championship is 'Australian Open', when Outcome is 'Runner-Up', and when Score in Final is 3-6, 6-3, 6-2? | SELECT SUM(year) FROM table_name_36 WHERE championship = "australian open" AND outcome = "runner-up" AND score_in_final = "3-6, 6-3, 6-2" | sql_create_context |
CREATE TABLE table_49646 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What player has a score larger than 67? | SELECT "Player" FROM table_49646 WHERE "Score" > '67' | wikisql |
CREATE TABLE table_name_97 (
date VARCHAR,
country VARCHAR
) | What was the Date of Country of United States? | SELECT date FROM table_name_97 WHERE country = "united states" | sql_create_context |
CREATE TABLE table_204_883 (
id number,
"pos." text,
"name" text,
"place of birth" text,
"date of birth" text,
"previous club" text,
"date joined" text,
"fee" text
) | what is the date of the lst player that joined ? | SELECT "date joined" FROM table_204_883 ORDER BY "date joined" LIMIT 1 | squall |
CREATE TABLE table_31430 (
"Rank" real,
"Country/Territory" text,
"Manhunt International" real,
"1st runner-up" real,
"2nd runner-up" real,
"3rd runner-up" real,
"4th runner-up" real,
"Semifinalists" real,
"Total" real
) | How many first place participants where from croatia? | SELECT "3rd runner-up" FROM table_31430 WHERE "Country/Territory" = 'Croatia' | wikisql |
CREATE TABLE table_44771 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the tie number when the home team was gillingham? | SELECT "Tie no" FROM table_44771 WHERE "Home team" = 'gillingham' | wikisql |
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
)
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
) | Show different locations and the number of performances at each location. | SELECT Location, COUNT(*) FROM performance GROUP BY Location | nvbench |
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... | provide the number of patients whose diagnoses icd9 code is 2930 and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2930" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_14281 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | Who are the rowers ranked greater than 3 from Finland? | SELECT "Rowers" FROM table_14281 WHERE "Rank" > '3' AND "Country" = 'finland' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.