instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_4636 ( "Date" text, "Pages" text, "Hero" text, "Story" text, "Story code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the story code of the story published on 2002-12?
SELECT "Story code" FROM table_4636 WHERE "Date" = '2002-12'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT (((SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE Reputation > 10000) / (SELECT CAST(COUNT(*) AS FLOAT) FROM Users)) * 100) AS PercentageOver10k, (((SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE Reputation > 30000) / (SELECT CAST(COUNT(*) AS FLOAT) FROM Users)) * 100) AS PercentageOver20k
sede
CREATE TABLE table_45836 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2007-08 season has marcianise as the city?
SELECT "2007\u201308 season" FROM table_45836 WHERE "City" = 'marcianise'
wikisql
CREATE TABLE table_7405 ( "Position" text, "Name" text, "Birthdate" text, "Birthplace" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Birthdate of raymond bonney?
SELECT "Birthdate" FROM table_7405 WHERE "Name" = 'raymond bonney'
wikisql
CREATE TABLE table_22034853_1 ( language_s_ VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the language for the movie 'Late Bloomers'?
SELECT language_s_ FROM table_22034853_1 WHERE film_title_used_in_nomination = "Late Bloomers"
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE ...
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
scholar
CREATE TABLE table_name_46 ( notes VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Notes of the Frequency with a Format of soft adult contemporary?
SELECT notes FROM table_name_46 WHERE format = "soft adult contemporary"
sql_create_context
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in ...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events
nvbench
CREATE TABLE table_28052 ( "Episode no." real, "Airdate" text, "Dave Viewers" real, "Dave Rank" real, "Rank (cable)" real, "Dave ja vu Viewers" real, "Total viewers" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest cable ran...
SELECT MIN("Rank (cable)") FROM table_28052 WHERE "Total viewers" = '1464000'
wikisql
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 FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '何欣欣' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-124150')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-1 ...
eicu
CREATE TABLE table_11318462_5 ( open_2nd_viii VARCHAR, u15_3rd_iv VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many open 2nd viii had u15 3rd iv being gt
SELECT COUNT(open_2nd_viii) FROM table_11318462_5 WHERE u15_3rd_iv = "GT"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT zyjybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '任凌霜' ...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2060" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
mimicsql_data
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Ascites"
mimicsql_data
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Other Fluid"
mimicsql_data
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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "23733"
mimicsql_data
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6703357' AND t_kc24.t_kc21_MED_ORG_DEPT_CD = '8237') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-09-11' AND '2018-07-25'
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_2679 ( "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. -- What's ...
SELECT "Score" FROM table_2679 WHERE "Record" = '31-29'
wikisql
CREATE TABLE table_27720737_1 ( original_air_date VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date when the u.s. viewers in millions was 5.39?
SELECT original_air_date FROM table_27720737_1 WHERE us_viewers__million_ = "5.39"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 ) ...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'orthostatic hypotension') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year')...
mimic_iii
CREATE TABLE table_name_64 ( played INTEGER, points VARCHAR, position VARCHAR, goals_for VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average number of played with goals of less than 43, more than 9 draws, a higher p...
SELECT AVG(played) FROM table_name_64 WHERE goals_for < 43 AND draws > 9 AND position > 17 AND points = "30-8"
sql_create_context
CREATE TABLE table_name_43 ( record VARCHAR, attendance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has an attendance larger than 28,459?
SELECT record FROM table_name_43 WHERE attendance > 28 OFFSET 459
sql_create_context
CREATE TABLE table_4463 ( "Round" real, "Track" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which track did Takashi Kogure hold pole position?
SELECT "Track" FROM table_4463 WHERE "Pole Position" = 'takashi kogure'
wikisql
CREATE TABLE table_204_360 ( id number, "year" number, "host" text, "gold" text, "silver" text, "bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year did the fiba south america under-17 championship for women first begin ?
SELECT MIN("year") FROM table_204_360
squall
CREATE TABLE table_71859 ( "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. -- What was the score to par for 156 strokes?
SELECT COUNT("To par") FROM table_71859 WHERE "Total" > '156'
wikisql
CREATE TABLE table_name_13 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Week was the Attendance 43,430?
SELECT MAX(week) FROM table_name_13 WHERE attendance = 43 OFFSET 430
sql_create_context
CREATE TABLE table_name_23 ( name VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name, when Location is 'DZ'?
SELECT name FROM table_name_23 WHERE location = "dz"
sql_create_context
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_...
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 27 AND DATE_DAYalias0.month_number = 8 AND DATE_DAYalias0.year = 1991)) AND to...
atis
CREATE TABLE table_60814 ( "Name" text, "Dates active" text, "Windspeeds" text, "Pressure" text, "Deaths" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What pressure is Ken?
SELECT "Pressure" FROM table_60814 WHERE "Name" = 'ken'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentna...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
(SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
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.diagnosis = "GASTROINTESTINAL BLEED" AND procedures.short_title = "Gastroenterostomy NEC"
mimicsql_data
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81223) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_9239 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years with Spurs" text, "School/Previous Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when School/Previous Clu...
SELECT "Position" FROM table_9239 WHERE "School/Previous Club Team/Country" = 'kentucky'
wikisql
CREATE TABLE table_22182 ( "Season" real, "Average Attendance Home" text, "Highest Attendance Home" text, "Average Attendance Away" text, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" text ) -- Using valid SQLite, answer the follow...
SELECT "Division / Section" FROM table_22182 WHERE "Average Attendance Home" = '2.459'
wikisql
CREATE TABLE table_49800 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when Result is 18th?
SELECT "Tournament" FROM table_49800 WHERE "Result" = '18th'
wikisql
CREATE TABLE table_name_7 ( college_junior_club_team VARCHAR, pick VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which College/Junior/Club Team has a Pick larger than 70, and a Round smaller than 7?
SELECT college_junior_club_team FROM table_name_7 WHERE pick > 70 AND round < 7
sql_create_context
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_ca...
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY COUNT(*)
nvbench
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_NM = '尤云梦' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE table_35865 ( "Gauge" text, "Railway" text, "Works no." text, "Year" text, "Builder" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Gauge of Builder Beyer, Peacock?
SELECT "Gauge" FROM table_35865 WHERE "Builder" = 'beyer, peacock'
wikisql
CREATE TABLE table_name_79 ( latitude VARCHAR, year_named VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Latitude has a Year named smaller than 1997, and a Name of aino planitia?
SELECT latitude FROM table_name_79 WHERE year_named < 1997 AND name = "aino planitia"
sql_create_context
CREATE TABLE diagnoses ( 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 demographic (...
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.icd9_code = "80624" AND prescriptions.route = "INHALATION"
mimicsql_data
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 WHERE t_kc21.PERSON_NM = '奚子默' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-09-21' AND '2009-02-26' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_8 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has the record of 11-6?
SELECT loss FROM table_name_8 WHERE record = "11-6"
sql_create_context
CREATE TABLE table_25213146_2 ( circuit VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what circuit was Bruno Spengler the winning driver?
SELECT circuit FROM table_25213146_2 WHERE winning_driver = "Bruno Spengler"
sql_create_context
CREATE TABLE table_name_50 ( year INTEGER, genre VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is total number of years that has genre of first-person shooter?
SELECT SUM(year) FROM table_name_50 WHERE genre = "first-person shooter"
sql_create_context
CREATE TABLE table_name_3 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away side's score when richmond is at home?
SELECT away_team AS score FROM table_name_3 WHERE home_team = "richmond"
sql_create_context
CREATE TABLE table_76260 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest week that was played against the Minnesota Vikings?
SELECT MAX("Week") FROM table_76260 WHERE "Opponent" = 'minnesota vikings'
wikisql
CREATE TABLE table_name_25 ( constructor VARCHAR, driver VARCHAR, rounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the constructor of the car that Jan Lammers made 7-14 rounds in?
SELECT constructor FROM table_name_25 WHERE driver = "jan lammers" AND rounds = "7-14"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subje...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MODGREEK' AND number = 101
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cultures - urine' AND STRFTIME('%y', treatment.treatmenttime) >= '2102') AS t1 JOIN (SELECT patient.uniquepi...
eicu
CREATE TABLE table_10418 ( "7:00 PM" text, "8:00 PM" text, "8:30 PM" text, "9:00 PM" text, "9:30 PM" text, "10:00 PM" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for 9:00 PM when the 9:30 PM shows as specials?
SELECT "9:00 PM" FROM table_10418 WHERE "9:30 PM" = 'specials'
wikisql
CREATE TABLE table_177766_1 ( per­cent­age VARCHAR, abbre­viation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of this constellation abbreviated as 'nor'?
SELECT per­cent­age FROM table_177766_1 WHERE abbre­viation = "Nor"
sql_create_context
CREATE TABLE table_28014096_1 ( no_in_season INTEGER, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of this season's episode that had the production code 2t6206?
SELECT MIN(no_in_season) FROM table_28014096_1 WHERE production_code = "2T6206"
sql_create_context
CREATE TABLE department ( dept_code VARCHAR, dept_name VARCHAR ) CREATE TABLE CLASS ( prof_num VARCHAR ) CREATE TABLE professor ( prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR ) CREATE TABLE employee ( emp_fname VARCHAR, emp_num VARCHAR ) -- Using valid SQLite, answer...
SELECT DISTINCT T2.emp_fname, T3.prof_high_degree FROM CLASS AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN professor AS T3 ON T2.emp_num = T3.emp_num JOIN department AS T4 ON T4.dept_code = T3.dept_code WHERE T4.dept_name = 'Computer Info. Systems'
sql_create_context
CREATE TABLE table_36445 ( "Year" text, "Flagship Station" text, "Play-by-play" text, "Color commentator(s)" text, "Studio host" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the studio host for glenn ordway and jerry sichting with year of 199...
SELECT "Studio host" FROM table_36445 WHERE "Play-by-play" = 'glenn ordway' AND "Color commentator(s)" = 'jerry sichting' AND "Year" = '1993-94'
wikisql
CREATE TABLE table_23211041_5 ( high_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most points in game 4?
SELECT high_points FROM table_23211041_5 WHERE game = 4
sql_create_context
CREATE TABLE table_name_36 ( team VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team when the time is 1:11.19.89?
SELECT team FROM table_name_36 WHERE time = "1:11.19.89"
sql_create_context
CREATE TABLE table_15887683_8 ( n° VARCHAR, television_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number for fox news channel
SELECT n° FROM table_15887683_8 WHERE television_service = "Fox News Channel"
sql_create_context
CREATE TABLE table_name_79 ( land___sqmi__ INTEGER, water__sqmi_ VARCHAR, longitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Land (sqmi) has a Water (sqmi) smaller than 0.04, and a Longitude of -96.794706?
SELECT MIN(land___sqmi__) FROM table_name_79 WHERE water__sqmi_ < 0.04 AND longitude = -96.794706
sql_create_context
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, Official_native_language text ) CREATE TABLE match_season ( Season re...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY Position DESC
nvbench
CREATE TABLE table_name_6 ( player VARCHAR, round VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has a round larger than 1 in Austria?
SELECT player FROM table_name_6 WHERE round > 1 AND nationality = "austria"
sql_create_context
CREATE TABLE team ( Team_id VARCHAR, Name VARCHAR ) CREATE TABLE match_season ( Position VARCHAR, Team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the positions of the players from the team with name 'Ryley Goldner'.
SELECT T1.Position FROM match_season AS T1 JOIN team AS T2 ON T1.Team = T2.Team_id WHERE T2.Name = "Ryley Goldner"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, ...
SELECT DISTINCT fare_id FROM fare WHERE (fare_id IN (SELECT FLIGHT_FAREalias1.fare_id FROM flight_fare AS FLIGHT_FAREalias1 WHERE FLIGHT_FAREalias1.flight_id IN (SELECT FLIGHTalias1.flight_id FROM flight AS FLIGHTalias1 WHERE (FLIGHTalias1.from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service ...
atis
CREATE TABLE table_266 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the largest purse?
SELECT MAX("Purse( $ )") FROM table_266
wikisql
CREATE TABLE table_69346 ( "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 was the date of the game that had a loss of Risley (0-1)?
SELECT "Date" FROM table_69346 WHERE "Loss" = 'risley (0-1)'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, depart...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 27 AND date_day.month_number = 8 A...
atis
CREATE TABLE table_name_94 ( outcome VARCHAR, partner VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Outcome, when Partner is 'Byron Black', and when Opponents is 'Goran Ivani evi Brian Macphie'?
SELECT outcome FROM table_name_94 WHERE partner = "byron black" AND opponents = "goran ivanišević brian macphie"
sql_create_context
CREATE TABLE table_25037577_1 ( superintendent VARCHAR, year VARCHAR, middle_school_principal VARCHAR, gorham_principal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the superintendent(s) when the middle school principal was alan degroote, ...
SELECT superintendent FROM table_25037577_1 WHERE middle_school_principal = "Alan Degroote" AND gorham_principal = "Paul Lahue" AND year = "2006-2007"
sql_create_context
CREATE TABLE table_16367 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the production codes ...
SELECT "Production code" FROM table_16367 WHERE "Title" = 'All About Brooke'
wikisql
CREATE TABLE table_name_74 ( second_vice_president VARCHAR, third_vice_president VARCHAR, inaugurated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Second Vice President, when Third Vice President is 'Gen. Juan Alonso', and when Inaugurated is '...
SELECT second_vice_president FROM table_name_74 WHERE third_vice_president = "gen. juan alonso" AND inaugurated = "15 march 1940"
sql_create_context
CREATE TABLE table_78079 ( "Airing date" text, "Number of episodes" real, "HD format" text, "Highest average point ratings" real, "Genre" text, "Official website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the airing date when the n...
SELECT "Airing date" FROM table_78079 WHERE "Number of episodes" > '20' AND "Genre" = 'costume action'
wikisql
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC
nvbench
CREATE TABLE table_52448 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total Attendance for Games while Chicago was the visi...
SELECT SUM("Attendance") FROM table_52448 WHERE "Visitor" = 'chicago'
wikisql
CREATE TABLE table_204_422 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at the women 's 200 meter individual medley sm10 event at the 2012 sum...
SELECT COUNT("name") FROM table_204_422
squall
CREATE TABLE table_35451 ( "Season" real, "Game" text, "Record" text, "Opponent" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game has a Result of win, and an Opponent of new hampshire, and a Season smaller t...
SELECT "Game" FROM table_35451 WHERE "Result" = 'win' AND "Opponent" = 'new hampshire' AND "Season" < '2008'
wikisql
CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE authors ( authid number, lname text, fname text ) -...
SELECT title FROM papers WHERE title LIKE "%Database%"
spider
CREATE TABLE table_2190919_1 ( team_s_ VARCHAR, avg_finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the racing teams for which the average finish is 23.3?
SELECT team_s_ FROM table_2190919_1 WHERE avg_finish = "23.3"
sql_create_context
CREATE TABLE table_42847 ( "Year" real, "Chassis" text, "Engine" text, "Start" real, "Finish" real, "Entrant" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average finish that has 24 as the start, with a year after 1987?
SELECT AVG("Finish") FROM table_42847 WHERE "Start" = '24' AND "Year" > '1987'
wikisql
CREATE TABLE table_16022 ( "Episode #" real, "Production code" real, "Title" text, "Directed by" text, "Written by" text, "Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who directed the movie written by is sib ventress / aydrea ten bos...
SELECT "Directed by" FROM table_16022 WHERE "Written by" = 'Sib Ventress / Aydrea ten Bosch'
wikisql
CREATE TABLE table_77330 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TOTAL, OF A TO PAR FOR HUBERT GREEN, AND A TOTAL LARGER THAN 291?
SELECT COUNT("To par") FROM table_77330 WHERE "Player" = 'hubert green' AND "Total" > '291'
wikisql
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_Neutral, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id num...
SELECT (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 = 28443) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE table_name_21 ( stadium VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium had the score 1 - 1 dodd 38'?
SELECT stadium FROM table_name_21 WHERE score = "1 - 1 dodd 38'"
sql_create_context
CREATE TABLE table_name_84 ( country VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the country for ICAO of tjig
SELECT country FROM table_name_84 WHERE icao = "tjig"
sql_create_context
CREATE TABLE table_23506 ( "Year" real, "Date" text, "Type" text, "Species" text, "Author Species" text, "Value" text, "Scott" text, "Yvert" real, "Mitchell" real, "Sta. & Gib." real, "Order" text, "Family" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Date" FROM table_23506 WHERE "Value" = '55c'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND a...
mimic_iii
CREATE TABLE table_61215 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what series was in sydney, new south wales?
SELECT "Series" FROM table_61215 WHERE "City / State" = 'sydney, new south wales'
wikisql
CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, baseprice number, decor text ) CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults...
SELECT kids FROM reservations WHERE checkin = "2010-09-21" AND firstname = "DAMIEN" AND lastname = "TRACHSEL"
spider
CREATE TABLE table_37283 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draws were there when there were point...
SELECT COUNT("Drawn") FROM table_37283 WHERE "Points" < '23' AND "Lost" = '6' AND "Against" > '21'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
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 = 'MINNEAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PI...
atis
CREATE TABLE inventory ( inventory_id number, film_id number, store_id number, last_update time ) CREATE TABLE actor ( actor_id number, first_name text, last_name text, last_update time ) CREATE TABLE store ( store_id number, manager_staff_id number, address_id number, ...
SELECT COUNT(*) FROM customer WHERE active = '1'
spider
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number,...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'adefovir dipivoxil' AND DATETIME(prescriptions.startdate) >= DATE...
mimic_iii
CREATE TABLE table_name_16 ( tries_for VARCHAR, try_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of tries for when the try bonus is 0?
SELECT tries_for FROM table_name_16 WHERE try_bonus = "0"
sql_create_context
CREATE TABLE table_8436 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is Nick Price from?
SELECT "Country" FROM table_8436 WHERE "Player" = 'nick price'
wikisql
CREATE TABLE table_name_74 ( casualties VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the casualities for kabul area
SELECT casualties FROM table_name_74 WHERE location = "kabul area"
sql_create_context
CREATE TABLE table_name_41 ( qual_1 VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the qual 1 for conquest racing?
SELECT qual_1 FROM table_name_41 WHERE team = "conquest racing"
sql_create_context