context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_92 ( laps INTEGER, grid VARCHAR, manufacturer VARCHAR, time_retired VARCHAR )
What was the average number of laps completed by KTM riders, with times of +56.440 and grid values under 11?
SELECT AVG(laps) FROM table_name_92 WHERE manufacturer = "ktm" AND time_retired = "+56.440" AND grid < 11
sql_create_context
CREATE TABLE table_name_80 ( network VARCHAR, premiere VARCHAR )
Tell me the network for 13 january 2009
SELECT network FROM table_name_80 WHERE premiere = "13 january 2009"
sql_create_context
CREATE TABLE table_name_27 ( website VARCHAR, name VARCHAR )
What's the website for the yamagata international documentary film festival?
SELECT website FROM table_name_27 WHERE name = "yamagata international documentary film festival"
sql_create_context
CREATE TABLE table_name_74 ( replaced_by VARCHAR, date_of_appointment VARCHAR )
What is the name of the person that was appointed on 13 May 2009?
SELECT replaced_by FROM table_name_74 WHERE date_of_appointment = "13 may 2009"
sql_create_context
CREATE TABLE table_10284 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which away team's Venue is western oval?
SELECT "Away team" FROM table_10284 WHERE "Venue" = 'western oval'
wikisql
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, ...
give me the number of patients whose age is less than 62 and diagnoses short title is esophageal reflux?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.short_title = "Esophageal reflux"
mimicsql_data
CREATE TABLE table_name_32 ( image_quality VARCHAR, date VARCHAR, multiple_sessions VARCHAR, authentication VARCHAR )
what is the image quality when the multiple sessions is x, the authentication is and the date is may 15, 2007?
SELECT image_quality FROM table_name_32 WHERE multiple_sessions = "x" AND authentication = "✓" AND date = "may 15, 2007"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
is patient 027-4674 ever diagnosed with anything during the last year?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-4674')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIM...
eicu
CREATE TABLE table_name_83 ( race VARCHAR, time VARCHAR )
Who holds the time of 17:11.572?
SELECT race FROM table_name_83 WHERE time = "17:11.572"
sql_create_context
CREATE TABLE table_3099 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who directed 'hey now hey now perry'S girlfriend's back'?
SELECT "Directed by" FROM table_3099 WHERE "Title" = 'Hey Now Hey Now Perry''s Girlfriend''s Back'
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...
when was the first time patient 011-31236's procedure was performed in 2101?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31236')) AND STRFTIME('%y', treatment.treatmenttime) = '2101'...
eicu
CREATE TABLE table_22517 ( "Number" real, "Sanskrit" text, "International Alphabet of Sanskrit Transliteration" text, "Sanskrit gloss" text, "Western name" text, "Greek" text, "Gloss" text, "Tattva (Element)" text, "Quality" text, "Ruling Planet" text )
When kumbha is the international alphabet of sanskrit transliteration what is the gloss?
SELECT "Gloss" FROM table_22517 WHERE "International Alphabet of Sanskrit Transliteration" = 'Kumbha'
wikisql
CREATE TABLE table_60214 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text )
How much money does the player with a 68-67-69-71=275 score have?
SELECT "Money ( \u00a3 )" FROM table_60214 WHERE "Score" = '68-67-69-71=275'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
were any medications prescribed to patient 27038 when they came to the hospital last time?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27038 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)
mimic_iii
CREATE TABLE table_13632 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text )
Which Rank has a Player of matt ruth?
SELECT SUM("Rank") FROM table_13632 WHERE "Player" = 'matt ruth'
wikisql
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, ...
医院1070682给名为卫祺祥的病人开出的单价最高的药品名称、编码和单价分别是什么
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '卫祺祥' AND t_kc21.MED_SER_ORG_NO = '1070682') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_16703 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
what is the venue where the scores are 15.13 (103) 8.4 (52)?
SELECT "Venue" FROM table_16703 WHERE "Scores" = '15.13 (103) – 8.4 (52)'
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...
名字是陶成化投保人一年门诊医疗费用总额一共是多少元钱?
SELECT SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_NM = '陶成化' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
6107007医疗机构在二零零二年十月九日到二零零六年十二月二十日期间一共有多少新生儿门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '61...
css
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ...
A bar chart for returning the number of the lot details of lots that belong to investors with details 'l'?, I want to rank by the how many lot details in descending.
SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY COUNT(lot_details) DESC
nvbench
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, H...
病患94819953从2018年6月26日起到2018年10月5日结束内自费金额高于1549.15元的药品量都包括什么呀?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '94819953' AND t_kc22.STA_DATE BETWEEN '2018-06-26' AND '2018-10-05' AND t_kc22.SELF_PAY_AMO > 1549.15
css
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...
how many patients have medicaid health insurance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid"
mimicsql_data
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE class ( class_code text, crs_code text, class_section text, class_time text, class_room text, prof_num number ) ...
What are the number of different course codes?
SELECT COUNT(DISTINCT crs_code) FROM class
spider
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Des...
The Reputation of Voters in This Election.
SELECT u.Reputation FROM Badges AS b LEFT JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'Constituent' AND CAST((JULIANDAY(Date) - JULIANDAY('2018-08-06')) * 1440.0 AS INT) > 0
sede
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
What are the name and population of each county?
SELECT county_name, population FROM county
spider
CREATE TABLE table_name_36 ( week VARCHAR, venue VARCHAR, attendance VARCHAR )
What is the number of weeks where the venue was memorial stadium and the attendance was less than 41,252?
SELECT COUNT(week) FROM table_name_36 WHERE venue = "memorial stadium" AND attendance < 41 OFFSET 252
sql_create_context
CREATE TABLE table_204_123 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number )
was the attendance more or less in the saturday , april 13th game compared to the saturday , may 11th
SELECT (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, april 13') > (SELECT "attendance" FROM table_204_123 WHERE "date" = 'saturday, may 11')
squall
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
经过门诊诊断后确定为慢性牙周炎的患者的检测指标261843的参考值范围下限还有上限能达到多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '慢性牙周炎' AND jyjgzbb.JCZBDM = '261843' UNION SELECT jyjgzbb.CKZFWXX,...
css
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 ( ...
among patients admitted in the year less than 2203, how many of them were aged below 70?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "70" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE salary ( year number, team_id text, league_id text, player_id text, salary number ) CREATE TABLE manager_award_vote ( award_id text, year number, league_id text, player_id text, points_won number, points_max number, votes_first number ) CREATE TABLE manager...
What are the first name and last name of the players who were paid salary by team Washington Nationals in both 2005 and 2007?
SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first, T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JO...
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
find out the average age of patients whose marital status is single and ethnicity is hispanic/latino - puerto rican.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
mimicsql_data
CREATE TABLE table_66233 ( "Year" real, "Stage" real, "Start" text, "Finish" text, "Leader at the summit" text )
What year was finish Toulouse, and stage was larger than 12?
SELECT SUM("Year") FROM table_66233 WHERE "Finish" = 'toulouse' AND "Stage" > '12'
wikisql
CREATE TABLE table_36288 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
WHICH Outcome IS ON 18 july 1993?
SELECT "Outcome" FROM table_36288 WHERE "Date" = '18 july 1993'
wikisql
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, ...
since 2105, what are the top four most frequent diagnoses that patients were given during the same hospital encounter after being diagnosed with ventricular tachycardia - sustained?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'ventr...
eicu
CREATE TABLE table_name_48 ( wins VARCHAR, draws INTEGER )
What is the total number of Wins, when Draws is less than 2?
SELECT COUNT(wins) FROM table_name_48 WHERE draws < 2
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, item...
what was the first type of hospital admission type of patient 3939?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 3939 ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_66047 ( "Hull Number" text, "Name" text, "Builder" text, "Laid down" text, "Launched" text, "Completed" text )
What year was the USS Cambridge laid down?
SELECT "Laid down" FROM table_66047 WHERE "Name" = 'uss cambridge'
wikisql
CREATE TABLE table_name_89 ( rank INTEGER, player VARCHAR, wins VARCHAR )
What is the rank of Lee Trevino, who had less than 27 wins?
SELECT SUM(rank) FROM table_name_89 WHERE player = "lee trevino" AND wins < 27
sql_create_context
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE va...
How many courses for each office? Show me a bar chart, could you show by the x-axis in desc please?
SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY PROF_OFFICE DESC
nvbench
CREATE TABLE table_1507852_5 ( cancelable VARCHAR, bubbles VARCHAR )
what's the cancelable with bubbles being yes
SELECT cancelable FROM table_1507852_5 WHERE bubbles = "Yes"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
to which religious background does the patient with patient id 6983 belong to?
SELECT demographic.religion FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_37107 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
What is the highest numbered pick from round 7?
SELECT MAX("Pick") FROM table_37107 WHERE "Round" = '7'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
在2004-03-08至2005-12-26之间外地门诊的就诊记录数量在这家医疗机构5043128体现了多少
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '5043128' AND JZKSRQ BETWEEN '2004-03-08' AND '2005-12-26' AND WDBZ > 0
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
list patient identifications of patients who were diagnosed with ac/chr syst/dia hrt fail since 2 years ago.
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac/chr syst/dia hrt fail') AND DATETIME(diagnoses_icd.charttime) >= DATETI...
mimic_iii
CREATE TABLE table_name_38 ( premiere VARCHAR, rating VARCHAR )
What was the date of the premiere that had a 20.9 rating?
SELECT premiere FROM table_name_38 WHERE rating = "20.9"
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...
病人奚子平的检验结果指标中哪些单号的检验报告单全部正常?
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 NOT ...
css
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
What are the number of the dates in which the mean sea level pressure was between 30.3 and 31?
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31
nvbench
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...
count the number of patients whose marital status is married and age is less than 31?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age < "31"
mimicsql_data
CREATE TABLE table_28062 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many field goals did Donald Green score?
SELECT COUNT("Field goals") FROM table_28062 WHERE "Player" = 'Donald Green'
wikisql
CREATE TABLE aircraft ( Aircraft VARCHAR, Aircraft_ID VARCHAR ) CREATE TABLE MATCH ( Location VARCHAR, Winning_Aircraft VARCHAR )
Please list the location and the winning aircraft name.
SELECT T2.Location, T1.Aircraft FROM aircraft AS T1 JOIN MATCH AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft
sql_create_context
CREATE TABLE table_name_60 ( lms_spr VARCHAR, car_no VARCHAR )
Which is the LMS SPR when the car number was 15?
SELECT lms_spr FROM table_name_60 WHERE car_no = "15"
sql_create_context
CREATE TABLE table_77470 ( "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
Which Run 4 has a Run 3 of 1:26.63?
SELECT "Run 4" FROM table_77470 WHERE "Run 3" = '1:26.63'
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 demographic ...
how many patients died in or before 2115?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2115.0"
mimicsql_data
CREATE TABLE table_80101 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Before 1956, what Chassis has Gordini Straight-4 engine with 3 points?
SELECT "Chassis" FROM table_80101 WHERE "Year" < '1956' AND "Engine" = 'gordini straight-4' AND "Points" = '3'
wikisql
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, ...
count the number of times that patient 031-15666 has received a anion gap test in the lab since 157 months ago.
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime) >= DATETIME(CURRE...
eicu
CREATE TABLE table_name_4 ( rank INTEGER, title VARCHAR )
What is the rank of American Pie 2?
SELECT MIN(rank) FROM table_name_4 WHERE title = "american pie 2"
sql_create_context
CREATE TABLE table_60905 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
What's the total for the wc belgrade event with 10 rank points?
SELECT "Total" FROM table_60905 WHERE "Event" = 'wc belgrade' AND "Rank points" = '10'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
count the number of patients whose admission location is emergency room admit and age is less than 85?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_54933 ( "Year" text, "Team" text, "Comp" text, "Rate" text, "RAtt" text, "RYds" text, "RAvg" text )
What year was the comp 33?
SELECT "Year" FROM table_54933 WHERE "Comp" = '33'
wikisql
CREATE TABLE table_15615 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which date has a Record of 22-22?
SELECT "Date" FROM table_15615 WHERE "Record" = '22-22'
wikisql
CREATE TABLE table_name_12 ( round VARCHAR, club VARCHAR )
What round did the spartak moscow club play?
SELECT round FROM table_name_12 WHERE club = "spartak moscow"
sql_create_context
CREATE TABLE table_72293 ( "Season" text, "League" text, "Rank" real, "Games" real, "Points" real, "GF" real, "GA" real, "Manager" text, "Top Scorer" text, "Goals" real )
Who is the manager whose rank is 16?
SELECT "Manager" FROM table_72293 WHERE "Rank" = '16'
wikisql
CREATE TABLE table_20385 ( "N\u00b0" real, "Television service" text, "Country" text, "Language" text, "Content" text, "DAR" text, "HDTV" text, "PPV" text, "Package/Option" text )
Was there HDTV when the service was Priv ?
SELECT "HDTV" FROM table_20385 WHERE "Television service" = 'PRIVÈ'
wikisql
CREATE TABLE table_1181375_1 ( builder VARCHAR, withdrawn VARCHAR )
what's the builder where withdrawn is 1954 1958
SELECT builder FROM table_1181375_1 WHERE withdrawn = "1954–1958"
sql_create_context
CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TA...
Give me a bar chart that the x-axis is the services and the Y is the count(services), and could you show bars from low to high order?
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services
nvbench
CREATE TABLE table_name_94 ( date VARCHAR, tournament VARCHAR )
What is the date of the Outback Steakhouse Pro-Am Tournament?
SELECT date FROM table_name_94 WHERE tournament = "outback steakhouse pro-am"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
what is patient 025-66662's gender?
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '025-66662'
eicu
CREATE TABLE table_41009 ( "Bowl Game" text, "Date" text, "Stadium" text, "City" text, "Television" text, "Conference Matchups" text, "Payout ( US$ )" text )
What stadium was the December 29, 2008 game played at?
SELECT "Stadium" FROM table_41009 WHERE "Date" = 'december 29, 2008'
wikisql
CREATE TABLE table_name_37 ( third INTEGER, club VARCHAR, rank VARCHAR )
What is the smallest number of third place earned for the Es Sahel at a rank less than 3?
SELECT MIN(third) FROM table_name_37 WHERE club = "es sahel" AND rank < 3
sql_create_context
CREATE TABLE table_17625749_1 ( club VARCHAR, tries_for VARCHAR )
Name the club for when tries for is 32
SELECT club FROM table_17625749_1 WHERE tries_for = "32"
sql_create_context
CREATE TABLE table_17209 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
What position is the player Jordan Fransoo in?
SELECT "Position" FROM table_17209 WHERE "Player" = 'Jordan Fransoo'
wikisql
CREATE TABLE table_name_71 ( competition VARCHAR, venue VARCHAR, score VARCHAR )
Venue of klfa stadium, cheras, and a Score of 3-3 had what competition?
SELECT competition FROM table_name_71 WHERE venue = "klfa stadium, cheras" AND score = "3-3"
sql_create_context
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
For the top 3 days with the largest max gust speeds, show the date and average temperature with a bar chart.
SELECT date, mean_temperature_f FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text )
how many tv shows did natalia oreiro between 1998 and 2002 ?
SELECT COUNT("title") FROM table_204_871 WHERE "ano" >= 1998 AND "ano" <= 2002
squall
CREATE TABLE table_8011 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the date when Grimsby Town is the home team?
SELECT "Date" FROM table_8011 WHERE "Home team" = 'grimsby town'
wikisql
CREATE TABLE table_21956 ( "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 4744 is the avg. trips per mile (x1000) what is the current stock?
SELECT "Current Stock" FROM table_21956 WHERE "Avg. trips per mile (\u00d71000)" = '4744'
wikisql
CREATE TABLE table_1000181_1 ( current_series VARCHAR, notes VARCHAR )
What is the current series where the new series began in June 2011?
SELECT current_series FROM table_1000181_1 WHERE notes = "New series began in June 2011"
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE fare_basis ( far...
the cheapest flights between BOSTON and PHILADELPHIA which arrive between 3 and 1700 o'clock on tuesday
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, fare, flight, flight_fare WHERE ((((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.yea...
atis
CREATE TABLE table_204_795 ( id number, "date" text, "opponent" text, "score" text, "result" text, "location" text, "attendance" number )
which team did this team face against next after beating minnesota on january 29 of this season ?
SELECT "opponent" FROM table_204_795 WHERE "date" > (SELECT "date" FROM table_204_795 WHERE "date" = 'january 29, 1949') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_54709 ( "Catches" text, "Player" text, "Versus" text, "Venue" text, "Date" text )
What date had a versus of source: cricinfo.com?
SELECT "Date" FROM table_54709 WHERE "Versus" = 'source: cricinfo.com'
wikisql
CREATE TABLE table_16698 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
what's the grand finalist where winners is collingwood
SELECT "Grand Finalist" FROM table_16698 WHERE "Winners" = 'Collingwood'
wikisql
CREATE TABLE table_12283 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Venue with the Friendly Competition?
SELECT "Venue" FROM table_12283 WHERE "Competition" = 'friendly'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREAT...
Find the number of dorms for each gender in a bar chart, I want to show by the x axis from high to low please.
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender ORDER BY gender DESC
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
what was the name of the output that patient 002-7771 got last until 1929 days ago?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-7771')) AND intakeoutput.cellpath LIKE '%output%' AND DA...
eicu
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom te...
what are the top three most common laboratory tests that followed in the same hospital encounter for patients who were given ins drug-elut coronry st until 2103?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
CREATE TABLE table_name_38 ( score VARCHAR, date VARCHAR )
What was the score of the match played on 5 September 2001?
SELECT score FROM table_name_38 WHERE date = "5 september 2001"
sql_create_context
CREATE TABLE table_69759 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text )
What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and 0 drawn?
SELECT SUM("Played") FROM table_69759 WHERE "First game" < '2000' AND "Lost" < '21' AND "Drawn" < '0'
wikisql
CREATE TABLE table_name_66 ( against INTEGER, played VARCHAR, drawn VARCHAR, points VARCHAR )
What is the average against that has a drawn less than 7, points greater than 22, and 19 for the played?
SELECT AVG(against) FROM table_name_66 WHERE drawn < 7 AND points > 22 AND played = 19
sql_create_context
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, ...
how many asian patients have diagnoses icd9 code 30501?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.icd9_code = "30501"
mimicsql_data
CREATE TABLE table_name_67 ( round INTEGER, player VARCHAR )
What is the highest round played by Chris Phillips?
SELECT MAX(round) FROM table_name_67 WHERE player = "chris phillips"
sql_create_context
CREATE TABLE table_34236 ( "Season" text, "Order" text, "Played" real, "Drawn" real, "Lost" real, "Penalties" real, "Points For" real, "Points Against" real, "Points Diff" real, "Coach" text )
How many games were lost when the order was 2nd and the play was more than 13
SELECT COUNT("Lost") FROM table_34236 WHERE "Order" = '2nd' AND "Played" > '13'
wikisql
CREATE TABLE table_train_53 ( "id" int, "immune_suppression" bool, "need_hemodialysis" bool, "steroid_therapy" bool, "cardiogenic_shock" bool, "hematologic_disease" bool, "coronary_syndrome" bool, "NOUSE" float )
immunosuppression, systemic steroid therapy ( > 10 mg prednisolon / day )
SELECT * FROM table_train_53 WHERE immune_suppression = 1 OR steroid_therapy = 1
criteria2sql
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...
从07年9月27日起到08年1月4日为止号码是5309668的医院在门诊就诊中开出大于等于20张检验报告单的科室有多少个科室?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '5309668' AND jybgb.BGRQ BETWEEN '2007-09-27' AND '2008-01-04' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 20) AS T
css
CREATE TABLE table_30552 ( "#" real, "Player" text, "Country" text, "Points" real, "Reset points" real, "Events" real )
what is the person there the numbers is 2343
SELECT "Player" FROM table_30552 WHERE "Points" = '2343'
wikisql
CREATE TABLE table_23329 ( "(Virtual)" text, "Callsign" text, "Affiliation" text, "Branding" text, "Channel" text, "Programming" text, "Owner" text )
what is the virtual callsign if is wnet
SELECT "(Virtual)" FROM table_23329 WHERE "Callsign" = 'WNET'
wikisql
CREATE TABLE table_name_7 ( pick VARCHAR, round VARCHAR, position VARCHAR )
What was the pick number for the kicker in round 8?
SELECT COUNT(pick) FROM table_name_7 WHERE round = "round 8" AND position = "kicker"
sql_create_context
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), ...
How many courses each teacher taught? Show me a bar chart grouping by course code, sort names in ascending order please.
SELECT CRS_CODE, COUNT(CRS_CODE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY CRS_CODE ORDER BY CRS_CODE
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of office admission patients who have procedure icd9 code 4233?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "4233"
mimicsql_data
CREATE TABLE table_2758 ( "Pos" text, "##" real, "Name" text, "Team" text, "Lap One" text, "Lap Two" text, "Lap Three" text, "Lap Four" text, "Total Time" text, "Avg. Speed" text )
How many positions have a total time of 1:30.4135?
SELECT COUNT("Pos") FROM table_2758 WHERE "Total Time" = '1:30.4135'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many widow patients had transplant from cadaver?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Transplant cadaver donor"
mimicsql_data