context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_18076 (
"Rank" real,
"Building" text,
"Address" text,
"Height" text,
"Storeys" real,
"Completed" real
) | what are all the building with 12 storeys | SELECT "Building" FROM table_18076 WHERE "Storeys" = '12' | wikisql |
CREATE TABLE table_72518 (
"School" text,
"Winners" real,
"Finalists" real,
"Total Finals" real,
"Year of last win" text
) | What are the names that had a finalist score of 2? | SELECT "School" FROM table_72518 WHERE "Finalists" = '2' | wikisql |
CREATE TABLE table_80450 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | What is the year with 116 laps? | SELECT "Year" FROM table_80450 WHERE "Laps" = '116' | wikisql |
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... | 2004年5月25日到2013年6月11日之内医疗机构4663033医疗就诊的医疗费总额达到9829.08元以上的未就业人员就诊记录的总数量是多少? | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '4663033' AND IN_HOSP_DATE BETWEEN '2004-05-25' AND '2013-06-11' AND INSURED_STS = '未就业' AND MED_AMOUT >= 9829.08 | css |
CREATE TABLE table_38679 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" text,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | What is Trevard Lindley's height? | SELECT "Height" FROM table_38679 WHERE "Name" = 'trevard lindley' | wikisql |
CREATE TABLE table_name_61 (
best_3_year_period VARCHAR,
best_15_year_period VARCHAR,
position VARCHAR
) | Which best 3-year period has a best 15-year period of smyslov; kasparov, and a Position of 5? | SELECT best_3_year_period FROM table_name_61 WHERE best_15_year_period = "smyslov; kasparov" AND position = 5 | sql_create_context |
CREATE TABLE table_14476 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" text
) | What engine did the mclaren mp4-20 use? | SELECT "Engine" FROM table_14476 WHERE "Chassis" = 'mclaren mp4-20' | wikisql |
CREATE TABLE table_name_88 (
record VARCHAR,
visitor VARCHAR
) | What was the cougars record during the game where Boston were the visitors? | SELECT record FROM table_name_88 WHERE visitor = "boston" | sql_create_context |
CREATE TABLE FACULTY (
Building VARCHAR,
FacID VARCHAR
)
CREATE TABLE COURSE (
Instructor VARCHAR
) | Which building does the instructor who teaches the most number of courses live in? | SELECT T2.Building FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_name_25 (
result VARCHAR,
home_away VARCHAR,
date VARCHAR
) | What is the result of the home game on August 14? | SELECT result FROM table_name_25 WHERE home_away = "home" AND date = "august 14" | sql_create_context |
CREATE TABLE table_name_6 (
country VARCHAR,
place VARCHAR
) | Which country placed t5? | SELECT country FROM table_name_6 WHERE place = "t5" | sql_create_context |
CREATE TABLE table_10293 (
"Party" text,
"Previous council" real,
"Staying councillors" real,
"Seats up for election" real,
"Election result" real,
"New council" real
) | What is the full number of New Council when the previous council was 54 and the staying councilor number is bigger than 36? | SELECT COUNT("New council") FROM table_10293 WHERE "Previous council" = '54' AND "Staying councillors" > '36' | wikisql |
CREATE TABLE table_name_92 (
nat VARCHAR,
name VARCHAR,
ends VARCHAR,
since VARCHAR
) | What is Nat., when Ends is greater than 2010, when Since is 2006, and when Name is Paligeorgos? | SELECT nat FROM table_name_92 WHERE ends > 2010 AND since = 2006 AND name = "paligeorgos" | sql_create_context |
CREATE TABLE table_3250 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | How many people directed episode 3 in the season? | SELECT COUNT("Directed by") FROM table_3250 WHERE "No. in season" = '3' | wikisql |
CREATE TABLE table_49755 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | what is the airport for the country tunisia with the icao dtaa? | SELECT "Airport" FROM table_49755 WHERE "Country" = 'tunisia' AND "ICAO" = 'dtaa' | 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... | 从2001年10月10日到2004年10月16日期间,列出患者范曼蔓看病时给开出的所有药品的编码、名称、数量、单价、金额 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '范曼蔓' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-10-10' AND '2004-10-16' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_... | css |
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,
... | what is the monthly average value of patient 006-195541's cpk-mb index until 2103? | SELECT AVG(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 = '006-195541')) AND lab.labname = 'cpk-mb index' AND STRFTIME('%y', lab.labresulttim... | eicu |
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,
... | what is the number of patients whose gender is m and procedure icd9 code is 3799? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "3799" | mimicsql_data |
CREATE TABLE table_34023 (
"Rank" text,
"City" text,
"Population" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real,
"Altitude (mslm)" real
) | What is the lowest density of serravalle scrivia? | SELECT MIN("Density (inhabitants/km 2 )") FROM table_34023 WHERE "City" = 'serravalle scrivia' | wikisql |
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... | when patient 017-74343 was receiving a lab test for the first time in 02/last year? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74343')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TI... | eicu |
CREATE TABLE table_204_298 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" number
) | how many times did the runner finish below 10th place ? | SELECT COUNT(*) FROM table_204_298 WHERE "position" > 10 | squall |
CREATE TABLE table_19801 (
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" text
) | What writers are associated with a viewing figure of 7.01 million? | SELECT "Writer" FROM table_19801 WHERE "Viewing figure" = '7.01 million' | wikisql |
CREATE TABLE table_16550 (
"Engine" text,
"Power, continuous" text,
"Critical altitude This is the highest altitude at which the engine can achieve its full continuous power rating. Above this altitude, power falls off with height as with a naturally aspirated engine . See Supercharger#Altitude effects for ... | When the engine is Wasp Jr. T1B2, what is the number needed for takeoff power? | SELECT COUNT("Power, takeoff") FROM table_16550 WHERE "Engine" = 'Wasp Jr. T1B2' | wikisql |
CREATE TABLE table_name_5 (
pct VARCHAR,
years VARCHAR,
team VARCHAR
) | What is Akron's highest Pct in 100 years? | SELECT COUNT(pct) FROM table_name_5 WHERE years > 100 AND team = "akron" | sql_create_context |
CREATE TABLE table_name_53 (
song VARCHAR,
year VARCHAR,
us_r VARCHAR,
b VARCHAR
) | Which song has a U.S. R&B 100 in 2010? | SELECT song FROM table_name_53 WHERE year = 2010 AND us_r & b = "100" | sql_create_context |
CREATE TABLE table_71033 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What team was the opponent when there was a score of 5 4 (11)? | SELECT "Opponent" FROM table_71033 WHERE "Score" = '5–4 (11)' | wikisql |
CREATE TABLE table_67813 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Name the entrant for year more than 1991 and chassis of lotus 109 | SELECT "Entrant" FROM table_67813 WHERE "Year" > '1991' AND "Chassis" = 'lotus 109' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
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... | okay i'd like a flight on US from INDIANAPOLIS to SAN DIEGO in the afternoon what 's available | 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 (((flight.departure_time <= 1200 AND flight.departure_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS' AND ... | atis |
CREATE TABLE table_name_27 (
game INTEGER,
record VARCHAR
) | What is the score of the scores when Game had a Record of 17-29? | SELECT SUM(game) FROM table_name_27 WHERE record = "17-29" | sql_create_context |
CREATE TABLE table_10402 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | I want to know the right ascension which has an NGC less than 6575 and declination of 38 00 | SELECT "Right ascension ( J2000 )" FROM table_10402 WHERE "NGC number" < '6575' AND "Declination ( J2000 )" = '°38′00″' | 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,... | 有哪些医生为病号鲁鸿畅在医疗就诊71582240745的过程中开具了医疗项目,他们的姓名与编号都是什么? | SELECT HOSP_DOC_CD, HOSP_DOC_NM FROM t_kc22 WHERE MED_CLINIC_ID = '71582240745' | css |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,... | show me all the one way fares from TACOMA to MONTREAL | 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 = 'TACOMA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_50015 (
"Tournament" text,
"Wins" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the total Top-25 when the events were less than 0? | SELECT SUM("Top-25") FROM table_50015 WHERE "Events" < '0' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | how many times has patient 006-76924 visited the intensive care unit this year? | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-76924') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE table_28255 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (million)" text
) | Who wrote episode number 45? | SELECT "Writer(s)" FROM table_28255 WHERE "No." = '45' | wikisql |
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... | 列出在医院0319489中患者43810325名称不包含关节的出院科室住院就诊记录有什么? | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '43810325' AND hz_info.YLJGDM = '0319489' AND NOT zyjzjlb.CYKSMC LIKE '%关节%' | css |
CREATE TABLE table_76907 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What is the wheel arrangement with 1 quantity preserved? | SELECT "Wheel arrangement" FROM table_76907 WHERE "Quantity preserved" = '1' | wikisql |
CREATE TABLE table_1893815_1 (
chinese__traditional_ VARCHAR,
chinese__simplified_ VARCHAR
) | Name the chinese traditional for | SELECT chinese__traditional_ FROM table_1893815_1 WHERE chinese__simplified_ = "美丽人生" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | when was patient 19059's first diagnosis time for renal dialysis encounter? | 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 = 'renal dialysis encounter') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19059) ORDER BY d... | mimic_iii |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE procedures... | when patient 16329 came to the hospital for the last time via the emergency room admit? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 16329 AND admissions.admission_location = 'emergency room admit' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_72 (
wins VARCHAR,
draws VARCHAR
) | How many wins happened with 8 draws? | SELECT wins FROM table_name_72 WHERE draws = "8" | sql_create_context |
CREATE TABLE table_name_84 (
rank VARCHAR,
school VARCHAR,
sport VARCHAR
) | What is the total rank number for Los Alamos' girls cross country? | SELECT COUNT(rank) FROM table_name_84 WHERE school = "los alamos" AND sport = "girls cross country" | sql_create_context |
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 demographic ... | how many patients whose admission type is newborn and drug name is cetylpyridinium chl (cepacol)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug = "Cetylpyridinium Chl (Cepacol)" | mimicsql_data |
CREATE TABLE table_9327 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
) | What round was Joe Sims picked? | SELECT AVG("Round") FROM table_9327 WHERE "Player" = 'joe sims' | wikisql |
CREATE TABLE table_28884858_1 (
stadium VARCHAR,
capacity_percentage VARCHAR
) | What is the name of the stadium when the capacity percentage is 83.9% | SELECT stadium FROM table_28884858_1 WHERE capacity_percentage = "83.9%" | sql_create_context |
CREATE TABLE table_name_22 (
original_title VARCHAR,
director_s_ VARCHAR,
year VARCHAR,
country VARCHAR
) | What was the original title that was directed by Alain Resnais in France before 1986? | SELECT original_title FROM table_name_22 WHERE year < 1986 AND country = "france" AND director_s_ = "alain resnais" | sql_create_context |
CREATE TABLE player_coach (
player_id number,
coach_id number,
starting_year number
)
CREATE TABLE club (
club_id number,
club_name text,
region text,
start_year number
)
CREATE TABLE player (
player_id number,
sponsor_name text,
player_name text,
gender text,
residence... | How many gold medals has the club with the most coaches won? | SELECT T1.club_id, T1.gold FROM match_result AS T1 JOIN coach AS T2 ON T1.club_id = T2.club_id GROUP BY T1.club_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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 treatment (
treat... | what is the minimum hospital bill that covers a procedure called prophylactic antibacterials - for endocarditis in 2105? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'prophylactic antibacterials - for endocardit... | eicu |
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... | 在00年10月14日到2011年2月11日期间为病患谢芳蕙执行检测指标607066的医务人员的工号还有姓名是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 mzjzj... | css |
CREATE TABLE table_57812 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | On what date was the surface clay with Cyril Saulnier as the opponent in the final? | SELECT "Date" FROM table_57812 WHERE "Surface" = 'clay' AND "Opponent in the final" = 'cyril saulnier' | wikisql |
CREATE TABLE table_32687 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away teams score when Hawthorn played as the home team? | SELECT "Away team score" FROM table_32687 WHERE "Home team" = 'hawthorn' | wikisql |
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... | 支出的总医疗费,在医疗就诊80157522521里是多少? | SELECT qtb.MED_AMOUT FROM qtb WHERE qtb.MED_CLINIC_ID = '80157522521' UNION SELECT gyb.MED_AMOUT FROM gyb WHERE gyb.MED_CLINIC_ID = '80157522521' UNION SELECT zyb.MED_AMOUT FROM zyb WHERE zyb.MED_CLINIC_ID = '80157522521' UNION SELECT mzb.MED_AMOUT FROM mzb WHERE mzb.MED_CLINIC_ID = '80157522521' | css |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | How old are the students with allergies to food and animal types on average? | SELECT AVG(age) FROM student WHERE stuid IN (SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "animal") | spider |
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... | 非科室小儿神经外科负责的所有医疗就诊在医院4723266中有哪些记录,在2005-06-17到2018-05-08内? | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4723266' AND IN_HOSP_DATE BETWEEN '2005-06-17' AND '2018-05-08') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '4723266' AND IN_HOSP_DATE BETWEEN '2005-06-17' AND '2018-05-08' AND MED_ORG_DEPT_NM = '小儿神经外科') | css |
CREATE TABLE table_204_525 (
id number,
"rank" number,
"player" text,
"county" text,
"tally" text,
"total" number,
"opposition" text
) | in the 197172 national hurling league , who is the only single player ranked in the top 10 from laois ? | SELECT "player" FROM table_204_525 WHERE "rank" <= 10 AND "county" = 'laois' | squall |
CREATE TABLE table_name_22 (
to_par VARCHAR,
country VARCHAR,
score VARCHAR
) | What is To Par, when Country is United States, and when Score is 71-68-73=212? | SELECT to_par FROM table_name_22 WHERE country = "united states" AND score = 71 - 68 - 73 = 212 | sql_create_context |
CREATE TABLE table_29219286_1 (
written_by VARCHAR,
directed_by VARCHAR
) | Who wrote the episode that was directed by Milan Cheylov? | SELECT written_by FROM table_29219286_1 WHERE directed_by = "Milan Cheylov" | sql_create_context |
CREATE TABLE table_name_22 (
player VARCHAR,
school_country VARCHAR
) | Which player is associated with Temple? | SELECT player FROM table_name_22 WHERE school_country = "temple" | sql_create_context |
CREATE TABLE table_7258 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | What is the 2011 when the 2010 shows grand slam tournaments? | SELECT "2011" FROM table_7258 WHERE "2010" = 'grand slam tournaments' | wikisql |
CREATE TABLE table_test_14 (
"id" int,
"bleeding" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"haemoglobin" float,
"severe_hypertension" bool,
"platelets" int,
"neutrophil_count" int,
"renal_disease" bool,
"severe_thrombocytopenia" bool,
"fa... | known neutropenia ( < 1000 neutrophils per mm3 ) or known severe thrombocytopenia ( < 50000 platelets per mm3 ) | SELECT * FROM table_test_14 WHERE neutropenia = 1 OR neutrophil_count < 1000 OR severe_thrombocytopenia = 1 OR platelets < 50000 | criteria2sql |
CREATE TABLE table_203_529 (
id number,
"fin" number,
"st" number,
"driver" text,
"car #" number,
"make" text,
"points" number,
"bonus" number,
"laps" number,
"winnings" text
) | what driver earned the least amount of winnings ? | SELECT "driver" FROM table_203_529 ORDER BY "winnings" LIMIT 1 | squall |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 医院编号为5498370里有多少个科室的平均医疗住院时长多于3天? | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '5498370' GROUP BY qtb.MED_ORG_DEPT_CD HAVING AVG(qtb.IN_HOSP_DAYS) > 3 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '5498370' GROUP BY gyb.MED_ORG_DEPT_CD HAVING AVG(gyb.IN_HOSP_DAYS) > 3 UNION SELECT zyb.MED_O... | css |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 查一下编号45776514963的检验报告单的就诊类型 | SELECT JZLX FROM jybgb WHERE BGDH = '45776514963' | css |
CREATE TABLE table_name_98 (
usage VARCHAR,
engine VARCHAR
) | What is the for the f136fb engine? | SELECT usage FROM table_name_98 WHERE engine = "f136fb" | sql_create_context |
CREATE TABLE table_name_76 (
date VARCHAR,
rating VARCHAR,
event VARCHAR
) | What is Date, when Rating 1.5, and when Event is Johnson Vs. Moraga? | SELECT date FROM table_name_76 WHERE rating = "1.5" AND event = "johnson vs. moraga" | sql_create_context |
CREATE TABLE table_16389 (
"Round" real,
"Choice" real,
"Player name" text,
"Position" text,
"Height" text,
"Weight" real,
"College" text
) | Which player went to Michigan State? | SELECT "Player name" FROM table_16389 WHERE "College" = 'Michigan State' | wikisql |
CREATE TABLE table_name_94 (
grid INTEGER,
laps INTEGER
) | what is the grid when the laps is more than 20? | SELECT SUM(grid) FROM table_name_94 WHERE laps > 20 | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREA... | unsolved Q's asker's Info(Q is not closed yet ). | SELECT pUser.*, u.DisplayName, u.Reputation, u.UpVotes, u.UpVotes FROM (SELECT OwnerUserId, COUNT(OwnerUserId) AS cnt FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL GROUP BY OwnerUserId) AS pUser JOIN Users AS u ON pUser.OwnerUserId = u.Id ORDER BY pUser.cnt DESC | sede |
CREATE TABLE table_train_14 (
"id" int,
"bone_marrow_transplant" bool,
"pregnancy_or_lactation" bool,
"organ_transplantation" bool,
"advanced_pulmonary_fibrosis" bool,
"cardiopulmonary_resuscitation" bool,
"myocardial_infarction" bool,
"NOUSE" float
) | pregnancy or lactating | SELECT * FROM table_train_14 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_204_284 (
id number,
"jurisdiction" text,
"adherents" number,
"bishops" number,
"priests" number,
"monastics" number,
"monasteries" number,
"parishes" number
) | how many more adherents does constantinople have compared to jerusalem ? | SELECT (SELECT "adherents" FROM table_204_284 WHERE "jurisdiction" = 'constantinople') - (SELECT "adherents" FROM table_204_284 WHERE "jurisdiction" = 'jerusalem') | squall |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Find meter_700 and meter_100 , and visualize them by a bar chart, order by the x axis from low to high. | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 | nvbench |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Draw a bar chart about the distribution of name and meter_100 , sort from low to high by the X. | SELECT name, meter_100 FROM swimmer ORDER BY name | nvbench |
CREATE TABLE table_37775 (
"Reign" real,
"Days held" text,
"Location" text,
"Successful defenses" real,
"Event" text
) | What is the highest number of successful defenses in brandon, florida and a reign less than 1? | SELECT MAX("Successful defenses") FROM table_37775 WHERE "Location" = 'brandon, florida' AND "Reign" < '1' | wikisql |
CREATE TABLE table_70531 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." real,
"Record" text
) | What was the record at the game that had an attendance over 27,623 and a score of 0 7? | SELECT "Record" FROM table_70531 WHERE "Att." > '27,623' AND "Score" = '0–7' | wikisql |
CREATE TABLE table_24798489_1 (
original_airdate VARCHAR,
challenge VARCHAR
) | What is the original airdate of the episode where the challenge was three overstuffed sandwiches? | SELECT original_airdate FROM table_24798489_1 WHERE challenge = "Three overstuffed sandwiches" | sql_create_context |
CREATE TABLE table_29867 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what is the most number where the calendar shows october 20 | SELECT "High points" FROM table_29867 WHERE "Date" = 'October 20' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many urgent hospital admission patients have been diagnosed with unspecified acute uri? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Acute uri NOS" | mimicsql_data |
CREATE TABLE table_73599 (
"Name" text,
"Location" text,
"Act. Units" real,
"Stacks" text,
"In Service Dates" text,
"Unit Capacity (2009)" text,
"Nameplate Capacity (2009 MW )" text,
"Owner Type" text,
"Owner(s) (2009)" text
) | Name the stacks for 1 1969 2 1995 | SELECT "Stacks" FROM table_73599 WHERE "In Service Dates" = '1 1969 2 1995' | wikisql |
CREATE TABLE table_name_92 (
date VARCHAR,
result VARCHAR,
score VARCHAR
) | When was there a result of 8-1 and a score of 8-1? | SELECT date FROM table_name_92 WHERE result = "8-1" AND score = "8-1" | sql_create_context |
CREATE TABLE table_34164 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text
) | What 1997, has qf as a 1994, and 1r as a 1999? | SELECT "1997" FROM table_34164 WHERE "1994" = 'qf' AND "1999" = '1r' | wikisql |
CREATE TABLE table_51051 (
"Date" text,
"City" text,
"Event" text,
"Winner" text,
"Prize" text
) | What is City, when Prize is '$146,000'? | SELECT "City" FROM table_51051 WHERE "Prize" = '$146,000' | wikisql |
CREATE TABLE table_23340 (
"Contestant" text,
"Background" text,
"Original team" text,
"Age" real,
"Hometown" text,
"Result" text
) | What is the hometown of the contestant whose background is as a financial consultant? | SELECT "Hometown" FROM table_23340 WHERE "Background" = 'Financial consultant' | wikisql |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | A bar chart shows the number of year of the maximum price and score of wines, and bin the year into the weekday interval, and list total number from low to high order. | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) | nvbench |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | tell me the percentile for sodium of 140.0 among patients in the same age as patient 3125 on the current hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = ... | mimic_iii |
CREATE TABLE table_75277 (
"Surname" text,
"First" text,
"D.O.B." text,
"Uni#" real,
"Bats" text,
"Throws" text,
"Position" text
) | Which batter has a uni# of 31? | SELECT "Bats" FROM table_75277 WHERE "Uni#" = '31' | wikisql |
CREATE TABLE table_name_28 (
whenbuilt VARCHAR,
name VARCHAR
) | When was the locomotive named fighter command built? | SELECT whenbuilt FROM table_name_28 WHERE name = "fighter command" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and commission_pct , I want to show by the x axis from low to high. | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER | nvbench |
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 prescription... | count the number of patients whose age is less than 80 and procedure long title is intravenous infusion of clofarabine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "80" AND procedures.long_title = "Intravenous infusion of clofarabine" | mimicsql_data |
CREATE TABLE table_66033 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is Far Eastern College Johnny Abarrientos' Pick number? | SELECT "Pick" FROM table_66033 WHERE "College" = 'far eastern' AND "Player" = 'johnny abarrientos' | wikisql |
CREATE TABLE table_72324 (
"Episode title" text,
"Air date" text,
"Reward" text,
"Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
) | How many votes were taken when the outcome was '6th voted out day 12'? | SELECT COUNT("Vote") FROM table_72324 WHERE "Finish" = '6th Voted Out Day 12' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
... | what exactly does cornea degeneration nec mean? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cornea degeneration nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cornea degeneration nec' | mimic_iii |
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
) | A bar chart about what are the names of climbers and the corresponding heights of the mountains that they climb?, rank from low to high by the X-axis. | SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T1.Name | nvbench |
CREATE TABLE table_74079 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
) | For teams that won exactly 15, how many points were scored? | SELECT "Points" FROM table_74079 WHERE "Won" = '15' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and code , and group by attribute name, and rank in desc by the bars. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC | nvbench |
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... | 对于医疗费总额高于3099.06元的患者83701090的医疗记录,列出有哪些出院诊断疾病编码和名称? | 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_ID = '83701090' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3099.06) | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,... | what was the name of the medication patient 7698 was prescribed in the same hospital visit after having been diagnosed with asthma nos since 10/2105? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 7698 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.sh... | mimic_iii |
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 prescriptions (
subject_id text,
hadm_id... | count the number of patients whose ethnicity is hispanic/latino - puerto rican and procedure long title is ventriculopuncture through previously implanted catheter? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Ventriculopuncture through previously implanted catheter" | mimicsql_data |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose first name does not contain the letter M, give me a line chart to show the hire date and the corresponding salaries, show in asc by the x-axis please. | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_204_775 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many teams did not win any gold medals in this event ? | SELECT COUNT("nation") FROM table_204_775 WHERE "gold" = 0 | squall |
CREATE TABLE table_name_17 (
discipline VARCHAR,
championship VARCHAR
) | What was the discipline for the Championship of international championship for makes? | SELECT discipline FROM table_name_17 WHERE championship = "international championship for makes" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.