instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_70190 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the 3rd place team at Pardubice?
SELECT "3rd place" FROM table_70190 WHERE "Venue" = 'pardubice'
wikisql
CREATE TABLE screen_mode ( Graphics_mode real, Char_cells text, Pixels text, Hardware_colours real, used_kb real, map text, Type text ) CREATE TABLE chip_model ( Model_name text, Launch_year real, RAM_MiB real, ROM_MiB real, Slots text, WiFi text, Bluetooth text ...
SELECT Company_name, COUNT(Company_name) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32 GROUP BY Company_name ORDER BY COUNT(Company_name)
nvbench
CREATE TABLE table_38684 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pick # that has a 228 overall and a round less than 7?
SELECT MAX("Pick #") FROM table_38684 WHERE "Overall" = '228' AND "Round" < '7'
wikisql
CREATE TABLE table_1119 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original Airdate" text, "Production Code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the inroductory phase for the episode ...
SELECT "Introductory phrase" FROM table_1119 WHERE "Guest" = 'Neil Shubin'
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 prescriptions ( row_id number, subject_id number, h...
SELECT 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 = 12927 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items...
mimic_iii
CREATE TABLE table_25146455_1 ( position VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the driver earn 31 points?
SELECT position FROM table_25146455_1 WHERE points = 31
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic pancreatitis" AND prescriptions.route = "LEFT EYE"
mimicsql_data
CREATE TABLE table_75794 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Television Service is Eurosport 2?
SELECT "Country" FROM table_75794 WHERE "Television service" = 'eurosport 2'
wikisql
CREATE TABLE table_58890 ( "Team" text, "2006\u201307 Pts" text, "2007\u201308 Pts" text, "2008\u201309 Pts" real, "Total Pts" real, "Total Pld" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points with less than 49 ...
SELECT COUNT("Total Pts") FROM table_58890 WHERE "2008\u201309 Pts" < '49' AND "2006\u201307 Pts" = '46'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Infectious mononucleosis"
mimicsql_data
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb 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 WHERE person_info.XM = '钱艳芳' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2015-09-20' UNI...
css
CREATE TABLE assignedto ( project VARCHAR, scientist VARCHAR ) CREATE TABLE projects ( name VARCHAR, code VARCHAR ) CREATE TABLE scientists ( SSN VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the project for ...
SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'
sql_create_context
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, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '华嘉淑' AND t_kc22.STA_DATE BETWEEN '2005-12-06' AND '2015-09-07' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ...
css
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND diagnoses.short_title = "Sarcoidosis"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-66654')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM...
eicu
CREATE TABLE table_47007 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On November 2 what was the reco...
SELECT "Record" FROM table_47007 WHERE "Date" = 'november 2'
wikisql
CREATE TABLE table_50606 ( "Oklahoma vs." text, "Overall Record" text, "at Norman" text, "at Opponent's Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text, "Since Beginning of Big 12" text ) -- Using valid SQLite, answer the ...
SELECT "Current Streak" FROM table_50606 WHERE "Last 5 Meetings" = 'osu, 4-1'
wikisql
CREATE TABLE table_51341 ( "Record" text, "Hard" text, "Clay" text, "Grass" text, "Carpet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which hard has a Clay of 0 0, Grass of 0 0, Carpet of 0 0, and a Record of 1 0?
SELECT "Hard" FROM table_51341 WHERE "Clay" = '0–0' AND "Grass" = '0–0' AND "Carpet" = '0–0' AND "Record" = '1–0'
wikisql
CREATE TABLE table_name_89 ( visitor VARCHAR, date VARCHAR, home VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the visitor team on Saturday, November 22 when link pings hc was the home team and there were more than 20 rounds?
SELECT visitor FROM table_name_89 WHERE home = "linköpings hc" AND round > 20 AND date = "saturday, november 22"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OA...
atis
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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...
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 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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE table_15162 ( "Year" text, "League" text, "Position" text, "Leading Scorer" text, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Position of 7th of 24, and a Goals smaller than 24 is what league?
SELECT "League" FROM table_15162 WHERE "Position" = '7th of 24' AND "Goals" < '24'
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 COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '施弘益' AND t_kc22.STA_DATE BETWEEN '2001-01-09' AND '2013-11-22' AND t_kc22.SOC_SRT_DIRE_NM = '右佐匹克隆片'
css
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor
nvbench
CREATE TABLE table_60774 ( "Date" text, "Nationality / Opponent" text, "Ground" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name The Ground on 18 january 1998?
SELECT "Ground" FROM table_60774 WHERE "Date" = '18 january 1998'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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), ...
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)
nvbench
CREATE TABLE table_22097588_9 ( spent_per_voter___php__ VARCHAR, amount_spent___php__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was spent per voter when total amount spent was 210,280,000?
SELECT spent_per_voter___php__ FROM table_22097588_9 WHERE amount_spent___php__ = "210,280,000"
sql_create_context
CREATE TABLE table_name_58 ( player VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a pick of 175?
SELECT player FROM table_name_58 WHERE pick = 175
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Parenteral infusion of concentrated nutritional substances"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND STRFTIME('%y', medication.drugstarttime) = '2101' GROUP BY medication.drugna...
eicu
CREATE TABLE table_71860 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many strokes for arnold palmer with a to par of greater than 9?
SELECT AVG("Total") FROM table_71860 WHERE "To par" > '9' AND "Player" = 'arnold palmer'
wikisql
CREATE TABLE table_56007 ( "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. -- When did the north melbourne team play?
SELECT "Date" FROM table_56007 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_204_812 ( id number, "#" number, "prime minister" text, "date of birth" text, "start date\nof (first) term" text, "age at beginning\nof (first) term" text, "end date\nof (final) term" text, "total time in\noffice" text, "date of death" text, "lifespan" text ) ...
SELECT "prime minister" FROM table_204_812 WHERE "#" = 1
squall
CREATE TABLE table_74265 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions does the draft pick whose nationality is Cz...
SELECT COUNT("Position") FROM table_74265 WHERE "Nationality" = 'Czech Republic'
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...
SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'CHEM' AND course.number = 398 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y...
advising
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.long_title = "Prophylactic administration of vaccine against other diseases"
mimicsql_data
CREATE TABLE table_name_28 ( japanese_voice_actor VARCHAR, mecha VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Japanese voice actor had the Mecha of airplane?
SELECT japanese_voice_actor FROM table_name_28 WHERE mecha = "airplane"
sql_create_context
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CL...
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_ADDRESS)
nvbench
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 SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '8954-j' AND STA_DATE BETWEEN '2009-03-05' AND '2017-06-25'
css
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE cite ( citingpaperid int, citedpa...
SELECT DISTINCT keyphrase.keyphraseid FROM keyphrase, paper, paperkeyphrase, venue WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'uist'
scholar
CREATE TABLE zzmzjzjlb ( 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(zzmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '戚俊晤' AND zzmzjzjlb.JZKSRQ BETWEEN '2006-06-17' AND '2011-04-28' UNION SELECT COUNT(fz...
css
CREATE TABLE table_75193 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which surface had a partner of Sandrine Testud o...
SELECT "Surface" FROM table_75193 WHERE "Partner" = 'sandrine testud' AND "Date" = 'november 14, 1999'
wikisql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_D...
SELECT Budget_Type_Code, COUNT(*) FROM Documents_with_Expenses GROUP BY Budget_Type_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE table_76350 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Points" FROM table_76350 WHERE "Club" = 'blaengarw rfc'
wikisql
CREATE TABLE table_34189 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text, "Year joined" real, "Previous conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which School in ...
SELECT "School" FROM table_34189 WHERE "Location" = 'wabash' AND "Mascot" = 'knights'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
SELECT patient.age FROM patient WHERE patient.uniquepid = '002-17348' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_18 ( month_ VARCHAR, _year VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which month and year held the Bolivia Special title?
SELECT month_ & _year FROM table_name_18 WHERE title = "bolivia special"
sql_create_context
CREATE TABLE table_name_30 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was St Kilda's away team score?
SELECT away_team AS score FROM table_name_30 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_name_77 ( directed_by VARCHAR, season VARCHAR, episode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the director of the episode with a season after 8 and an episode of XVI?
SELECT directed_by FROM table_name_77 WHERE season > 8 AND episode = "xvi"
sql_create_context
CREATE TABLE table_66400 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score March 27?
SELECT "Score" FROM table_66400 WHERE "Date" = 'march 27'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5887) AND prescriptions.drug = 'levothyroxine sodium' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 ...
mimic_iii
CREATE TABLE table_71810 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total bronze with a Gold larger than 1, a Rank of 2, and a Silver smaller than 1...
SELECT COUNT("Bronze") FROM table_71810 WHERE "Gold" > '1' AND "Rank" = '2' AND "Silver" < '12'
wikisql
CREATE TABLE table_name_90 ( cargo__tonnes_ VARCHAR, international__non_cis_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the cargo tonnes when the international (non-CIS) is 297 421?
SELECT cargo__tonnes_ FROM table_name_90 WHERE international__non_cis_ = "297 421"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jyjgzbb.BGDH 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 = '62645586' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb...
css
CREATE TABLE table_170961_2 ( official_name VARCHAR, area_km_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the parish where the area is 508.30?
SELECT COUNT(official_name) FROM table_170961_2 WHERE area_km_2 = "508.30"
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '7252912' AND t_kc22.SOC_SRT_DIRE_NM = '五氟利多片(糖衣)'
css
CREATE TABLE table_70230 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location, when the Winner is the Baltimore Colts, when the Year is before 1972...
SELECT "Location" FROM table_70230 WHERE "Winner" = 'baltimore colts' AND "Year" < '1972' AND "Result" = '14-6'
wikisql
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
SELECT Took_office, COUNT(Took_office) FROM party GROUP BY Minister
nvbench
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject/inf thrombo agent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60219) AND STRFTIME('%...
mimic_iii
CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, graduate number ) CREATE TABLE csu_fees ( campus number, year number,...
SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = "San Jose State University" AND t1.year = 2000
spider
CREATE TABLE table_12636 ( "Clubs" text, "Seasons at this level" text, "Settlements" text, "Season joined league" text, "Position in 1960/1961" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the Belenenses club occupy in 1960/61?
SELECT "Position in 1960/1961" FROM table_12636 WHERE "Clubs" = 'belenenses'
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 zyjybgb.BGDH FROM zyjybgb WHERE zyjybgb.JZLSH = '65133267001' AND NOT zyjybgb.KSMC LIKE '%影像%' UNION SELECT mzjybgb.BGDH FROM mzjybgb WHERE mzjybgb.JZLSH = '65133267001' AND NOT mzjybgb.KSMC LIKE '%影像%'
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_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), ...
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_32932 ( "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 day is hawthorn the away side?
SELECT "Date" FROM table_32932 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TA...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO...
atis
CREATE TABLE table_name_24 ( english_spelling VARCHAR, hebrew_word VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How do you spell the Hebrew word in English?
SELECT english_spelling FROM table_name_24 WHERE hebrew_word = "יְהוֹשָפָט"
sql_create_context
CREATE TABLE table_64873 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals for West Germany having a total more than 2?
SELECT COUNT("Bronze") FROM table_64873 WHERE "Total" > '2' AND "Nation" = 'west germany'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 985...
mimic_iii
CREATE TABLE table_name_76 ( round VARCHAR, team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round has Team #2 Gomel?
SELECT round FROM table_name_76 WHERE team__number2 = "gomel"
sql_create_context
CREATE TABLE table_name_37 ( competition VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Competition has a Venue of jan breydel, bruges, belgium?
SELECT competition FROM table_name_37 WHERE venue = "jan breydel, bruges, belgium"
sql_create_context
CREATE TABLE table_name_14 ( country VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country is Dyer from?
SELECT country FROM table_name_14 WHERE name = "dyer"
sql_create_context
CREATE TABLE table_name_83 ( third VARCHAR, location VARCHAR, second VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Winterberg, who was 3rd the year that Monique Riekewald was 2nd?
SELECT third FROM table_name_83 WHERE location = "winterberg" AND second = "monique riekewald"
sql_create_context
CREATE TABLE document_sections ( section_id number, document_code text, section_sequence number, section_code text, section_title text ) CREATE TABLE document_structures ( document_structure_code text, parent_document_structure_code text, document_structure_description text ) CREATE TA...
SELECT AVG(access_count) FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varc...
SELECT DISTINCT ground_service.transport_type FROM airport, ground_service WHERE airport.airport_code = 'ONT' AND ground_service.airport_code = airport.airport_code AND ground_service.transport_type = 'TAXI'
atis
CREATE TABLE table_2679061_11 ( nationality VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players were drafted by the Philadelphia Flyers?
SELECT COUNT(nationality) FROM table_2679061_11 WHERE nhl_team = "Philadelphia Flyers"
sql_create_context
CREATE TABLE table_204_971 ( id number, "m" number, "date" text, "tournament" text, "round" text, "ground" text, "opponent" text, "score" text, "attendance" number, "dinamo scorers" text, "report" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT SUM("attendance") FROM table_204_971 WHERE "date" = 2
squall
CREATE TABLE table_name_65 ( site VARCHAR, winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the series that the Kansas City Royals lost?
SELECT site FROM table_name_65 WHERE winning_team = "kansas city royals"
sql_create_context
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(...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_name_9 ( goberman VARCHAR, obrist VARCHAR, merkley VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goberman has an Obrist of 2%, and a Merkley of 34%?
SELECT goberman FROM table_name_9 WHERE obrist = "2%" AND merkley = "34%"
sql_create_context
CREATE TABLE table_name_52 ( series VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the series score on april 17 with minnesota at home?
SELECT series FROM table_name_52 WHERE home = "minnesota" AND date = "april 17"
sql_create_context
CREATE TABLE table_53161 ( "Title" text, "Composer(s)" text, "Guest performer" text, "Producer(s)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title has a length of 4:22?
SELECT "Title" FROM table_53161 WHERE "Time" = '4:22'
wikisql
CREATE TABLE table_57483 ( "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Goals" text, "Attendance" real, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On 21/07/07, what was the score?
SELECT "Score" FROM table_57483 WHERE "Date" = '21/07/07'
wikisql
CREATE TABLE table_22883210_7 ( location_attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location had a record of 20-12, and how many people attended?
SELECT location_attendance FROM table_22883210_7 WHERE record = "20-12"
sql_create_context
CREATE TABLE table_74301 ( "For shank type" text, "Singer part number" text, "Uses templates?" text, "Description" text, "Storage case" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the description of the buttonholer whose singer part number...
SELECT "Description" FROM table_74301 WHERE "Singer part number" = '121795 kit 121908 buttonholer'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Arterial catheterization"
mimicsql_data
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_name_22 ( year INTEGER, opponents_in_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year were the opponents Shingo Kunieda Satoshi Saida?
SELECT MIN(year) FROM table_name_22 WHERE opponents_in_final = "shingo kunieda satoshi saida"
sql_create_context
CREATE TABLE table_name_38 ( capacity INTEGER, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Capacity has a Location of mogilev?
SELECT SUM(capacity) FROM table_name_38 WHERE location = "mogilev"
sql_create_context
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 v...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '003-10080'...
eicu
CREATE TABLE table_1974545_2 ( nickname VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the nickname of Westfield State University's students?
SELECT nickname FROM table_1974545_2 WHERE institution = "Westfield State University"
sql_create_context
CREATE TABLE table_35100 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What incumbent has a re-elected result and first elected larger than 1884?
SELECT "Incumbent" FROM table_35100 WHERE "Result" = 're-elected' AND "First elected" > '1884'
wikisql
CREATE TABLE table_name_25 ( nebraska VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nebraska has 2004 year?
SELECT nebraska FROM table_name_25 WHERE year = "2004"
sql_create_context
CREATE TABLE table_12967 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Dave Rummells's to par?
SELECT "To par" FROM table_12967 WHERE "Player" = 'dave rummells'
wikisql
CREATE TABLE table_name_17 ( player VARCHAR, home_town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player's home town is Swift Current, AB?
SELECT player FROM table_name_17 WHERE home_town = "swift current, ab"
sql_create_context
CREATE TABLE table_43326 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of cuts when there were more than 0 ...
SELECT MIN("Cuts made") FROM table_43326 WHERE "Wins" > '0'
wikisql
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 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 = 'hyperglycemia - suspected' AND STRFTIME('%y', diag...
eicu
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Ot...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC
nvbench
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '68237125' AND qtb.MED_SER_ORG_NO = '2715252' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '68237125' AND gyb.MED_SER_ORG_NO = '2715...
css