instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "Psyllium Wafer"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
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...
SELECT gwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8731863' GROUP BY gwyjzb.MED_ORG_DEPT_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI...
css
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 diagnoses ( ...
SELECT demographic.discharge_location, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "813"
mimicsql_data
CREATE TABLE table_name_1 ( example_meaning_in_english VARCHAR, tone VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the example in English for a tone of mid rising-falling?
SELECT example_meaning_in_english FROM table_name_1 WHERE tone = "mid rising-falling"
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...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '郎永逸' AND t_kc22.t_kc21_MED_SER_ORG_NO = '7422800') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_15400878_1 ( against INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most against for minas gerais
SELECT MAX(against) FROM table_15400878_1 WHERE team = "Minas Gerais"
sql_create_context
CREATE TABLE table_name_85 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for Collingwood as the home team?
SELECT home_team AS score FROM table_name_85 WHERE home_team = "collingwood"
sql_create_context
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,...
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '66522063' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE l...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE table_202_232 ( id number, "institution" text, "location" text, "established" number, "gained university status" number, "vice-chancellor" text, "total number of students" number, "research funding (\u00a3,000)" number ) -- Using valid SQLite, answer the following question...
SELECT "institution" FROM table_202_232 ORDER BY "gained university status" DESC LIMIT 1
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 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.long_title = "Opioid type dependence, unspecified"
mimicsql_data
CREATE TABLE table_62769 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2003)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was reserved in the district that has 169 c...
SELECT "Reserved for ( SC / ST /None)" FROM table_62769 WHERE "Constituency number" = '169'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQ...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '6950309' AND wdmzjzjlb.RYDJSJ BETWEEN '2015-01-24' AND '2017-07-01' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 27 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '6950309' AND bdmzjzjlb.RYDJSJ BETWEEN '2015-01-24' AND '2017-07-01' AND DATEDIFF(b...
css
CREATE TABLE table_train_86 ( "id" int, "mini_mental_state_examination_mmse" int, "heart_disease" bool, "stroke" bool, "liver_disease" bool, "hepatitis" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- heart disease or stroke
SELECT * FROM table_train_86 WHERE heart_disease = 1 OR stroke = 1
criteria2sql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31243) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bilirubin, total, ascites') AND STRFTIME('%y', labevents.charttime) >= '210...
mimic_iii
CREATE TABLE table_name_84 ( series VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Series is on april 18?
SELECT series FROM table_name_84 WHERE date = "april 18"
sql_create_context
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) 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 VARCH...
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age)
nvbench
CREATE TABLE table_14958 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the attendance for july 16
SELECT "Attendance" FROM table_14958 WHERE "Date" = 'july 16'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328') AND patient.unitdischargetime IS NUL...
eicu
CREATE TABLE table_name_47 ( name VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has an Average of 48.83?
SELECT name FROM table_name_47 WHERE average = 48.83
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 t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 mo...
mimic_iii
CREATE TABLE txmzjzjlb ( 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...
SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '73755198' AND txmzjzjlb.JZKSRQ BETWEEN '2003-12-12' AND '2004-04-25' AND txmzjzjlb.YLJGDM = '7884008' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON...
css
CREATE TABLE table_17779 ( "Year" real, "Celebrity partner" text, "Week #" text, "Dance" text, "Horwood" real, "Phillips" real, "Goodman" real, "Tonioli" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How was times was ...
SELECT COUNT("Phillips") FROM table_17779 WHERE "Dance" = 'Jive' AND "Week #" = '10'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) 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, g...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_30373 ( "Date" text, "Round" text, "Opponent" text, "Result" text, "Venue" text, "Scorers" text, "Attendance" real, "Match Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When semi final (2nd leg) is the round w...
SELECT MAX("Attendance") FROM table_30373 WHERE "Round" = 'Semi Final (2nd leg)'
wikisql
CREATE TABLE table_name_40 ( sport VARCHAR, country VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sport for canada in 2004
SELECT sport FROM table_name_40 WHERE country = "canada" AND year = 2004
sql_create_context
CREATE TABLE table_name_15 ( qual_1 VARCHAR, team VARCHAR, best VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Team Rusport has the best of 59.654 and what qual 1?
SELECT qual_1 FROM table_name_15 WHERE team = "rusport" AND best = "59.654"
sql_create_context
CREATE TABLE station ( LOCATION VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all locations of train stations?
SELECT DISTINCT LOCATION FROM station
sql_create_context
CREATE TABLE table_76898 ( "Rank" real, "Name" text, "Nation" text, "Points" real, "Placings" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Placings have a Nation of west germany, and Points larger than 303.72?
SELECT SUM("Placings") FROM table_76898 WHERE "Nation" = 'west germany' AND "Points" > '303.72'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-16385')) AND medication.drugname = 'lasix' AND DATETIME(medication.dru...
eicu
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'insulin human nph'
mimic_iii
CREATE TABLE table_name_93 ( percentage_lost VARCHAR, starting_weight__kg_ VARCHAR, weight_lost__kg_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Percentage Lost for the contestant with a starting weight above 102 kg who lost 46.9 kg?
SELECT percentage_lost FROM table_name_93 WHERE starting_weight__kg_ > 102 AND weight_lost__kg_ = 46.9
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_48352 ( "Discipline" text, "Championship" text, "Circuit" text, "Event" text, "Session" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the USAC National Championship, what is the Discipline?
SELECT "Discipline" FROM table_48352 WHERE "Championship" = 'usac national championship'
wikisql
CREATE TABLE table_204_400 ( id number, "district" number, "senator" text, "party" text, "caucus" text, "first elected" number, "counties represented" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of democrats on th...
SELECT COUNT(*) FROM table_204_400 WHERE "party" = 'democratic'
squall
CREATE TABLE table_42407 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has exactly 342 spikes?
SELECT "Name" FROM table_42407 WHERE "Spike" = '342'
wikisql
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "83" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE table_name_1 ( winning_driver VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the winning driver for pau grand prix
SELECT winning_driver FROM table_name_1 WHERE name = "pau grand prix"
sql_create_context
CREATE TABLE table_52969 ( "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 big was the average crowd when the opposing ...
SELECT AVG("Crowd") FROM table_52969 WHERE "Away team score" = '19.16 (130)'
wikisql
CREATE TABLE table_name_45 ( total INTEGER, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what total was the lowest and had a to par of e?
SELECT MIN(total) FROM table_name_45 WHERE to_par = "e"
sql_create_context
CREATE TABLE table_21501 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When m...
SELECT "Location Attendance" FROM table_21501 WHERE "High assists" = 'Mike Bibby (9)'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN zyjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjzjlb_jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND zy...
css
CREATE TABLE Manufacturers ( name VARCHAR, code VARCHAR ) CREATE TABLE products ( Price INTEGER, manufacturer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Select the average price of each manufacturer's products, showing the manufacturer's name.
SELECT AVG(T1.Price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name
sql_create_context
CREATE TABLE table_name_88 ( position VARCHAR, jersey_number_s_ VARCHAR, years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what position did the player play who had a number of 15 who played in 1987?
SELECT position FROM table_name_88 WHERE jersey_number_s_ = "15" AND years = "1987"
sql_create_context
CREATE TABLE table_2819 ( "Month" text, "Week" real, "Overall" text, "Offensive" text, "Defensive" text, "Transition" text, "Rookie" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rookie for ryan powell
SELECT "Rookie" FROM table_2819 WHERE "Offensive" = 'Ryan Powell'
wikisql
CREATE TABLE table_80278 ( "Year" real, "Competition" text, "Wins" real, "Draws" real, "Loses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average Year has Losses 4, and Wins less than 18, and Draws greater than 1?
SELECT AVG("Year") FROM table_80278 WHERE "Loses" = '4' AND "Wins" < '18' AND "Draws" > '1'
wikisql
CREATE TABLE table_19421 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the class aaaaa for 2005-06
SELECT "Class AAAAA" FROM table_19421 WHERE "School Year" = '2005-06'
wikisql
CREATE TABLE table_58560 ( "Athlete" text, "Country" text, "From" real, "Gold" real, "Silver" real, "Total" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What athlete has less than 7 gold and 14 total medals?
SELECT "Athlete" FROM table_58560 WHERE "Gold" < '7' AND "Total" = '14'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 ( EMPLO...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_28322 ( "Season" real, "Player" text, "Position" text, "Nationality" text, "Team" text, "Previous college/Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Dallas Burn's draft pick was which position?
SELECT "Position" FROM table_28322 WHERE "Team" = 'Dallas Burn'
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8714078' AND IN_HOSP_DATE BETWEEN '2004-04-22' AND '2017-06-16' AND INSURED_STS = '未就业' AND MED_AMOUT >= 7988.58
css
CREATE TABLE table_name_55 ( save VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Save is on June 15?
SELECT save FROM table_name_55 WHERE date = "june 15"
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
css
CREATE TABLE table_name_52 ( season VARCHAR, ufl_cup VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a UFL Cup of tbd?
SELECT season FROM table_name_52 WHERE ufl_cup = "tbd"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "5781"
mimicsql_data
CREATE TABLE table_67382 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 7:00 has 8:00 risk takers?
SELECT "7:00" FROM table_67382 WHERE "8:00" = 'risk takers'
wikisql
CREATE TABLE table_65247 ( "Gothic letter or digraph" text, "Roman equivalent" text, "\"Normalised\" transliteration" text, "Sound" text, "Normal environment of occurrence (in native words)" text, "Proto-Germanic origin" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "Normal environment of occurrence (in native words)" FROM table_65247 WHERE "Proto-Germanic origin" = '/ai/'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM jybgb WHERE jybgb.JZLSH = '93926804881'
css
CREATE TABLE table_200_1 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what role did mischa barton play in the movie octane ?
SELECT "role" FROM table_200_1 WHERE "title" = 'octane'
squall
CREATE TABLE table_76334 ( "District" text, "Population" real, "Area" real, "Pop. Dens." real, "No.of Settlements" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the population with an area of 1,126.84?
SELECT MIN("Population") FROM table_76334 WHERE "Area" = '1,126.84'
wikisql
CREATE TABLE table_train_266 ( "id" int, "active_infection" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "neuropathy" bool, "severe_diabetic_complication" bool, "hba1c" float, "active_malignancy" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questio...
SELECT * FROM table_train_266 WHERE heart_disease = 1 OR heart_disease = 1
criteria2sql
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...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_40727 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Amal McCaskill who plays forward-center played for what school/club team?
SELECT "School/Club Team" FROM table_40727 WHERE "Position" = 'forward-center' AND "Player" = 'amal mccaskill'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
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_ID = '68237125' AND t_kc21.MED_SER_ORG_NO = '2715252') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE table_train_41 ( "id" int, "pulmonary_embolization" bool, "hiv_infection" bool, "neutrophil_count" int, "renal_disease" bool, "liver_disease" bool, "serum_creatinine" float, "myocardial_infarction" bool, "NOUSE" float ) -- Using valid SQLite, answer the following quest...
SELECT * FROM table_train_41 WHERE liver_disease = 1
criteria2sql
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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2126.0" AND prescriptions.formulary_drug_cd = "D5W100"
mimicsql_data
CREATE TABLE table_204_954 ( id number, "no." number, "country" text, "2009 winter\nuniversiade" number, "2007 wjcc" number, "2007 wwcc" number, "2008 wjcc" number, "2008 wwcc" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT AVG("points") FROM table_204_954 WHERE "no." <= 5
squall
CREATE TABLE table_name_58 ( venue VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue did the runner have a note of 1:23:07?
SELECT venue FROM table_name_58 WHERE notes = "1:23:07"
sql_create_context
CREATE TABLE table_10721 ( "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 venue did the away team score 15.16 (106) ?...
SELECT "Venue" FROM table_10721 WHERE "Away team score" = '15.16 (106)'
wikisql
CREATE TABLE table_name_19 ( place VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Place has a To par of 8?
SELECT place FROM table_name_19 WHERE to_par = "–8"
sql_create_context
CREATE TABLE table_203_183 ( id number, "season" text, "tier" number, "division" number, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was their best finish ?
SELECT "season" FROM table_203_183 ORDER BY "place" LIMIT 1
squall
CREATE TABLE table_name_36 ( away_captain VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Away captain with a Venue that is old trafford?
SELECT away_captain FROM table_name_36 WHERE venue = "old trafford"
sql_create_context
CREATE TABLE table_name_48 ( power VARCHAR, identifier VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Power, when Identifier is CBEB-FM?
SELECT power FROM table_name_48 WHERE identifier = "cbeb-fm"
sql_create_context
CREATE TABLE table_name_31 ( year INTEGER, issue_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the year that had an issue price of $1,295.95?
SELECT AVG(year) FROM table_name_31 WHERE issue_price = "$1,295.95"
sql_create_context
CREATE TABLE table_name_13 ( start VARCHAR, laps VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the start with Laps of 199 with qual of 224.838
SELECT start FROM table_name_13 WHERE laps = 199 AND qual = "224.838"
sql_create_context
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE mzjzjlb.JZZDSM = '抽动秽语综合征' GROUP BY person_info.JGDM
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND STRFTIME('%y', prescriptions.startdate) >= '2102' GROUP BY prescriptions.drug) AS t1 W...
mimic_iii
CREATE TABLE table_47091 ( "Date" text, "Time ( GMT )" text, "Serial" text, "Apogee" text, "Outcome" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for the 10b serial?
SELECT "Date" FROM table_47091 WHERE "Serial" = '10b'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_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 = 'true post infarct, init'))
mimic_iii
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 diagnoses ( ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BLADDER CANCER/SDA"
mimicsql_data
CREATE TABLE table_24090 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did they do against Memphis?
SELECT "Result" FROM table_24090 WHERE "Opponent" = 'Memphis'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE Movie ( YEAR INTEGER ) CREATE TABLE Rating ( stars INTEGER, mID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum stars and year for the most recent movie?
SELECT MAX(T1.stars), T2.YEAR FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T2.YEAR = (SELECT MAX(YEAR) FROM Movie)
sql_create_context
CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, date_of_birth time, first_name text, last_name text, amount_outstanding number, email_address text, phone_number text, cell_mobile_phone_number text ...
SELECT date_left_staff FROM staff WHERE first_name = "Janessa" AND last_name = "Sawayn"
spider
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_contract_company_id INTEGER, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255) ) CREATE TABLE...
SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY COUNT(last_name)
nvbench
CREATE TABLE table_2263674_1 ( romanised_name VARCHAR, portfolio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the romanised name of the official who was Secretary for health, welfare and food?
SELECT romanised_name FROM table_2263674_1 WHERE portfolio = "Secretary for Health, Welfare and Food"
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Ye...
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'prokinetic agent - metoclopramide' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-5 yea...
eicu
CREATE TABLE table_65150 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real ) -- Using valid SQLite, answer the following questi...
SELECT "League Goals" FROM table_65150 WHERE "FA Cup Goals" > '0' AND "FA Cup Apps" = '2' AND "League Apps" = '45'
wikisql
CREATE TABLE table_1342218_17 ( result VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election incumbent Brent Spence took place in?
SELECT result FROM table_1342218_17 WHERE incumbent = "Brent Spence"
sql_create_context
CREATE TABLE table_11678 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Time/Retired has less than 77 laps, and a Grid of 16?
SELECT "Time/Retired" FROM table_11678 WHERE "Laps" < '77' AND "Grid" = '16'
wikisql
CREATE TABLE table_2216245_2 ( top_10 VARCHAR, winnings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many top 10s did he have the year he won $80,490?
SELECT COUNT(top_10) FROM table_2216245_2 WHERE winnings = "$80,490"
sql_create_context
CREATE TABLE table_57406 ( "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. -- Who has a home team score of 9.5 (59)?
SELECT "Home team" FROM table_57406 WHERE "Home team score" = '9.5 (59)'
wikisql
CREATE TABLE table_985 ( "Competition" text, "Record" text, "Result" text, "Home Matches" real, "Home Attendance" real, "Avg. Home Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when the team was 4-1?
SELECT "Result" FROM table_985 WHERE "Record" = '4-1'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_i...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 70169 AND STRFTIME('%y', admissions.admittime) >= '2105'
mimic_iii
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE (Tags.TagName = ...
sede