instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE team ( team_id number, name text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_number number, draft_class text, college text ) CREATE TABLE player ( player_id number, player text, years_...
SELECT COUNT(DISTINCT team) FROM match_season
spider
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 WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.dob_year < "1850"
mimicsql_data
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) ...
advising
CREATE TABLE table_name_25 ( bronze VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the bronze when silver is 1
SELECT bronze FROM table_name_25 WHERE silver = 1
sql_create_context
CREATE TABLE table_name_92 ( date VARCHAR, opponent VARCHAR, week VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game in a week earlier than 10 played in Texas stadium agains the Atlanta Falcons?
SELECT date FROM table_name_92 WHERE week < 10 AND game_site = "texas stadium" AND opponent = "atlanta falcons"
sql_create_context
CREATE TABLE table_22288 ( "Departure" text, "Going to" text, "Calling at" text, "Arrival" text, "Operator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the train operator when the train departed at 11.02 in 1922?
SELECT "Operator" FROM table_22288 WHERE "Departure" = '11.02'
wikisql
CREATE TABLE table_2147588_4 ( vacator VARCHAR, successor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When nathaniel g. taylor (u) is the successor what is the vacator?
SELECT vacator FROM table_2147588_4 WHERE successor = "Nathaniel G. Taylor (U)"
sql_create_context
CREATE TABLE table_2013 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the frequency 92.3mhz?
SELECT "Location" FROM table_2013 WHERE "Frequency" = '92.3MHz'
wikisql
CREATE TABLE table_name_63 ( surface VARCHAR, championship VARCHAR, outcome VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What surface has indian wells as the championship, with winner as the outcome?
SELECT surface FROM table_name_63 WHERE championship = "indian wells" AND outcome = "winner"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT Users.Id, COUNT(Posts.Id) FROM Users LEFT JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE Posts.DeletionDate IS NULL AND PostTypeId = 1 GROUP BY Users.Id
sede
CREATE TABLE table_1401 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At which stadiums was attendance total 79176?
SELECT "Game Site" FROM table_1401 WHERE "Attendance" = '79176'
wikisql
CREATE TABLE table_dev_47 ( "id" int, "gender" string, "gestational_diabetes" bool, "systolic_blood_pressure_sbp" int, "leukopenia" int, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "diabetic" string, "elevated_blood_pressure" bool, "diastolic_blood_pressur...
SELECT * FROM table_dev_47 WHERE elevated_blood_pressure = 1 OR (systolic_blood_pressure_sbp > 130 OR diastolic_blood_pressure_dbp > 85)
criteria2sql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE comment_instructor ( instructor_id int...
SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali...
advising
CREATE TABLE table_26181 ( "Neighbourhood" text, "% 0-19" text, "% 20-39" text, "% 40-59" text, "% 60-74" text, "% 75 +" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for % 40-59 if % 60-74 is 12,40%?
SELECT "% 40-59" FROM table_26181 WHERE "% 60-74" = '12,40%'
wikisql
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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price
nvbench
CREATE TABLE table_35320 ( "Season" real, "Overall" real, "Slalom" text, "Giant Slalom" real, "Super G" text, "Downhill" text, "Combined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for Slalom in seasons later than 1994 ...
SELECT "Slalom" FROM table_35320 WHERE "Season" > '1994' AND "Overall" > '22'
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 SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_SEX = '张昊焱'
css
CREATE TABLE table_11803648_21 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does Cody Ceci play?
SELECT position FROM table_11803648_21 WHERE player = "Cody Ceci"
sql_create_context
CREATE TABLE table_name_55 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was home at Princes Park?
SELECT home_team AS score FROM table_name_55 WHERE venue = "princes park"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
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 = 'bmi 33.0-33.9,adult'))
mimic_iii
CREATE TABLE table_name_38 ( to_par VARCHAR, country VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the player from the United States with a t5 place?
SELECT to_par FROM table_name_38 WHERE country = "united states" AND place = "t5"
sql_create_context
CREATE TABLE table_18602462_22 ( round_of_16 VARCHAR, semifinals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The semifinal score of vergeer ( ned ) l 0-6, 1-6 follows a round of 16 result of what?
SELECT round_of_16 FROM table_18602462_22 WHERE semifinals = "Vergeer ( NED ) L 0-6, 1-6"
sql_create_context
CREATE TABLE table_47260 ( "Country" text, "Skip" text, "Ends Won" real, "Ends Lost" real, "Blank Ends F/A" text, "Stolen Ends For" real, "Stolen Ends Against" real, "Shot %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low...
SELECT MIN("Ends Lost") FROM table_47260 WHERE "Stolen Ends For" < '13' AND "Stolen Ends Against" = '6'
wikisql
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 person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_29464 ( "#" real, "Episode" text, "Air Date" text, "Rating" text, "Share" text, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Weekly Rank (#)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when air date is october...
SELECT "18-49 (Rating/Share)" FROM table_29464 WHERE "Air Date" = 'October 14, 2010'
wikisql
CREATE TABLE table_11820086_1 ( directed_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode that was viewed by 2.57 million people in the U.S.?
SELECT directed_by FROM table_11820086_1 WHERE us_viewers__millions_ = "2.57"
sql_create_context
CREATE TABLE table_name_6 ( bronze VARCHAR, silver VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Bronze, when Silver is less than 89, and when Total is '4'?
SELECT bronze FROM table_name_6 WHERE silver < 89 AND total = 4
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Id AS "post_link", LENGTH(Title), * FROM Posts WHERE PostTypeId = 1 AND LENGTH(Title) < 15
sede
CREATE TABLE table_203_215 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did ito take 1st in the 10,000 m before or after he took 28th in t...
SELECT (SELECT "year" FROM table_203_215 WHERE "position" = 1 AND "event" = '10,000m') < (SELECT "year" FROM table_203_215 WHERE "position" = 28 AND "event" = '10,000m')
squall
CREATE TABLE table_name_14 ( money___ VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money has a to par of E?
SELECT COUNT(money___) AS $__ FROM table_name_14 WHERE to_par = "e"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicatio...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t1...
eicu
CREATE TABLE table_204_364 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many 800m events ?
SELECT COUNT("event") FROM table_204_364 WHERE "event" = 800
squall
CREATE TABLE table_name_39 ( end_term INTEGER, start_term VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest End term with a Start term of 1913, and a Name of ludwig iii?
SELECT MIN(end_term) FROM table_name_39 WHERE start_term = 1913 AND name = "ludwig iii"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4523" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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....
css
CREATE TABLE table_45394 ( "Rank" text, "Name" text, "Height (m)" real, "Height (ft)" real, "Floors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Height of the Canterbury House with 12 Floors and a Rank of 75=?
SELECT AVG("Height (ft)") FROM table_45394 WHERE "Floors" = '12' AND "Rank" = '75=' AND "Name" = 'canterbury house'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id...
WITH Dates AS (SELECT a.Id, q.CreationDate AS QDate, a.CreationDate AS ADate FROM Posts AS q, Posts AS a WHERE q.Id = a.ParentId AND q.PostTypeId = 1 AND a.PostTypeId = 2 AND a.OwnerUserId = '##UserId##'), Delays AS (SELECT Id, CAST((JULIANDAY(ADate) - JULIANDAY(QDate)) * 1440.0 AS INT) AS Delay FROM Dates) SELECT SUM(...
sede
CREATE TABLE table_5182 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Location of brendan byrne arena had what score?
SELECT "Score" FROM table_5182 WHERE "Location" = 'brendan byrne arena'
wikisql
CREATE TABLE table_67516 ( "Venue" text, "City" text, "State" text, "Tickets Sold / Available" text, "Gross Revenue (1982)" text, "Gross Revenue (2011)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city had a gross revenue in 2011 of $73...
SELECT "City" FROM table_67516 WHERE "Gross Revenue (2011)" = '$739,578'
wikisql
CREATE TABLE table_67054 ( "BR No." real, "Name" text, "Builder" text, "Whenbuilt" text, "Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was moray firth built?
SELECT "Whenbuilt" FROM table_67054 WHERE "Name" = 'moray firth'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '0169842' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-12-21' AND '2004-06-02' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 7232.0 UNION SELECT fgwyjzb....
css
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 DEPT_ADDRESS, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 3
nvbench
CREATE TABLE table_name_10 ( cpu_chip VARCHAR, model VARCHAR, modem VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the CPU chip in the Dishplayer 7100, which is a dish tuner with a v.90 modem?
SELECT cpu_chip FROM table_name_10 WHERE modem = "v.90" AND type = "dish tuner" AND model = "dishplayer 7100"
sql_create_context
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, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
SELECT * 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 hz_info.YLJGDM = '6222694' AND NOT zyjzjlb.CYKSMC LIKE '%整形外科%'
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.label = "Homocysteine"
mimicsql_data
CREATE TABLE table_17482534_1 ( no_in_series VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number in the series are the episodes with production code 5016/5017?
SELECT no_in_series FROM table_17482534_1 WHERE production_code = "5016/5017"
sql_create_context
CREATE TABLE endowment ( endowment_id int, School_id int, donator_name text, amount real ) CREATE TABLE School ( School_id text, School_name text, Location text, Mascot text, Enrollment int, IHSAA_Class text, IHSAA_Football_Class text, County text ) CREATE TABLE budget ...
SELECT County, SUM(Enrollment) FROM School GROUP BY County
nvbench
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_204_982 ( id number, "party/electoral alliance" text, "seats" number, "change" number, "votes" number, "%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- total number of parties who lost seats in the argentine chamber of deput...
SELECT COUNT("party/electoral alliance") FROM table_204_982 WHERE "change" < 0
squall
CREATE TABLE table_69586 ( "Birth" text, "Marriage" text, "Became Consort" text, "Ceased to be Consort" text, "Death" text, "Spouse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the marriage of the person who is married for christian viii...
SELECT "Marriage" FROM table_69586 WHERE "Spouse" = 'christian viii'
wikisql
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Courses ( course_id INTEGER, author_...
SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
nvbench
CREATE TABLE table_train_84 ( "id" int, "gender" string, "mini_mental_state_examination_mmse" int, "modified_hachinski_ischemia_scale" int, "post_menopausal" bool, "allergy_to_rifaximin" bool, "surgically_sterilized" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )...
SELECT * FROM table_train_84 WHERE age >= 55 AND age <= 85
criteria2sql
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_type = "EMERGENCY" AND procedures.icd9_code = "9955"
mimicsql_data
CREATE TABLE table_name_68 ( length VARCHAR, version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the length of the UK remix version?
SELECT length FROM table_name_68 WHERE version = "uk remix"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time ...
mimicsql_data
CREATE TABLE table_name_1 ( location VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Location, when Circuit is August 16?
SELECT location FROM table_name_1 WHERE circuit = "august 16"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66713')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
SELECT COUNT(*) FROM fires WHERE county = "Gloucester" AND fire_size > 10
uswildfires
CREATE TABLE artwork ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many artworks are there?
SELECT COUNT(*) FROM artwork
sql_create_context
CREATE TABLE table_4106 ( "Player" text, "County" text, "Matches" real, "Innings" real, "Runs" real, "Average" text, "Highest Score" text, "100s" real, "50s" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average for the ...
SELECT "Average" FROM table_4106 WHERE "County" = 'Lancashire' AND "100s" = '1'
wikisql
CREATE TABLE table_name_75 ( shooter VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which shooter was the olympic bronze medalist?
SELECT shooter FROM table_name_75 WHERE total = "olympic bronze medalist"
sql_create_context
CREATE TABLE table_64779 ( "Channel" real, "Video" text, "Aspect" text, "PSIP Short Name" text, "Network" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which video has a 16:9 aspect?
SELECT "Video" FROM table_64779 WHERE "Aspect" = '16:9'
wikisql
CREATE TABLE table_22163 ( "Title" text, "Developer" text, "Category" text, "Function" text, "Release date" text, "Version" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the function of 1.4 version of Windows live messenger?
SELECT "Function" FROM table_22163 WHERE "Version" = '1.4' AND "Title" = 'Windows Live Messenger'
wikisql
CREATE TABLE table_60897 ( "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 is To par, when Total is less than 148, and when Country is 'South Africa'?
SELECT "To par" FROM table_60897 WHERE "Total" < '148' AND "Country" = 'south africa'
wikisql
CREATE TABLE table_name_35 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game played on May 9, 2012?
SELECT result FROM table_name_35 WHERE date = "may 9, 2012"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
WITH awarded AS (SELECT COUNT(*) AS num, Name, Class FROM Badges GROUP BY Name, Class HAVING COUNT(*) = 1) SELECT b.Name, b.Class, u.DisplayName FROM Badges AS b JOIN awarded AS a ON a.Name = b.Name AND a.Class = b.Class JOIN Users AS u ON u.Id = b.UserId
sede
CREATE TABLE table_5658 ( "Club" text, "Position in 2012\u201313" text, "First season in top division" text, "Number of seasons in top division" real, "Number of seasons in Prva HNL" real, "First season of current spell in top division" text, "Top division titles" text, "Last top divisio...
SELECT AVG("Number of seasons in top division") FROM table_5658 WHERE "Number of seasons in Prva HNL" = '17'
wikisql
CREATE TABLE table_1930 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When santiago del estero is the hometown who is the contestant?
SELECT "Contestant" FROM table_1930 WHERE "Hometown" = 'Santiago del Estero'
wikisql
CREATE TABLE table_26005 ( "Round" real, "Finishing Date" text, "Rally Name" text, "Rally Base" text, "Surface" text, "Support Category" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the rally base for rallye de france alsace
SELECT "Rally Base" FROM table_26005 WHERE "Rally Name" = 'Rallye de France Alsace'
wikisql
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_i...
SELECT T1.famous_title FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T2.weeks_on_top > 2 INTERSECT SELECT T1.famous_title FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T2.weeks_on_top < 2
spider
CREATE TABLE table_52527 ( "Munsee Delaware" text, "Unami Delaware" text, "De Laet (1633)" text, "Campanius (ca. 1645)" text, "Interpreter (1684?)" text, "Thomas (1698)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Campanius term f...
SELECT "Campanius (ca. 1645)" FROM table_52527 WHERE "Unami Delaware" = 'palé·naxk'
wikisql
CREATE TABLE table_name_59 ( country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the Player with a To par of +1?
SELECT country FROM table_name_59 WHERE to_par = "+1"
sql_create_context
CREATE TABLE table_62467 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sokn)" text, "Church Name" text, "Year Built" text, "Location of the Church" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Sub-Parish (Sokn) that was built in 1957 in ...
SELECT "Sub-Parish (Sokn)" FROM table_62467 WHERE "Year Built" = '1957' AND "Location of the Church" = 'stavang'
wikisql
CREATE TABLE table_name_28 ( team VARCHAR, car_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team operates car 11?
SELECT team FROM table_name_28 WHERE car_no = "11"
sql_create_context
CREATE TABLE table_68244 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which of the opponents has a record of 17-25?
SELECT "Opponent" FROM table_68244 WHERE "Record" = '17-25'
wikisql
CREATE TABLE table_33417 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player was drafted higher than 374 and went to the school Stephen F. Austin?
SELECT "Player" FROM table_33417 WHERE "Overall" < '374' AND "School/Club Team" = 'stephen f. austin'
wikisql
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 T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_48263 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is State, when From is '830 BC'?
SELECT "State" FROM table_48263 WHERE "From" = '830 bc'
wikisql
CREATE TABLE table_29647 ( "Member" text, "Electorate" text, "Province" text, "MPs term" text, "Election date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the province if the electorate was Collingwood?
SELECT "Province" FROM table_29647 WHERE "Electorate" = 'Collingwood'
wikisql
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters
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 gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_NM = '奚秀英' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-06-16' AND '2015-04-16' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '奚秀英' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-06-1...
css
CREATE TABLE table_41823 ( "Week" real, "Date" text, "Time (CST)" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "NFL Recap" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time (cst) has and NFL recap of reca...
SELECT "Time (CST)" FROM table_41823 WHERE "NFL Recap" = 'recap' AND "Date" = 'october 19, 2008'
wikisql
CREATE TABLE table_74411 ( "Rd." text, "Race" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the fastest lap(s) when stefan w...
SELECT "Fastest lap" FROM table_74411 WHERE "Pole position" = 'Stefan Wilson'
wikisql
CREATE TABLE table_20351295_2 ( high_checkout VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Trina Gulliver's high checkout?
SELECT high_checkout FROM table_20351295_2 WHERE player = "Trina Gulliver"
sql_create_context
CREATE TABLE table_name_39 ( score VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Place is 'T9', and when Player is 'Jeff Sluman'?
SELECT score FROM table_name_39 WHERE place = "t9" AND player = "jeff sluman"
sql_create_context
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT zzmzjzjlb.YLJGDM 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 = '陶国兴' UNION SELECT fzzmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN fzzmzjzjlb ON person_...
css
CREATE TABLE table_17319931_1 ( car_no VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many car numbers were recorded when the time/retired is +4.0019?
SELECT COUNT(car_no) FROM table_17319931_1 WHERE time_retired = "+4.0019"
sql_create_context
CREATE TABLE table_7808 ( "State" text, "Preliminary Average" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Semifinal Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the swimsuit score when the semifinal average ...
SELECT "Swimsuit" FROM table_7808 WHERE "Semifinal Average" = '8.367 (10)'
wikisql
CREATE TABLE table_19487922_2 ( current_march_20 VARCHAR, _2010 VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many current drivers, as of March 20, 2010 does Denmark have?
SELECT current_march_20, _2010 FROM table_19487922_2 WHERE country = "Denmark"
sql_create_context
CREATE TABLE table_name_89 ( marks VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many marks did he get in 2005?
SELECT marks FROM table_name_89 WHERE season = "2005"
sql_create_context
CREATE TABLE table_18600760_20 ( longitude VARCHAR, township VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What longitude is tatman township?
SELECT longitude FROM table_18600760_20 WHERE township = "Tatman"
sql_create_context
CREATE TABLE table_67953 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Adelaide for Sydney of yes and Perth of yes
SELECT "Adelaide" FROM table_67953 WHERE "Sydney" = 'yes' AND "Perth" = 'yes'
wikisql
CREATE TABLE table_34345 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2nd (m) value for Gregor Schlierenz...
SELECT MIN("2nd (m)") FROM table_34345 WHERE "Name" = 'gregor schlierenzauer'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14836 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'urine' ORDER BY microbiology...
mimic_iii
CREATE TABLE table_46862 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which state did Marquis Li rule?
SELECT "State" FROM table_46862 WHERE "Name" = 'li' AND "Title" = 'marquis'
wikisql
CREATE TABLE table_64816 ( "Ref#" real, "Name" text, "Built" real, "Location" text, "Construction" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the mill located on Anawan Street with a reference number larger than 8?
SELECT "Name" FROM table_64816 WHERE "Ref#" > '8' AND "Location" = 'anawan street'
wikisql
CREATE TABLE table_60502 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of the player from the United States with a t1 place?
SELECT "To par" FROM table_60502 WHERE "Country" = 'united states' AND "Place" = 't1'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
(SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '94379213' AND NOT jybgb.BGDH IN (SELECT BGDH FROM jyjgzbb WHERE JCZ...
css
CREATE TABLE user_profiles ( uid number, name text, email text, partitionid number, followers number ) CREATE TABLE tweets ( id number, uid number, text text, createdate time ) CREATE TABLE follows ( f1 number, f2 number ) -- Using valid SQLite, answer the following quest...
SELECT T1.name, T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT(*) < 2
spider
CREATE TABLE table_203_416 ( id number, "school name" text, "city" text, "grades" text, "establishment" number, "charter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many schools are only charter ?
SELECT COUNT("school name") FROM table_203_416 WHERE "charter" = 'charter'
squall