context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | had patient 021-155303 been under any analgesics - bolus parenteral analgesics procedure at other hospitals? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '021-155303' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '021-155303' AND patient.hospitaldischargetime IS NULL)) AND ... | eicu |
CREATE TABLE table_29369 (
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Ratings" text
) | What date did the episode that was written by Fintan Ryan originally air? | SELECT "Originalairdate" FROM table_29369 WHERE "Written by" = 'Fintan Ryan' | wikisql |
CREATE TABLE table_12869 (
"Cyclist" text,
"Nationality" text,
"First win" real,
"Latest win" real,
"Total" real
) | What was the lowest total for Italy when the latest win is 1950? | SELECT MIN("Total") FROM table_12869 WHERE "Nationality" = 'italy' AND "Latest win" = '1950' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | is there any results from a microbiology test in patient 031-3355's other in the current hospital encounter? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite = '... | eicu |
CREATE TABLE gwyjzb (
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,
... | 在08年10月19日到19年6月15日期间,因疾病Y97.841导致住院产生的平均费用在科室96256有多少 | SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '96256' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-10-19' AND '2019-06-15' AND gwyjzb.IN_DIAG_DIS_CD = 'Y97.841' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '96256' AND fgwyjzb.IN_HOSP_D... | css |
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 int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | i would like to book a flight from CHICAGO into SEATTLE on 6 1 on CO | 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 = 'SEATTLE' AND date_day.day_number = 1 AND date_day.month_number = 6 AND d... | atis |
CREATE TABLE table_19820 (
"Ido" text,
"English" text,
"Italian" text,
"French" text,
"German" text,
"Russian" text,
"Spanish" text
) | What is the English word for the Russian words loshad, kobyla ( , )? | SELECT "English" FROM table_19820 WHERE "Russian" = 'loshad, kobyla (лошадь, кобыла)' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart. | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_28211213_1 (
affiliation VARCHAR,
institution VARCHAR
) | What is the affiliation of Davenport University? | SELECT affiliation FROM table_28211213_1 WHERE institution = "Davenport University" | sql_create_context |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | give the number of male patients who had the procedure for insertion of non-drug-eluting coronaryartery stent(s). | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(s)" | mimicsql_data |
CREATE TABLE table_name_19 (
model_number VARCHAR,
frequency VARCHAR,
socket VARCHAR
) | Which model has a frequency of 750 mhz and a socket of bga2 pga2? | SELECT model_number FROM table_name_19 WHERE frequency = "750 mhz" AND socket = "bga2μpga2" | sql_create_context |
CREATE TABLE table_1849243_1 (
viewers__in_millions_ VARCHAR,
archive VARCHAR
) | How many viewers watched the 16mm t/r episode? | SELECT viewers__in_millions_ FROM table_1849243_1 WHERE archive = "16mm t/r" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | WITH data (f) AS ( SELECT 'abc' UNION ALL. | WITH data(f) AS (SELECT 'abc' UNION ALL SELECT 'def' UNION ALL SELECT 'abc') SELECT DISTINCT f, ROW_NUMBER() OVER (ORDER BY f) FROM data GROUP BY f | sede |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | How many faculty members does each building have? List the result with the name of the building with a bar chart. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building | nvbench |
CREATE TABLE table_name_34 (
surface VARCHAR,
date VARCHAR
) | Tell me the surface for november 28, 2010 | SELECT surface FROM table_name_34 WHERE date = "november 28, 2010" | sql_create_context |
CREATE TABLE table_58695 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Hiw many losses have 30 for the goals with points greater than 24? | SELECT COUNT("Losses") FROM table_58695 WHERE "Goals for" = '30' AND "Points" > '24' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABL... | what flights from ST. LOUIS to ST. PAUL on thursday leaving after 1000 | 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 ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_33199 (
"Tournament" text,
"2007" text,
"2011" text,
"2012" text,
"2013" text
) | What value in 2013 corresponds to Grand Slam Tournaments in 2012? | SELECT "2013" FROM table_33199 WHERE "2012" = 'grand slam tournaments' | wikisql |
CREATE TABLE qualifying (
qualifyid number,
raceid number,
driverid number,
constructorid number,
number number,
position number,
q1 text,
q2 text,
q3 text
)
CREATE TABLE races (
raceid number,
year number,
round number,
circuitid number,
name text,
date text... | What are the numbers of races for each constructor id? | SELECT COUNT(*), constructorid FROM constructorstandings GROUP BY constructorid | spider |
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 ... | when did patient 20165 first undergo the procedure until 2100? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165) AND STRFTIME('%y', procedures_icd.charttime) <= '2100' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_43 (
heat INTEGER,
time VARCHAR,
lane VARCHAR
) | What is the average of all Heats of competitors with a Time of 59.11 and a lane higher than 3? | SELECT AVG(heat) FROM table_name_43 WHERE time = "59.11" AND lane > 3 | sql_create_context |
CREATE TABLE table_name_21 (
country VARCHAR,
player VARCHAR
) | What country does charles coody play for? | SELECT country FROM table_name_21 WHERE player = "charles coody" | sql_create_context |
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,
... | 列出患者马展鹏被开出的所有检验报告单的检验报告单号有多少在2021-08-09到2021-11-14内? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '马展鹏' AND jybg... | css |
CREATE TABLE table_225205_3 (
state__class_ VARCHAR,
reason_for_change VARCHAR
) | Name the state class for iowa admitted to the union december 28, 1846 | SELECT state__class_ FROM table_225205_3 WHERE reason_for_change = "Iowa admitted to the Union December 28, 1846" | sql_create_context |
CREATE TABLE table_name_45 (
opponent VARCHAR,
round VARCHAR
) | Which opponent had a round of SF? | SELECT opponent FROM table_name_45 WHERE round = "sf" | sql_create_context |
CREATE TABLE table_72685 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | What number identifies Chris Gatling? | SELECT MAX("No.") FROM table_72685 WHERE "Player" = 'Chris Gatling' | wikisql |
CREATE TABLE table_name_79 (
gold INTEGER,
total INTEGER
) | How many total golds do teams have when the total medals is less than 1? | SELECT SUM(gold) FROM table_name_79 WHERE total < 1 | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose language is span and age is less than 70? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.age < "70" | mimicsql_data |
CREATE TABLE table_54604 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
) | What competition has a goal number of 13? | SELECT "Competition" FROM table_54604 WHERE "Goal" = '13' | 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... | provide the number of patients whose gender is f and primary disease is morbid obesity/sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "MORBID OBESITY/SDA" | mimicsql_data |
CREATE TABLE table_train_195 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"allergy_to_perflutren" bool,
"heart_disease" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | history of congestive heart failure | SELECT * FROM table_train_195 WHERE heart_disease = 1 | criteria2sql |
CREATE TABLE table_name_99 (
title VARCHAR,
pages VARCHAR
) | Tell me the title for pages of 96 | SELECT title FROM table_name_99 WHERE pages = 96 | 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | when did patient 85700 have a minimum potassium for the first time this month? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85700) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURR... | mimic_iii |
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 ... | tell me the drug that was prescribed to patient 6580 for the last time through the po route since 04/2105? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6580) AND prescriptions.route = 'po' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-04' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
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... | count the number of patients with unspecified paraplegia diagnoses who had abnormal lab test status. | 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.short_title = "Paraplegia NOS" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_203_305 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
) | which player was the first player to be drafted ? | SELECT "player" FROM table_203_305 WHERE id = 1 | squall |
CREATE TABLE table_24143253_2 (
current_marital_status VARCHAR,
name VARCHAR
) | What is Stella Farentino's current relationship status? | SELECT current_marital_status FROM table_24143253_2 WHERE name = "Stella Farentino" | sql_create_context |
CREATE TABLE table_27713030_7 (
game INTEGER
) | What game in the season does this list start? | SELECT MIN(game) FROM table_27713030_7 | sql_create_context |
CREATE TABLE table_name_38 (
season INTEGER,
profile VARCHAR
) | What is the earliest season with an advertising account manager profile? | SELECT MIN(season) FROM table_name_38 WHERE profile = "advertising account manager" | sql_create_context |
CREATE TABLE table_54320 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | When driver heinz-harald frentzen has a number of laps greater than 60, what is the sum of grid? | SELECT COUNT("Grid") FROM table_54320 WHERE "Laps" > '60' AND "Driver" = 'heinz-harald frentzen' | wikisql |
CREATE TABLE table_10361230_1 (
player_name VARCHAR,
college VARCHAR
) | Which player went to Emporia State? | SELECT player_name FROM table_10361230_1 WHERE college = "Emporia State" | sql_create_context |
CREATE TABLE table_4121 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What nationality was peter slamiar? | SELECT "Nationality" FROM table_4121 WHERE "Player" = 'Peter Slamiar' | wikisql |
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... | what are the three most common laboratory tests patients had within 2 months after receiving a vte prophylaxis - compression boots treatment procedure until 2102? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vte prophylaxis - compression boots' AND STRFTIME('%... | eicu |
CREATE TABLE table_name_77 (
visitor VARCHAR,
home VARCHAR
) | Who was the visitor when vancouver was at home? | SELECT visitor FROM table_name_77 WHERE home = "vancouver" | sql_create_context |
CREATE TABLE table_20398 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) | Name the country when dar is 16:9 for italian english for disney xd +2 | SELECT "Country" FROM table_20398 WHERE "DAR" = '16:9' AND "Language" = 'Italian English' AND "Television service" = 'Disney XD +2' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | count the number of patients who had been prescribed albumin human 25 % iv soln within 2 months after having received a orthopedics consultation procedure since 6 years ago. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'orthopedics consultation' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS t... | eicu |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_des... | Visualize a bar chart about the distribution of middle_name and gender_mf . | SELECT middle_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
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... | 看看病患83449469做过的检查有什么 | 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_ID = '83449469' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_25 (
stop_no VARCHAR,
destination VARCHAR
) | What is Stop No., when Destination is [2778] Claisebrook Station Platforms? | SELECT stop_no FROM table_name_25 WHERE destination = "[2778] claisebrook station platforms" | sql_create_context |
CREATE TABLE table_train_143 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"agitation" bool,
"npi" int,
"aggression_domain" bool,
"delusions_hallucinations" bool,
"pulse_rate" int,
"fridericia_corrected_qt_interval_qtcf" int,
"diastolic_blood_pressure_dbp" int,
... | pulse rate between 45 _ 100 bpm; respirations between 8 _ 20 per minute | SELECT * FROM table_train_143 WHERE (pulse_rate >= 45 AND pulse_rate <= 100) AND (respiratory_rate >= 8 AND respiratory_rate <= 20) | criteria2sql |
CREATE TABLE table_name_9 (
name VARCHAR,
year VARCHAR,
length VARCHAR
) | Which Name has a Year larger than 2001, and a Length of 52 x 20 mins? | SELECT name FROM table_name_9 WHERE year > 2001 AND length = "52 x 20 mins" | sql_create_context |
CREATE TABLE table_25017530_6 (
position VARCHAR,
player VARCHAR
) | Name the position for michael warner | SELECT position FROM table_25017530_6 WHERE player = "Michael Warner" | sql_create_context |
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 lab (
labid numbe... | what was patient 022-157712's first time of taking po fluid? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-157712')) AND intakeoutput.cellpath LIKE '%intake... | eicu |
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,
... | 编号7373-2的药在04年11月7日到2015年8月22日内开出的总数量是多少总金额有多少? | SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '7373-2' AND t_kc22.STA_DATE BETWEEN '2004-11-07' AND '2015-08-22' | css |
CREATE TABLE table_23508196_2 (
officers_o_s INTEGER,
total_usaaf VARCHAR
) | How many officers o/s were there on the day when the number of USAAF was 2373882? | SELECT MAX(officers_o_s) FROM table_23508196_2 WHERE total_usaaf = 2373882 | 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 demographic (... | what is the number of patients whose hospital stay is above 6 days and with lab test category chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_100518_1 (
guardian_mātṛkā VARCHAR,
consort VARCHAR
) | What is the guardian m t k for the guardian whose consort is Sv h ? | SELECT guardian_mātṛkā FROM table_100518_1 WHERE consort = "Svāhā" | sql_create_context |
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE volume (
volume_i... | Return the average number of weeks on top for volumes by artists that are at most 25 years old. | SELECT AVG(T2.weeks_on_top) FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T1.age <= 25 | spider |
CREATE TABLE table_name_49 (
area_km_2 VARCHAR,
census_ranking VARCHAR
) | what is the area when the census ranking is 2,290 of 5,008? | SELECT area_km_2 FROM table_name_49 WHERE census_ranking = "2,290 of 5,008" | sql_create_context |
CREATE TABLE table_name_38 (
power_output_(kw) VARCHAR,
total_production VARCHAR
) | Tell me the power output for total production of 100 | SELECT power_output_(kw) FROM table_name_38 WHERE total_production = 100 | sql_create_context |
CREATE TABLE table_48005 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | What is the note result when the runner finished 19th in 2008? | SELECT "Notes" FROM table_48005 WHERE "Year" = '2008' AND "Position" = '19th' | wikisql |
CREATE TABLE table_27801 (
"Case" text,
"1st pers. sing." text,
"2nd pers. sing." text,
"3rd pers. sing." text,
"1st pers. pl" text,
"2nd pers. pl." text,
"3rd pers pl." text
) | Name the 1st person pl for | SELECT "1st pers. pl" FROM table_27801 WHERE "2nd pers. sing." = 'тонэ' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | calculate the number of drugs since 2105 patient 033-10593 has been prescribed. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-10593')) AND STRFTIME('%y', medication.drugstarttime) >= '2105' | eicu |
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 demographic (... | How many patients who died in or before the year 2133 had sigmoid diverticulitis, colovestical fistula/sda as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.dod_year <= "2133.0" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | What is the number of patients less than 20 years of age who had a mchc lab test done? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "20" AND lab.label = "MCHC" | mimicsql_data |
CREATE TABLE table_35300 (
"Name/Location" text,
"Other (later) names" text,
"Operation" text,
"Distance from Jaffa" text,
"Elevation" text
) | What is the distance from Jaffa of Jerusalem station? | SELECT "Distance from Jaffa" FROM table_35300 WHERE "Name/Location" = 'jerusalem' | wikisql |
CREATE TABLE table_20693 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What are the winnings for the season where the average finish is 11.1? | SELECT "Winnings" FROM table_20693 WHERE "Avg. Finish" = '11.1' | wikisql |
CREATE TABLE table_47140 (
"Rank" text,
"Team" text,
"Run 1" text,
"Run 2" text,
"Run 3" text,
"Run 4" text,
"Final" text
) | What was the rank of the team with a run 2 of 1:20.8 and a run 4 of 1:23.0? | SELECT "Rank" FROM table_47140 WHERE "Run 2" = '1:20.8' AND "Run 4" = '1:23.0' | wikisql |
CREATE TABLE table_78428 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the lowest grid with matra as constructor? | SELECT MIN("Grid") FROM table_78428 WHERE "Constructor" = 'matra' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 编号为39827509的病患在医院1609490内入院诊断疾病名称包含合并这俩字的医疗就诊记录编号是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '39827509' AND t_kc21.MED_SER_ORG_NO = '1609490' AND t_kc21.IN_DIAG_DIS_NM LIKE '%合并%' | css |
CREATE TABLE table_49599 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | What was the result of the april 6, 2002 game against the greensboro prowlers? | SELECT "Result" FROM table_49599 WHERE "Opponent" = 'greensboro prowlers' AND "Date" = 'april 6, 2002' | wikisql |
CREATE TABLE table_24370 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | Which stadium has the date/year of Fri 06/25/82? | SELECT "Stadium" FROM table_24370 WHERE "Date/Year" = 'Fri 06/25/82' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | Question asked by X which were answered by Y. | SELECT q.Id AS "post_link" FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##Answerer##' AND q.OwnerUserId = '##Asker##' | sede |
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_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '尤修远' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片') | css |
CREATE TABLE table_58575 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the season record when the location attendance was Air Canada Centre 19,800? | SELECT "Record" FROM table_58575 WHERE "Location Attendance" = 'air canada centre 19,800' | wikisql |
CREATE TABLE table_name_28 (
date VARCHAR,
high_rebounds VARCHAR
) | What is Date, when High Rebounds is 'Amar'e Stoudemire (13)'? | SELECT date FROM table_name_28 WHERE high_rebounds = "amar'e stoudemire (13)" | sql_create_context |
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu... | Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department. | SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems' | spider |
CREATE TABLE table_name_94 (
country VARCHAR,
player VARCHAR
) | what country hosted david toms | SELECT country FROM table_name_94 WHERE player = "david toms" | sql_create_context |
CREATE TABLE table_25042332_33 (
region VARCHAR,
life_expectancy_at_birth__2001_2002_ VARCHAR
) | Which region had a life expectancy at birth of 77.9 from 2001-2002? | SELECT region FROM table_25042332_33 WHERE life_expectancy_at_birth__2001_2002_ = "77.9" | sql_create_context |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | Show different parties of people along with the number of people in each party with a bar chart. | SELECT Party, COUNT(*) FROM people GROUP BY Party | nvbench |
CREATE TABLE diagnoses (
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,
... | how many patients of black/african american ethnicity are born before 2078? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2078" | mimicsql_data |
CREATE TABLE procedures (
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
)
... | how many patients are admitted in location transfer within this facility and are born before 2138? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "2138" | mimicsql_data |
CREATE TABLE table_name_92 (
wins VARCHAR,
races VARCHAR,
third VARCHAR,
points VARCHAR
) | What is the number of wins when the number of third was 1, points were less than 572 and had less than 16 races? | SELECT wins FROM table_name_92 WHERE third = "1" AND points < 572 AND races < 16 | sql_create_context |
CREATE TABLE table_74792 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What away team played at Brunswick Street Oval? | SELECT "Away team" FROM table_74792 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_19804 (
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" text
) | Who is the director of the episode at entry number 13? | SELECT "Director" FROM table_19804 WHERE "#" = '13' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | Get all the 7 -credit Journalistic Performance courses . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Journalistic Performance%' OR name LIKE '%Journalistic Performance%') AND credits = 7 | advising |
CREATE TABLE table_56399 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | If the Away team was south melbourne what Date did they play? | SELECT "Date" FROM table_56399 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | What is the class that is the hardest ? | SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH... | advising |
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... | 患者的白蛋白的参考值范围在哪个区间内可以被门诊诊断为白细胞异常 | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_12603 (
"Date" text,
"Opponent" text,
"Score" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the highest attendance on December 23? | SELECT MAX("Attendance") FROM table_12603 WHERE "Date" = 'december 23' | wikisql |
CREATE TABLE table_10921 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | Who has a hometown of los angeles, ca? | SELECT "Player" FROM table_10921 WHERE "Hometown" = 'los angeles, ca' | wikisql |
CREATE TABLE table_49547 (
"Volume:Issue" text,
"Issue date(s)" text,
"Weeks at number one" real,
"Song" text,
"Artist(s)" text
) | Which Issue date(s) has a Weeks at number one of 5, and a Volume:Issue of 61:17-21? | SELECT "Issue date(s)" FROM table_49547 WHERE "Weeks at number one" = '5' AND "Volume:Issue" = '61:17-21' | wikisql |
CREATE TABLE table_name_92 (
date VARCHAR,
opposing_teams VARCHAR,
against VARCHAR
) | What day was Australia the opposing team and the against 12? | SELECT date FROM table_name_92 WHERE opposing_teams = "australia" AND against = 12 | sql_create_context |
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 diagnosis (
diagn... | what is the name of the drug that patient 015-180 was prescribed during the same hospital encounter after having received a eeg monitoring procedure since 06/2105. | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... | eicu |
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,... | 医院8040470所有就诊记录中患者年纪平均值是多少?把结果按照不同的入院诊断编码和科室名字计算一下 | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8040470' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_CD | css |
CREATE TABLE table_28768925_1 (
original_air_date VARCHAR,
us_viewers__million_ VARCHAR
) | What date did the episode that had 8.84 million u.s. viewers originally air? | SELECT original_air_date FROM table_28768925_1 WHERE us_viewers__million_ = "8.84" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
... | In the Spring or Summer , which courses have the ability to meet the Core requirement ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id... | advising |
CREATE TABLE table_203_309 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years lost" text
) | who was the top winner ? | SELECT "team" FROM table_203_309 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_name_5 (
class VARCHAR,
weight VARCHAR
) | Weight of 220 has what class? | SELECT class FROM table_name_5 WHERE weight = 220 | sql_create_context |
CREATE TABLE table_1342379_45 (
first_elected INTEGER
) | What year was someone first elected? | SELECT MIN(first_elected) FROM table_1342379_45 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.