context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_57473 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the venue of North Melbourne?
SELECT "Venue" FROM table_57473 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
Questions with a single-use tag that has no tag wiki. These single-use tags are candidates for being deleted by the cleanup script, unless a wiki excerpt is written. Some of these questions might become untagged if the single-use tag deletion script is turned back on.
SELECT TagName, PostId AS "post_link", p.Tags, p.CreationDate FROM Tags AS t LEFT JOIN Posts AS pe ON pe.Id = t.ExcerptPostId LEFT JOIN Posts AS pw ON pw.Id = t.WikiPostId LEFT JOIN PostTags AS pt ON TagId = t.Id LEFT JOIN Posts AS p ON p.Id = PostId WHERE Count = 1 AND (WikiPostId IS NULL OR (LENGTH(pe.Body) < 1 AND L...
sede
CREATE TABLE table_77021 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is Nation, when Rank is greater than 2, when Total is greater than 1, and when Bronze is less than 3?
SELECT "Nation" FROM table_77021 WHERE "Rank" > '2' AND "Total" > '1' AND "Bronze" < '3'
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...
calculate the maximum age of english speaking patients who have sepsis primary disease.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "SEPSIS"
mimicsql_data
CREATE TABLE table_12564633_1 ( series__number INTEGER, written_by VARCHAR )
What was the first series in this list that Jack Orman wrote?
SELECT MIN(series__number) FROM table_12564633_1 WHERE written_by = "Jack Orman"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
give me the number of patients whose drug name is propofol?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Propofol"
mimicsql_data
CREATE TABLE table_34089 ( "Driver" text, "Points" real, "Season" real, "Races" real, "Percentage of possible points" text )
Which races have points greater than 123, fernando alonso as the driver and a percentage of possible points of 74.44%?
SELECT "Races" FROM table_34089 WHERE "Points" > '123' AND "Driver" = 'fernando alonso' AND "Percentage of possible points" = '74.44%'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
has patient 009-13409 received a procedure until 4 years ago.
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(...
eicu
CREATE TABLE zyb ( 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...
根据不同的入院诊断疾病名称和科室编码,列出医院0923184患者的平均年龄在所有医疗就诊记录中是多大?
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '0923184' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '0923184' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
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 was the first time that patient 015-91239 had the maximum value of respiration on the current icu visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-91239') AND patient.unitdischargetime IS NULL) ...
eicu
CREATE TABLE table_name_60 ( home_team VARCHAR, tie_no VARCHAR )
Who was the home team when the Tie no was 7?
SELECT home_team FROM table_name_60 WHERE tie_no = "7"
sql_create_context
CREATE TABLE table_24426 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
Who was the originally artist when Jasmine Murray was selected?
SELECT "Original artist" FROM table_24426 WHERE "Result" = 'Selected'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_24 ( opponent VARCHAR, loss VARCHAR )
What opponent has tomko (1-1) as a loss?
SELECT opponent FROM table_name_24 WHERE loss = "tomko (1-1)"
sql_create_context
CREATE TABLE table_19826 ( "North Carolina" text, "273.7%" text, "South Carolina" text, "132.1%" text, "Mississippi" text, "95.8%" text, "Wisconsin" text, "59.4%" text, "Vermont" text, "32.5%" text )
Name the 132.1% for where north carolina is colorado
SELECT "132.1%" FROM table_19826 WHERE "North Carolina" = 'Colorado'
wikisql
CREATE TABLE table_name_48 ( episode INTEGER, performer_4 VARCHAR )
What is the lowest episode number where john bird was the 4th performer?
SELECT MIN(episode) FROM table_name_48 WHERE performer_4 = "john bird"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count ...
Unanswered questions by deleted users.
SELECT CreationDate, Id AS "post_link" FROM Posts WHERE OwnerUserId IS NULL AND ClosedDate IS NULL AND PostTypeId = 1 AND COALESCE(AnswerCount, 0) = 0 ORDER BY CreationDate
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
what are the percentile of 6.7 in a total protein lab test given the same age of patient 030-52327 during their current hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'total protein' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '030-52327' AND pat...
eicu
CREATE TABLE table_20882 ( "Parameter" text, "1st stage" text, "2nd stage" text, "3rd stage" text, "4th stage" text )
Name the parameter for 2.67 m
SELECT "Parameter" FROM table_20882 WHERE "1st stage" = '2.67 m'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and manager_id in a bar chart, and list by the X from low to high.
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
nvbench
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text )
What is the name of school that has the smallest enrollment in each state?
SELECT cname, state, MIN(enr) FROM college GROUP BY state
spider
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code te...
what were the five most frequent lab tests ordered since 2104 for patients in the age of 60 or above?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND STRFTIME('%y', labevents.charttime) >=...
mimic_iii
CREATE TABLE table_name_97 ( school_club_team VARCHAR, player VARCHAR, round VARCHAR, pick VARCHAR )
Which School/Club Team has a Round smaller than 5, a Pick larger than 1, and a Player of reggie mckenzie?
SELECT school_club_team FROM table_name_97 WHERE round < 5 AND pick > 1 AND player = "reggie mckenzie"
sql_create_context
CREATE TABLE table_18987377_1 ( original_title VARCHAR, film_title_used_in_nomination VARCHAR )
Name the original title for the last metro
SELECT original_title FROM table_18987377_1 WHERE film_title_used_in_nomination = "The Last Metro"
sql_create_context
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
Create a bar chart showing meter_100 across meter 600, and could you order from low to high by the Y-axis?
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100
nvbench
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,...
病患个人账户支出医疗就诊27710855494中占医疗费总额的占比是多少吗?
SELECT (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '27710855494') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '27710855494')
css
CREATE TABLE STUDENT ( Fname VARCHAR, city_code VARCHAR ) CREATE TABLE VOTING_RECORD ( VICE_PRESIDENT_Vote VARCHAR )
Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = "PIT"
sql_create_context
CREATE TABLE table_31682 ( "Flight" text, "Launch date/time (UTC)" text, "Variant" text, "Launch Pad" text, "Payload" text, "Payload Mass" text )
Tell me the launch pad for 25 december 2010 10:34
SELECT "Launch Pad" FROM table_31682 WHERE "Launch date/time (UTC)" = '25 december 2010 10:34'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
医疗就诊86429402057的公民身份号码、人员姓名、人员性别、人员年龄是什么?
SELECT t_kc21.PERSON_NM, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE, t_kc21.IDENTITY_CARD FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '86429402057'
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
what are the four most frequent drugs that were prescribed to coronary artery disease female patients 20s within 2 months after they were diagnosed with coronary artery disease in this year?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND DATETIME(diagnosis.di...
eicu
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, ...
what is the diagnosis icd9 and diagnosis long title of subject id 92796?
SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "92796"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
how much does the weight of patient 006-161415 vary last measured on the first hospital visit compared to the second to last value measured on the first hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL O...
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose year of death is less than or equal to 2174 and drug code is osel75?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2174.0" AND prescriptions.formulary_drug_cd = "OSEL75"
mimicsql_data
CREATE TABLE table_67243 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What chassis has a year of 1951?
SELECT "Chassis" FROM table_67243 WHERE "Year" = '1951'
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 medication ( medicationid ...
patient 004-17866 has received a fio2 lab test in 2105?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-17866')) AND lab.labname = 'fio2' AND STRFTIME('%y', lab.labresulttime) = '2105'
eicu
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 whose admission year is less than 2144 and diagnoses icd9 code is 28802?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "28802"
mimicsql_data
CREATE TABLE table_12434380_1 ( institution VARCHAR, mascot VARCHAR )
What is the name of the institution with the mascot of blue devils?
SELECT institution FROM table_12434380_1 WHERE mascot = "Blue Devils"
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...
列出在2005-01-17到2018-07-17内患者许兰梦所有检验报告单中有哪些标本采集部位?
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ...
css
CREATE TABLE table_203_247 ( id number, "district" text, "counties represented" text, "delegate" text, "party" text, "first elected" number, "committee" text )
how many delegates represented allegany ?
SELECT COUNT("delegate") FROM table_203_247 WHERE "counties represented" = 'allegany'
squall
CREATE TABLE table_name_12 ( title VARCHAR, catalog__number VARCHAR )
What CD has a catalog # of PCR 502?
SELECT title FROM table_name_12 WHERE catalog__number = "pcr 502"
sql_create_context
CREATE TABLE table_80170 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
What was the 2nd Party that had the 2nd Member John Barneby, when the 1st Party was Conservative?
SELECT "2nd Party" FROM table_80170 WHERE "2nd Member" = 'john barneby' AND "1st Party" = 'conservative'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid nu...
what was the maximum monthly number of patients diagnosed with adv eff insulin/antidiab until 2104?
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adv eff insulin/antidiab') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y...
mimic_iii
CREATE TABLE table_5620 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
On what date was the record 4 0 0?
SELECT "Date" FROM table_5620 WHERE "Record" = '4–0–0'
wikisql
CREATE TABLE table_20996923_20 ( date VARCHAR, city VARCHAR )
What is the date when the city is San Antonio, Texas?
SELECT date FROM table_20996923_20 WHERE city = "San Antonio, Texas"
sql_create_context
CREATE TABLE table_19751479_4 ( fastest_lap VARCHAR, rnd VARCHAR, pole_position VARCHAR )
How many races had #99 gainsco/bob stallings racing in round 10?
SELECT COUNT(fastest_lap) FROM table_19751479_4 WHERE rnd = 10 AND pole_position = "#99 GAINSCO/Bob Stallings Racing"
sql_create_context
CREATE TABLE table_name_8 ( cover_model VARCHAR, date VARCHAR )
Which Cover Model was featured on 8-03?
SELECT cover_model FROM table_name_8 WHERE date = "8-03"
sql_create_context
CREATE TABLE table_76600 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text )
How many starts for an average finish greater than 43?
SELECT SUM("Starts") FROM table_76600 WHERE "Avg. Finish" > '43'
wikisql
CREATE TABLE table_43630 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is Time, when Round is less than 2, and when Opponent is 'Valentijn Overeem'?
SELECT "Time" FROM table_43630 WHERE "Round" < '2' AND "Opponent" = 'valentijn overeem'
wikisql
CREATE TABLE table_43168 ( "Name" text, "Position" text, "Number" text, "School/Club Team" text, "Season" text, "Acquisition via" text )
What is the Season with an Acquisition via of rookie draft, and the number is 15?
SELECT "Season" FROM table_43168 WHERE "Acquisition via" = 'rookie draft' AND "Number" = '15'
wikisql
CREATE TABLE table_name_95 ( winning_constructor VARCHAR, name VARCHAR )
Which Constructor won the Roussillon Grand Prix?
SELECT winning_constructor FROM table_name_95 WHERE name = "roussillon grand prix"
sql_create_context
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...
患者朱淑兰最主要找哪位医生接受治疗,时间是从01年7月24日到18年9月6日
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '朱淑兰' AND qtb.IN_HOSP_DATE BETWEEN '2001-07-24' AND '2018-09-06' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '朱淑兰' AND gyb.IN_HOSP_DATE BETW...
css
CREATE TABLE table_54492 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
When the Score was 4-10, what was the Attendance?
SELECT "Attendance" FROM table_54492 WHERE "Score" = '4-10'
wikisql
CREATE TABLE table_50174 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was the To par for the player whose final score was 67-71=138?
SELECT "To par" FROM table_50174 WHERE "Score" = '67-71=138'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
17934842650这个住院就诊的病人的卡号及卡类型是什么
SELECT KH, KLX FROM zyjzjlb WHERE JZLSH = '17934842650'
css
CREATE TABLE table_2679061_2 ( pick__number INTEGER, nhl_team VARCHAR, college_junior_club_team VARCHAR )
what is the pick # when the nhl team is montreal canadiens and the college/junior/club team is trois-rivi res draveurs (qmjhl)?
SELECT MIN(pick__number) FROM table_2679061_2 WHERE nhl_team = "Montreal Canadiens" AND college_junior_club_team = "Trois-Rivières Draveurs (QMJHL)"
sql_create_context
CREATE TABLE table_46666 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" real, "Points 2" real )
For a team with a goals against less than 58, a position of 10, and a points 2 more than 53, what is the average lost?
SELECT AVG("Lost") FROM table_46666 WHERE "Goals Against" < '58' AND "Position" = '10' AND "Points 2" > '53'
wikisql
CREATE TABLE table_dev_38 ( "id" int, "gender" string, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "ace_inhibitors" bool, "serum_creatinine" float, ...
have a serum creatinine greater than or equal to 1.5 milligrams / deciliter ( mg / dl ) ( male ) or greater than or equal to 1.4 mg / dl ( female ) , or a creatinine clearance less than 60 milliliters / minute ( ml / minute )
SELECT * FROM table_dev_38 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female') OR creatinine_clearance_cl < 60
criteria2sql
CREATE TABLE table_51472 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the score of the home team that played Collingwood?
SELECT "Home team score" FROM table_51472 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text )
the most players picked came from which nationality ?
SELECT "nationality" FROM table_203_824 GROUP BY "nationality" ORDER BY COUNT("player") DESC LIMIT 1
squall
CREATE TABLE table_31285 ( "Film Festival" text, "Date of ceremony" text, "Category" text, "Participants/Recipients" text, "Result" text )
Which films participated in the 30th Hawaii International Film Festival?
SELECT "Participants/Recipients" FROM table_31285 WHERE "Film Festival" = '30th Hawaii International Film Festival'
wikisql
CREATE TABLE table_9299 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How much Gold has a Silver smaller than 14, and a Rank larger than 8, and a Bronze of 3?
SELECT COUNT("Gold") FROM table_9299 WHERE "Silver" < '14' AND "Rank" > '8' AND "Bronze" = '3'
wikisql
CREATE TABLE table_name_82 ( ratings__5_capital_cities_ VARCHAR, episode_no VARCHAR )
What was the rating of the episode Wonder Drug?
SELECT ratings__5_capital_cities_ FROM table_name_82 WHERE episode_no = "wonder drug"
sql_create_context
CREATE TABLE table_56898 ( "Week" real, "EASTERN #1" text, "Eastern #2" text, "WESTERN #1" text, "Western #2" text )
Tell me the eastern #2 for western #2 of oakland
SELECT "Eastern #2" FROM table_56898 WHERE "Western #2" = 'oakland'
wikisql
CREATE TABLE table_44238 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
Who visited on march 26?
SELECT "Visitor" FROM table_44238 WHERE "Date" = 'march 26'
wikisql
CREATE TABLE table_name_32 ( agency VARCHAR, birthday VARCHAR )
What's the agency of the member born on 1998.11.09?
SELECT agency FROM table_name_32 WHERE birthday = "1998.11.09"
sql_create_context
CREATE TABLE table_name_6 ( losses INTEGER, against VARCHAR, wins VARCHAR, club VARCHAR )
What is the sum of losses when wins is more than 6, club is camperdown and against is more than 1238?
SELECT SUM(losses) FROM table_name_6 WHERE wins > 6 AND club = "camperdown" AND against > 1238
sql_create_context
CREATE TABLE table_1566848_7 ( pictorials VARCHAR, centerfold_model VARCHAR )
Who were all the pictorials when the centerfold model was Rebekka Armstrong?
SELECT COUNT(pictorials) FROM table_1566848_7 WHERE centerfold_model = "Rebekka Armstrong"
sql_create_context
CREATE TABLE table_name_90 ( period VARCHAR, country VARCHAR, peak_position VARCHAR )
Name the period for south korea with peak position of #1
SELECT period FROM table_name_90 WHERE country = "south korea" AND peak_position = "#1"
sql_create_context
CREATE TABLE table_12982 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
What Week 4 has a Week 2 of samantha speer?
SELECT "Week 4" FROM table_12982 WHERE "Week 2" = 'samantha speer'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
EECS 487 and EECS 521 , which one is easier ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 487 OR course.number = 521) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_38605 ( "Team" text, "Recopa 1995" text, "Supercopa 1995" text, "CONMEBOL 1995" text, "Copa Libertadores 1996" text )
which Copa Libertadores 1996 has round 1 Supercopa 1995 and argentinos juniors team ?
SELECT "Copa Libertadores 1996" FROM table_38605 WHERE "Supercopa 1995" = 'round 1' AND "Team" = 'argentinos juniors'
wikisql
CREATE TABLE table_67107 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Name the date for visiting team of denver broncos
SELECT "Date" FROM table_67107 WHERE "Visiting Team" = 'denver broncos'
wikisql
CREATE TABLE table_7818 ( "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 game number of the game played against Charlotte?
SELECT COUNT("Game") FROM table_7818 WHERE "Team" = 'charlotte'
wikisql
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(...
Compare the total number of different job titles for all those jobs in department 80 using a bar chart.
SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE
nvbench
CREATE TABLE table_9624 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Fuzzy Zoeller's score in the United States?
SELECT "Score" FROM table_9624 WHERE "Country" = 'united states' AND "Player" = 'fuzzy zoeller'
wikisql
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, ...
患者周哲彦入院诊断疾病名称不包含包括的在医院0211238医疗就诊记录编号是什么?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '周哲彦' AND gwyjzb.MED_SER_ORG_NO = '0211238' AND NOT gwyjzb.IN_DIAG_DIS_NM LIKE '%包括%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '周哲彦' AND fgwyjzb.MED_SER_ORG_NO = '0211238' AND NOT fgwyjzb.IN_DIAG_DIS_NM LIKE '%包括%'
css
CREATE TABLE table_203_79 ( id number, "year" number, "film" text, "publisher" text, "director" text, "distributor" text, "worldwide gross" text, "notes" text )
what is the number of live action american superhero movies released in 1978 ?
SELECT COUNT("film") FROM table_203_79 WHERE "year" = 1978
squall
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
看看医院0002177有多少科室在门诊就诊中开出少于23张检验报告单,时间为2002年6月17日到2007年12月6日
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '0002177' AND jybgb.BGRQ BETWEEN '2002-06-17' AND '2007-12-06' GROUP BY jybgb.KSBM HAVING COUNT(*) < 23 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod tim...
what are the four most common medicines that patients were prescribed during the same month after they were prescribed rufinamide until 2101?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'rufinamide' AND STRFTIME('%y', prescriptions.startdate) <= '2101'...
mimic_iii
CREATE TABLE table_19834691_4 ( timeslot VARCHAR, _number VARCHAR )
name the total number of timeslot for number 1
SELECT COUNT(timeslot) FROM table_19834691_4 WHERE _number = 1
sql_create_context
CREATE TABLE table_name_66 ( bronze INTEGER, total VARCHAR, gold VARCHAR )
What is the low bronze total for the team with 4 total and under 1 gold?
SELECT MIN(bronze) FROM table_name_66 WHERE total = 4 AND gold < 1
sql_create_context
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CRE...
Bar chart of minimal salary from each dept name, order dept_name in ascending order please.
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
nvbench
CREATE TABLE table_35545 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What was the B segmint for Netlix S03E01?
SELECT "Segment B" FROM table_35545 WHERE "Netflix" = 's03e01'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
in ATLANTA i would like information on ground transportation
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'ATLANTA' AND ground_service.city_code = city.city_code
atis
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
GENERATE HTML PAGE SHOWING (mostly) ANIMATED GIFS posted in specified # of days. Creates HTML to paste into blank .html file showing .GIF images (mostly animated GIFs) linked to Q&A posts within 'the past number of days specified'. Looks for the first occurrence of `.gif` in the post body and searches backwards for `ht...
SELECT SUBSTRING(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - (CHARINDEX(REVERSE(@stStart), REVERSE(LEFT(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - 1))) + LEN(@stStart) - 1), CHARINDEX(REVERSE(@stStart), REVERSE(LEFT(Body, CHARINDEX(@stEnd, Body) + LEN(@stStart) - 1))) + LEN(@stStart) - 1) AS "gif_url", CASE WH...
sede
CREATE TABLE table_76990 ( "Title" text, "Lyricist(s)" text, "Composer(s)" text, "Arranger(s)" text, "Length" text )
Who was the arranger of ' '?
SELECT "Arranger(s)" FROM table_76990 WHERE "Title" = 'ขอโทษ'
wikisql
CREATE TABLE table_52371 ( "Party" text, "Leader" text, "Votes" real, "Percentage" text, "Seats" real )
Which highest number of Seats has votes of 244,867?
SELECT MAX("Seats") FROM table_52371 WHERE "Votes" = '244,867'
wikisql
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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 ...
门诊诊断患者99012820为特发性肌张力障碍,他的检测指标203759的结果定量以及单位数据分别是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_62049 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Competition" text )
When did the peterborough phantoms play at a venue of home?
SELECT "Date" FROM table_62049 WHERE "Venue" = 'home' AND "Opponent" = 'peterborough phantoms'
wikisql
CREATE TABLE patient ( ssn number, name text, address text, phone text, insuranceid number, pcp number ) CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE prescribes ( physician number, patient number, medication number, ...
How many rooms does each block floor have?
SELECT COUNT(*), T1.blockfloor FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor
spider
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 ...
When is 511 offered next semester ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
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, ...
药品603623-l患者花淑华在哪几家医院被开出过?
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '花淑华' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '603623-l')
css
CREATE TABLE table_name_14 ( prohibition_ticket VARCHAR, progressive_ticket VARCHAR )
What name ran for the Prohibition ticket when the Progressive ticket was Eugene M. Travis?
SELECT prohibition_ticket FROM table_name_14 WHERE progressive_ticket = "eugene m. travis"
sql_create_context
CREATE TABLE table_name_48 ( proto_oceanic VARCHAR, proto_polynesian VARCHAR )
Which Proto-Oceanic has a Proto-Polynesian of *lima?
SELECT proto_oceanic FROM table_name_48 WHERE proto_polynesian = "*lima"
sql_create_context
CREATE TABLE table_41538 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the average number of drawn with a difference of 17 and 22 points?
SELECT AVG("Drawn") FROM table_41538 WHERE "Difference" = '17' AND "Points" = '22'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
what is patient 015-7988's first diagnosis until 4 years ago?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988')) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CUR...
eicu
CREATE TABLE table_36079 ( "Name" text, "Species Specific" text, "Intra-molecular structure" text, "Comparative" text, "Link" text )
Which Species Specific has a Comparative of no, and an Intra-molecular structure of no, and a Link of sourcecode?
SELECT "Species Specific" FROM table_36079 WHERE "Comparative" = 'no' AND "Intra-molecular structure" = 'no' AND "Link" = 'sourcecode'
wikisql
CREATE TABLE table_70973 ( "Round" real, "Overall" real, "Player" text, "Position" text, "College" text )
What is the lowest overall with more than 17 rounds?
SELECT MIN("Overall") FROM table_70973 WHERE "Round" > '17'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
what is the marital status of patient 19894 in their first hospital encounter.
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 19894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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, lan...
when did patient 92788 get white blood cells lab test for the last time during their current hospital visit?
SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788 AND admissions.dischtime IS NULL) ORDER BY labevents.chartti...
mimic_iii