instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_15 ( country VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does Glory Alozie play for?
SELECT country FROM table_name_15 WHERE name = "glory alozie"
sql_create_context
CREATE TABLE table_10360823_1 ( player_name VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player was chosen in round 17?
SELECT player_name FROM table_10360823_1 WHERE round = 17
sql_create_context
CREATE TABLE table_19295 ( "Series #" real, "Title" text, "Story by" text, "Teleplay by" text, "Directed by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of series #1?
SELECT "Title" FROM table_19295 WHERE "Series #" = '1'
wikisql
CREATE TABLE table_name_20 ( opponent VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the competition held at Jeonju?
SELECT opponent FROM table_name_20 WHERE venue = "jeonju"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "89" AND lab.itemid = "50889"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
eicu
CREATE TABLE table_name_5 ( years VARCHAR, jersey_number_s_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did the player with the jersey number bigger than 20 play?
SELECT years FROM table_name_5 WHERE jersey_number_s_ > 20
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d...
atis
CREATE TABLE Bookings_Services ( Order_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR(255) ) CRE...
SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings ORDER BY Actual_Delivery_Date DESC
nvbench
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Mechanical Behavior of Materials%' OR course.description LIKE '%Mechanical Behavior of Materials...
advising
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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '43929858' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLIN...
css
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 area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_37876 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest in March when the record of 35 16 6 3?
SELECT MAX("March") FROM table_37876 WHERE "Record" = '35–16–6–3'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_name_15 ( grid INTEGER, driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest grid with a Driver of ralph firman, and a Lap smaller than 18?
SELECT MAX(grid) FROM table_name_15 WHERE driver = "ralph firman" AND laps < 18
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Acetaminophen"
mimicsql_data
CREATE TABLE table_73853 ( "Season" real, "Series" text, "Team" text, "Car No." real, "Races" real, "Poles" real, "Wins" real, "FLaps" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points...
SELECT "Points" FROM table_73853 WHERE "Car No." = '4'
wikisql
CREATE TABLE table_name_96 ( centerfold_model VARCHAR, interview_subject VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the Centerfold model in the issue in which the Interview subject was Jos Napole n Duarte?
SELECT centerfold_model FROM table_name_96 WHERE interview_subject = "josé napoleón duarte"
sql_create_context
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text...
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY Country DESC
nvbench
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 d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116)) AND DATETIME(inputevents_cv.c...
mimic_iii
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer treatment - ranitidine' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 y...
eicu
CREATE TABLE table_name_70 ( format VARCHAR, country VARCHAR, catalogue__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the format of catalog number 886973273913 (gowow012) in the United Kingdom?
SELECT format FROM table_name_70 WHERE country = "united kingdom" AND catalogue__number = "886973273913 (gowow012)"
sql_create_context
CREATE TABLE table_13989 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Alan Campbell's Country with Notes of FA?
SELECT "Country" FROM table_13989 WHERE "Notes" = 'fa' AND "Athlete" = 'alan campbell'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '69185287770' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 17
css
CREATE TABLE table_9137 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the away team Bristol Rovers play?
SELECT "Date" FROM table_9137 WHERE "Away team" = 'bristol rovers'
wikisql
CREATE TABLE table_57835 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player with a round after 4 and plays righ...
SELECT "Nationality" FROM table_57835 WHERE "Round" > '4' AND "Position" = 'right wing'
wikisql
CREATE TABLE table_14563 ( "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 Date has an Attendance of 30,612?
SELECT "Date" FROM table_14563 WHERE "Attendance" = '30,612'
wikisql
CREATE TABLE table_26429658_1 ( written_by VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes were directed by Arlene Sanford?
SELECT COUNT(written_by) FROM table_26429658_1 WHERE directed_by = "Arlene Sanford"
sql_create_context
CREATE TABLE table_name_24 ( year INTEGER, bsu_head_coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the years with bus conner as the BSU head coach?
SELECT SUM(year) FROM table_name_24 WHERE bsu_head_coach = "bus conner"
sql_create_context
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID ...
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
nvbench
CREATE TABLE table_3066 ( "Round" real, "Date" text, "Country" text, "Circuit" text, "Sprint Winner" text, "Main Winner" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for sprint winner mexico
SELECT "Date" FROM table_3066 WHERE "Sprint Winner" = 'Mexico'
wikisql
CREATE TABLE table_203_755 ( id number, "singing position" number, "song title" text, "informal translation" text, "act" text, "percentage of votes" text, "final position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total numb...
SELECT COUNT("song title") FROM table_203_755
squall
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.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '54831539211' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '54831539211'
css
CREATE TABLE table_name_17 ( company_or_product_name VARCHAR, episode VARCHAR, money_requested__£_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Company or Product name requested 70,000 on Episode 11?
SELECT company_or_product_name FROM table_name_17 WHERE episode = "episode 11" AND money_requested__£_ = "70,000"
sql_create_context
CREATE TABLE table_name_72 ( withdrawn VARCHAR, gsr_class VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is withdrawn with a GSR Class of 296?
SELECT withdrawn FROM table_name_72 WHERE gsr_class = "296"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "2560"
mimicsql_data
CREATE TABLE table_204_986 ( id number, "#" number, "event year" number, "season" text, "flag bearer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the first flag bearer ?
SELECT "flag bearer" FROM table_204_986 ORDER BY "event year" LIMIT 1
squall
CREATE TABLE table_21901 ( "Year(s)" real, "Final television commentator" text, "Radio commentator" text, "Spokesperson" text, "Semi-final television commentator" text, "Semi-final second television commentator" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT MAX("Year(s)") FROM table_21901 WHERE "Spokesperson" = 'Colin Berry'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score > 0 AND ViewCount >= 1000 AND PostTypeId = 1 ORDER BY Score * 1000 / ViewCount DESC LIMIT 1000
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND diagnosis.diagnosisname = 'depression' AND DATET...
eicu
CREATE TABLE table_1547951_3 ( year VARCHAR, outcome VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of years where runner-up and championship is us open
SELECT COUNT(year) FROM table_1547951_3 WHERE outcome = "Runner-up" AND championship = "US Open"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '水光耀' AND mzjzjlb.JZKSRQ BETWEEN '2005-01-09' AND '2013-08-02') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AN...
css
CREATE TABLE table_63765 ( "play" text, "author" text, "company" text, "base" text, "country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the company from Greece with author Aeschylus?
SELECT "company" FROM table_63765 WHERE "country" = 'greece' AND "author" = 'aeschylus'
wikisql
CREATE TABLE table_16390001_2 ( interview VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the interview scores for contestants whose average is 9.090?
SELECT interview FROM table_16390001_2 WHERE average = "9.090"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRG...
SELECT jybgb.JYLX FROM jybgb WHERE jybgb.BGDH = '35125613493'
css
CREATE TABLE table_name_38 ( record_description VARCHAR, date VARCHAR, pilot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Date of 23 september 1961, and a Pilot of b.v. zemskov had what record description?
SELECT record_description FROM table_name_38 WHERE date = "23 september 1961" AND pilot = "b.v. zemskov"
sql_create_context
CREATE TABLE table_62313 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total byes for more than 1 draw?
SELECT COUNT("Byes") FROM table_62313 WHERE "Draws" > '1'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-23497')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TI...
eicu
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
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 jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59871' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_19534874_2 ( indoor INTEGER, inspection VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the minimum indoor results that have a 5 for inspection?
SELECT MIN(indoor) FROM table_19534874_2 WHERE inspection = 5
sql_create_context
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute uri NOS" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE table_49229 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which part 2 has a verb that means to leap?
SELECT "Part 2" FROM table_49229 WHERE "Verb meaning" = 'to leap'
wikisql
CREATE TABLE table_11125 ( "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 Collingwood play?
SELECT "Date" FROM table_11125 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_10112 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game site has an Opponent of buffalo bills?
SELECT "Game site" FROM table_10112 WHERE "Opponent" = 'buffalo bills'
wikisql
CREATE TABLE table_49233 ( "Tournament" text, "Surface" text, "Week" text, "Winner and score" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the week of August 6, who is the finalist?
SELECT "Finalist" FROM table_49233 WHERE "Week" = 'august 6'
wikisql
CREATE TABLE table_7970 ( "Aircraft" text, "Type" text, "Version" text, "Produced" text, "Quantity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which type has 140 made?
SELECT "Type" FROM table_7970 WHERE "Quantity" = '140'
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Iron"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1388267' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1388267' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-02-06' AND '2018-12-21' AND t_kc21.MED_ORG_DEPT_CD = '72353'
css
CREATE TABLE table_name_16 ( date VARCHAR, visiting_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the date for pittsburgh steelers
SELECT date FROM table_name_16 WHERE visiting_team = "pittsburgh steelers"
sql_create_context
CREATE TABLE table_50793 ( "Event" text, "Long Course/Short Course" text, "Year Set" real, "Time" text, "Meet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the latest year that had a 100m freestyle?
SELECT MAX("Year Set") FROM table_50793 WHERE "Event" = '100m freestyle'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Wilbur Braatz"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076"
mimicsql_data
CREATE TABLE table_name_98 ( date VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When has a Winning score of 16 (70-65-65=200)?
SELECT date FROM table_name_98 WHERE winning_score = –16(70 - 65 - 65 = 200)
sql_create_context
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABL...
SELECT DISTINCT COUNT(paper.paperid), keyphrase.keyphraseid FROM keyphrase, paper, paperkeyphrase, venue WHERE paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' GROUP BY keyphrase.keyphraseid ...
scholar
CREATE TABLE table_name_16 ( date VARCHAR, road_team VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Road team of portland, and a Game of game 5?
SELECT date FROM table_name_16 WHERE road_team = "portland" AND game = "game 5"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLin...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Reputation >= (SELECT Reputation FROM Users WHERE Id = 5285908) AND (UPPER(Location) LIKE '% AZ%' OR UPPER(Location) LIKE '% ARIZONA%') ORDER BY Reputation DESC
sede
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Pleas...
SELECT title, AVG(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2173" AND prescriptions.route = "BUCCAL"
mimicsql_data
CREATE TABLE table_name_74 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place did Lee Westwood finish in?
SELECT place FROM table_name_74 WHERE player = "lee westwood"
sql_create_context
CREATE TABLE table_203_204 ( id number, "year" number, "film" text, "language" text, "actors" text, "music" text, "banner" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last film directed by c. v. sridhar ?
SELECT "film" FROM table_203_204 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_name_61 ( games VARCHAR, bronze VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game had 8 bronze and 4 gold?
SELECT games FROM table_name_61 WHERE bronze = "8" AND gold = "4"
sql_create_context
CREATE TABLE table_4498 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Kraco Twin 125 (R2)'s Winning Driver?
SELECT "Winning driver" FROM table_4498 WHERE "Name" = 'kraco twin 125 (r2)'
wikisql
CREATE TABLE table_name_20 ( played VARCHAR, wins VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many played have 8 wins and more than 58 goals against?
SELECT COUNT(played) FROM table_name_20 WHERE wins = 8 AND goals_against > 58
sql_create_context
CREATE TABLE table_name_62 ( current_affiliation VARCHAR, years_owned VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current affiliation when the years owned is between 1955 1995?
SELECT current_affiliation FROM table_name_62 WHERE years_owned = "1955–1995"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender 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 = "Fx surg nck humerus-clos" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_67733 ( "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's the lowest Overall average that has a College of Arkansas, and a Round larger t...
SELECT MIN("Overall") FROM table_67733 WHERE "College" = 'arkansas' AND "Round" > '3'
wikisql
CREATE TABLE table_23601 ( "Draw" real, "Artist" text, "Song" text, "Regions" real, "Studio Audience" real, "Press Jury" real, "Oil Rig" real, "Total Points" real, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many point...
SELECT "Total Points" FROM table_23601 WHERE "Draw" = '3'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_name_56 ( year INTEGER, partnering VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the US Open that had a partnering of Maikel Scheffers?
SELECT SUM(year) FROM table_name_56 WHERE partnering = "maikel scheffers" AND championship = "us open"
sql_create_context
CREATE TABLE table_name_13 ( year_left INTEGER, school VARCHAR, year_joined VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year Left is the lowest one that has a School of calumet, and a Year Joined larger than 1993?
SELECT MIN(year_left) FROM table_name_13 WHERE school = "calumet" AND year_joined > 1993
sql_create_context
CREATE TABLE table_37024 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a Competition of world championships, and a Year larger than 1997?
SELECT "Position" FROM table_37024 WHERE "Competition" = 'world championships' AND "Year" > '1997'
wikisql
CREATE TABLE Ref_Shipping_Agents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR ) CREATE TABLE Documents ( document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
sql_create_context
CREATE TABLE table_name_91 ( date VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Ram Vaswani was a winner on what date?
SELECT date FROM table_name_91 WHERE winner = "ram vaswani"
sql_create_context
CREATE TABLE table_name_75 ( score VARCHAR, tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Tie No is Replay, and when Home Team is Sunderland?
SELECT score FROM table_name_75 WHERE tie_no = "replay" AND home_team = "sunderland"
sql_create_context
CREATE TABLE table_11922 ( "Tallangatta DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of byes that has 13 losses and wins less than 5?
SELECT COUNT("Byes") FROM table_11922 WHERE "Losses" = '13' AND "Wins" < '5'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
SELECT DISTINCT total_gpa FROM student WHERE student_id = 1
advising
CREATE TABLE table_22418 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text, "Language/Rebroadcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When vista radio is the owner what is the frequency?
SELECT "Frequency" FROM table_22418 WHERE "Owner" = 'Vista Radio'
wikisql
CREATE TABLE table_56141 ( "Episode" text, "1st edition" text, "2nd edition" text, "3rd edition" text, "4th edition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st Edition for the Episode 4?
SELECT "1st edition" FROM table_56141 WHERE "Episode" = '4'
wikisql
CREATE TABLE table_name_92 ( points INTEGER, team VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of points team vit ria, which had more than 38 played, had?
SELECT MAX(points) FROM table_name_92 WHERE team = "vitória" AND played > 38
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_500, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text...
SELECT questions.PyPostId AS Python_Questions FROM (SELECT p_tags.PostId AS PyPostId FROM Tags AS tag INNER JOIN PostTags AS p_tags ON tag.Id = p_tags.TagId INNER JOIN Posts AS posts ON Posts.Id = p_tags.PostId WHERE TagName = 'python') AS questions INNER JOIN Posts AS post ON questions.PyPostId = post.Id WHERE Creatio...
sede
CREATE TABLE table_name_41 ( engine VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engine has a Lotus 49c chassis?
SELECT engine FROM table_name_41 WHERE chassis = "lotus 49c"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-33922')) AND medication.drugname = '2 ml : fentanyl citrat...
eicu
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT COUNT(*) AS Volume, SUM(ViewCount) AS PageViews, COUNT(DISTINCT OwnerUserId) AS UniqueOPs, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P WHERE Tags LIKE '%<tridion%' AND PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY TIME_TO...
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2109"
mimicsql_data
CREATE TABLE table_43582 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What method of resolution was the fight that took p...
SELECT "Method" FROM table_43582 WHERE "Event" = 'hardcore championship fighting: destiny'
wikisql
CREATE TABLE table_name_32 ( player VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had a to par of e and scored 71-69=140?
SELECT player FROM table_name_32 WHERE to_par = "e" AND score = 71 - 69 = 140
sql_create_context
CREATE TABLE table_name_14 ( label VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the label in Japan?
SELECT label FROM table_name_14 WHERE region = "japan"
sql_create_context