instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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, ...
SELECT gwyjzb.MED_AMOUT FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '17535786353' UNION SELECT fgwyjzb.MED_AMOUT FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '17535786353'
css
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...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '魏烨磊' AND t_kc21.MED_SER_ORG_NO = '6998667' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%楔状缺损%'
css
CREATE TABLE table_27756572_10 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in the game on March 26?
SELECT score FROM table_27756572_10 WHERE date = "March 26"
sql_create_context
CREATE TABLE table_name_59 ( date VARCHAR, opponents_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has Opponents in the final of valeria casillo lilly raffa?
SELECT date FROM table_name_59 WHERE opponents_in_the_final = "valeria casillo lilly raffa"
sql_create_context
CREATE TABLE table_59954 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Place that has Money of 150, and a Player of bobby cruickshank?
SELECT "Place" FROM table_59954 WHERE "Money ( $ )" = '150' AND "Player" = 'bobby cruickshank'
wikisql
CREATE TABLE table_name_88 ( end_term INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total End term with a Title of prince regent of bavaria?
SELECT SUM(end_term) FROM table_name_88 WHERE title = "prince regent of bavaria"
sql_create_context
CREATE TABLE table_name_43 ( visitor VARCHAR, decision VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visitor on november 14 with leclaire recording the decision?
SELECT visitor FROM table_name_43 WHERE decision = "leclaire" AND date = "november 14"
sql_create_context
CREATE TABLE table_name_70 ( abbr VARCHAR, votes__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE ABBR WITH VOTES OF 11.2% IN 2011?
SELECT abbr FROM table_name_70 WHERE votes__2011_ = "11.2%"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '007-849') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medicati...
eicu
CREATE TABLE table_name_25 ( laps VARCHAR, start VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps have 1 as the start?
SELECT COUNT(laps) FROM table_name_25 WHERE start = "1"
sql_create_context
CREATE TABLE table_10794 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for the game that has a loss of Johnson (5-6)?
SELECT "Record" FROM table_10794 WHERE "Loss" = 'johnson (5-6)'
wikisql
CREATE TABLE table_14782 ( "Candidate" text, "Background" text, "Original Team" text, "Hometown" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original team that was Hired by Trump (5-19-2005)?
SELECT "Original Team" FROM table_14782 WHERE "Result" = 'hired by trump (5-19-2005)'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "29961"
mimicsql_data
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Agreements ( Do...
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY COUNT(Product_Name)
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abnormal loss of weight" AND lab.fluid = "Pleural"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '7146110' AND qtb.IN_HOSP_DATE BETWEEN '2014-07-06' AND '2018-09-11' AND qtb.PERSON_NM LIKE '赵%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '7146110' AND gyb.IN_HOSP_DATE BETWEEN '2014-07-06' AND '2018-09-11' AND gyb.PERSON_NM LIKE '赵%' UNION SELECT * FROM zyb WHERE ...
css
CREATE TABLE table_27755784_6 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the game on November 10?
SELECT record FROM table_27755784_6 WHERE date = "November 10"
sql_create_context
CREATE TABLE table_13764 ( "Rank" real, "Name" text, "1st run" text, "2nd run" text, "3rd run" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many totals have 38.023 (6) as the 3rd run?
SELECT COUNT("Total") FROM table_13764 WHERE "3rd run" = '38.023 (6)'
wikisql
CREATE TABLE table_13544 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What manufacturer has...
SELECT "Manufacturer" FROM table_13544 WHERE "Year made" = '1883'
wikisql
CREATE TABLE table_79753 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "2012 First Time" te...
SELECT "2008 First Time" FROM table_79753 WHERE "2006 First Time" = '85%'
wikisql
CREATE TABLE table_name_75 ( team VARCHAR, seed VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team with a seed value greater than 7 has a note that they were an NCRAA champion?
SELECT team FROM table_name_75 WHERE seed > 7 AND notes = "ncraa champion"
sql_create_context
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '15672063' AND jyjgzbb.JYRQ BETWEEN '2009-09-1...
css
CREATE TABLE table_1473672_2 ( nhl_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nhl team does stan weir play for?
SELECT nhl_team FROM table_1473672_2 WHERE player = "Stan Weir"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_name_32 ( college_junior_club_team__league_ VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What College/Junior/Club Team (League) has a round of 3?
SELECT college_junior_club_team__league_ FROM table_name_32 WHERE round = 3
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_33053 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Home team's score when the Venue wa...
SELECT "Home team score" FROM table_33053 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_name_28 ( boat_builder VARCHAR, number VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What boat builder built the valmai with a number less than 65?
SELECT boat_builder FROM table_name_28 WHERE number < 65 AND name = "valmai"
sql_create_context
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID)
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Stevens-Johnson-TEN syn" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_name_44 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match on November 15, 2011?
SELECT score FROM table_name_44 WHERE date = "november 15, 2011"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29666)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Opioid type dependence, unspecified" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_37462 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has dallas cowboys as the opponent?
SELECT "Date" FROM table_37462 WHERE "Opponent" = 'dallas cowboys'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'lactated ringers iv solp'
eicu
CREATE TABLE table_1831262_2 ( hydroxymatairesinol VARCHAR, sesamin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of hydroxymatairesinol where sesamin is 62724?
SELECT hydroxymatairesinol FROM table_1831262_2 WHERE sesamin = "62724"
sql_create_context
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25493 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilir...
mimic_iii
CREATE TABLE table_51295 ( "Event" text, "2nd round" text, "Quarterfinal" text, "Semifinal" text, "Final" text, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Quarterfinal has a Rank larger than 9?
SELECT "Quarterfinal" FROM table_51295 WHERE "Rank" > '9'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-91255') AND STRFTIME('%y', patient.unitadmittime) >= '2103'
eicu
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,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Disrup-external op wound" AND lab."CATEGORY" = "Hematology"
mimicsql_data
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...
SELECT SBBM, YQBH, YQMC FROM jyjgzbb WHERE JYZBLSH = '87001092804'
css
CREATE TABLE table_name_41 ( home_captain VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the home captain that played at Edgbaston?
SELECT home_captain FROM table_name_41 WHERE venue = "edgbaston"
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE STUDENT ( STU_NUM int, ...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME
nvbench
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...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cardiac surgery consultation') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment ...
eicu
CREATE TABLE table_31445 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Series" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which dat...
SELECT "Date" FROM table_31445 WHERE "Streak" = 'W 2'
wikisql
CREATE TABLE table_49684 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Event, when Year is 2002, and when Competition is European Indoor Championships?
SELECT "Event" FROM table_49684 WHERE "Year" = '2002' AND "Competition" = 'european indoor championships'
wikisql
CREATE TABLE table_204_703 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country won more total medals than tue french , but less th...
SELECT "nation" FROM table_204_703 WHERE "total" > (SELECT "total" FROM table_204_703 WHERE "nation" = 'france') AND "total" < (SELECT "total" FROM table_204_703 WHERE "nation" = 'germany')
squall
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,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2151"
mimicsql_data
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_45619 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result after the week # top 11?
SELECT "Result" FROM table_45619 WHERE "Week #" = 'top 11'
wikisql
CREATE TABLE table_1213511_2 ( nationality VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player from Buffalo Sabres?
SELECT nationality FROM table_1213511_2 WHERE nhl_team = "Buffalo Sabres"
sql_create_context
CREATE TABLE table_71730 ( "Hull No." real, "Year" real, "Project" text, "Length overall in meters (without bowsprit)" real, "Name" text, "Destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the project with length overall being 25 ...
SELECT "Project" FROM table_71730 WHERE "Length overall in meters (without bowsprit)" = '25' AND "Name" = 'levante'
wikisql
CREATE TABLE table_79282 ( "Year" real, "Team" text, "Manufacturer" text, "Start" real, "Finish" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team had a start of 8 in years under 2008?
SELECT "Team" FROM table_79282 WHERE "Start" = '8' AND "Year" < '2008'
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2146"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
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 = '030-60126')) AND treatment.treatmentname = 'administration of ele...
eicu
CREATE TABLE table_name_61 ( time VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time did team kawasaki zx10 1000cc have?
SELECT time FROM table_name_61 WHERE team = "kawasaki zx10 1000cc"
sql_create_context
CREATE TABLE table_11636213_7 ( partnering VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches had the result of 6 3, 6 2?
SELECT COUNT(partnering) FROM table_11636213_7 WHERE result = "6–3, 6–2"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.admityear < "2182"
mimicsql_data
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 cost ( costid num...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-42706' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-42706' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_name_5 ( ground VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what grounds did the away team of the Toronto Rebels play?
SELECT ground FROM table_name_5 WHERE away = "toronto rebels"
sql_create_context
CREATE TABLE table_1341453_40 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what district was Tim Holden the incumbent?
SELECT district FROM table_1341453_40 WHERE incumbent = "Tim Holden"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_name_88 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the opponent for June 13?
SELECT opponent FROM table_name_88 WHERE date = "june 13"
sql_create_context
CREATE TABLE table_name_23 ( time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Time/Retired with a Grid of 12?
SELECT time_retired FROM table_name_23 WHERE grid = 12
sql_create_context
CREATE TABLE table_name_68 ( position VARCHAR, played INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position has a played entry of more than 24?
SELECT COUNT(position) FROM table_name_68 WHERE played > 24
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '77759408' AND IN_HOSP_DATE BETWEEN '2010-09-04' AND '2013-06-24' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.drug = "Magnesium Oxide"
mimicsql_data
CREATE TABLE table_5082 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which events have a Rank of 1?
SELECT "Events" FROM table_5082 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_78053 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many spectators were at the game when the aw...
SELECT "Crowd" FROM table_78053 WHERE "Away team score" = '15.8 (98)'
wikisql
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), ...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID ORDER BY T1.Project_Details
nvbench
CREATE TABLE table_51065 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Socket" text, "Release date" text, "Part number(s)" text ) -- Using valid SQLite, answer the following questions for the...
SELECT "L2 cache" FROM table_51065 WHERE "Model number" = 'atom z625'
wikisql
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND demographic.dob_year < "2058"
mimicsql_data
CREATE TABLE table_2380212_1 ( league VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What League was played in 2007?
SELECT league FROM table_2380212_1 WHERE year = 2007
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'regular insulin')) AND DATETIME(cost.chargetim...
eicu
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...
SELECT ZYBMLX, ZYZDBM, ZYZDMC FROM zyjzjlb WHERE JZLSH = '10564497940'
css
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '3297791' AND t_kc22.STA_DATE BETWEEN '2015-06-21' AND '2021-03-18' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
mimicsql_data
CREATE TABLE table_20453681_1 ( county VARCHAR, obama_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Obama get 37.1%?
SELECT county FROM table_20453681_1 WHERE obama_percentage = "37.1%"
sql_create_context
CREATE TABLE postseason ( year INTEGER, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INTEGER, losses INTEGER, ties INTEGER ) CREATE TABLE player_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id T...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid ORDER BY yearid DESC
nvbench
CREATE TABLE table_203_270 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which four competitions are the only competitions that occurred on...
SELECT "competition" FROM table_203_270 GROUP BY "competition" HAVING COUNT(*) = 1
squall
CREATE TABLE table_72962 ( "Rank" real, "Railway Station" text, "Annual entry/exit (millions) 2011\u201312" text, "Annual interchanges (millions) 2011\u201312" text, "Total Passengers (millions) 2011\u201312" text, "Location" text, "Main Services" text, "Number of Platforms" real ) -- ...
SELECT MIN("Rank") FROM table_72962 WHERE "Railway Station" = 'Gatwick Airport'
wikisql
CREATE TABLE table_203_727 ( id number, "year" number, "miss northern ireland" text, "hometown" text, "placement at miss world" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was miss uk 2005 and miss universe 2005 2nd runner u...
SELECT "miss northern ireland" FROM table_203_727 WHERE "notes" = 'later miss united kingdom 2005 and miss universe united kingdom 2005 2nd runner-up'
squall
CREATE TABLE table_24032 ( "Series Year" real, "Series-Ending Tournament" text, "Location" text, "Surface" text, "Champion" text, "Runner-up" text, "Score in Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score when...
SELECT "Score in Final" FROM table_24032 WHERE "Runner-up" = 'Tracy Austin'
wikisql
CREATE TABLE table_name_2 ( weight_at_birth VARCHAR, gender VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much did the girl, nicknamed Chidi, weigh at birth?
SELECT weight_at_birth FROM table_name_2 WHERE gender = "girl" AND nickname = "chidi"
sql_create_context
CREATE TABLE table_name_30 ( area__km²_ INTEGER, name_of_community VARCHAR, excised_from VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Area (km ) that shows Excised from shire of cook and a Population smaller ...
SELECT AVG(area__km²_) FROM table_name_30 WHERE excised_from = "shire of cook" AND population < 463 AND name_of_community = "wujal wujal (bloomfield river)"
sql_create_context
CREATE TABLE table_35649 ( "Season" real, "Episodes" real, "First air date" text, "Last air date" text, "Timeslot" text, "DVD Release" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the last episode air date for season 3?
SELECT "Last air date" FROM table_35649 WHERE "Season" = '3'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON 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 hz_info.RYBH = '27615170' AND jybgb.BGRQ BETWEEN '2013-04-02...
css
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_name_16 ( date VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date with a hilly stage?
SELECT date FROM table_name_16 WHERE type = "hilly stage"
sql_create_context
CREATE TABLE table_name_67 ( bronze INTEGER, gold VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total amount of bronze medals a team with 1 gold and more than 3 silver medals has?
SELECT SUM(bronze) FROM table_name_67 WHERE gold = 1 AND silver > 3
sql_create_context
CREATE TABLE stock ( shop_id number, device_id number, quantity number ) CREATE TABLE device ( device_id number, device text, carrier text, package_version text, applications text, software_platform text ) CREATE TABLE shop ( shop_id number, shop_name text, location tex...
SELECT T2.carrier FROM stock AS T1 JOIN device AS T2 ON T1.device_id = T2.device_id GROUP BY T1.device_id HAVING COUNT(*) > 1
spider
CREATE TABLE table_7321 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Outcome of the match played on Hard (i) Surface?
SELECT "Outcome" FROM table_7321 WHERE "Surface" = 'hard (i)'
wikisql
CREATE TABLE table_name_97 ( circuit VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Circuit has a Pole position of andr ribeiro?
SELECT circuit FROM table_name_97 WHERE pole_position = "andré ribeiro"
sql_create_context
CREATE TABLE table_55199 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the surface of the match when the opponent was iryna ...
SELECT "Surface" FROM table_55199 WHERE "Opponents" = 'iryna bremond valeria savinykh'
wikisql
CREATE TABLE table_52354 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date had a Japan region?
SELECT "Date" FROM table_52354 WHERE "Region" = 'japan'
wikisql
CREATE TABLE table_name_32 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 that has a grand slam tournaments in 2006.
SELECT 2007 FROM table_name_32 WHERE 2006 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_train_66 ( "id" int, "pregnancy_or_lactation" bool, "white_blood_cell_count_wbc" int, "acute_pyelonephritis" bool, "intrabdominal_infection" bool, "body_weight" float, "oxygen_therapy_by_face_mask" bool, "temperature" float, "heart_rate" int, "paco2" float, ...
SELECT * FROM table_train_66 WHERE body_weight > 200
criteria2sql
CREATE TABLE table_55939 ( "Rank" real, "Name" text, "Nation" text, "Placings" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a rank great than 3 and a placing of 64?
SELECT "Name" FROM table_55939 WHERE "Rank" > '3' AND "Placings" = '64'
wikisql
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, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text,...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii