instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_50256 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Money has a Score of 70-68-73-68=279?
SELECT MIN("Money ( $ )") FROM table_50256 WHERE "Score" = '70-68-73-68=279'
wikisql
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 procedures ( ...
SELECT lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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....
css
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_58109 ( "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. -- Where did South Melbourne play as the home team?...
SELECT "Venue" FROM table_58109 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
nvbench
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT Users.Id AS "user_link", COUNT(Posts.Id) AS Questions, CAST(AVG(CAST(Score AS FLOAT)) AS FLOAT(6, 2)) AS "average_question_score" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, DisplayName HAVING COUNT(Posts.Id) ...
sede
CREATE TABLE protein ( protein_name VARCHAR, institution_id VARCHAR ) CREATE TABLE institution ( institution VARCHAR, institution_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the protein name and the institution name.
SELECT T2.protein_name, T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id
sql_create_context
CREATE TABLE table_name_5 ( wins INTEGER, top_10 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average Wins which has a Top 10 smaller than 0?
SELECT AVG(wins) FROM table_name_5 WHERE top_10 < 0
sql_create_context
CREATE TABLE table_39117 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the points when there are fewer than 4 games?
SELECT SUM("Points") FROM table_39117 WHERE "Games" < '4'
wikisql
CREATE TABLE table_204_615 ( id number, "date" text, "opponent" text, "result" text, "goal scorers (season goals)" text, "goalie saves" text, "attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the first team that the badgers...
SELECT "opponent" FROM table_204_615 ORDER BY id LIMIT 1
squall
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench
CREATE TABLE table_45151 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Steve Lowery's Place?
SELECT "Place" FROM table_45151 WHERE "Player" = 'steve lowery'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5932040' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_CD
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT MIN(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-195316') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2103-09' GROUP BY STRFTIME('%y-%m-%d', patie...
eicu
CREATE TABLE table_55934 ( "Rank" real, "Name" text, "Nation" text, "Placings" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank number for a placing of 28.5 and a total less than 92.7?
SELECT COUNT("Rank") FROM table_55934 WHERE "Placings" = '28.5' AND "Total" < '92.7'
wikisql
CREATE TABLE table_206419_3 ( shareholder VARCHAR, percent_of_capital VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shareholder has 3.63 percent of capital?
SELECT shareholder FROM table_206419_3 WHERE percent_of_capital = "3.63"
sql_create_context
CREATE TABLE table_28062822_3 ( height VARCHAR, represent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the height of representative #6?
SELECT height FROM table_28062822_3 WHERE represent = 6
sql_create_context
CREATE TABLE table_42526 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Score of 108-105 (ot)?
SELECT "Team" FROM table_42526 WHERE "Score" = '108-105 (ot)'
wikisql
CREATE TABLE table_name_4 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest 1995 with a 1990 less than 36, a 1987 less than 1987, and a 2007 value greater than 107?
SELECT MAX(1995) FROM table_name_4 WHERE 1990 > 36 AND 1987 < 1987 AND 2007 > 107
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '93948131621' AND HOSP_DOC_NM LIKE '苗%'
css
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 COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_69841 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For years before 1996, having a rank of 3rd in the 125cc class, what is the sum of the points?
SELECT SUM("Points") FROM table_69841 WHERE "Class" = '125cc' AND "Rank" = '3rd' AND "Year" < '1996'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_name_3 ( safari VARCHAR, opera VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using Safari during the period in which 2.33% were using Opera?
SELECT safari FROM table_name_3 WHERE opera = "2.33%"
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
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 (((flight.departure_time BETWEEN 1000 AND 0) AND date_day.day_number = 13 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE county_public_safety ( Crime_rate INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the minimum and maximum crime rate of counties?
SELECT MIN(Crime_rate), MAX(Crime_rate) FROM county_public_safety
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LOPE2"
mimicsql_data
CREATE TABLE table_train_13 ( "id" int, "active_infection" bool, "procalcitonin" int, "receiving_vasopressor" bool, "sepsis" bool, "septic_shock" bool, "age" float, "lactate" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT * FROM table_train_13 WHERE procalcitonin >= 2
criteria2sql
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.admityear < "2120" AND lab.itemid = "51044"
mimicsql_data
CREATE TABLE table_name_41 ( crowd INTEGER, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average crowd size when fitzroy plays at home?
SELECT AVG(crowd) FROM table_name_41 WHERE home_team = "fitzroy"
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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal bool...
SELECT 'http://stackoverflow.com/questions/' + CAST(c.PostId AS TEXT) FROM Comments AS c INNER JOIN Posts AS p ON (p.Id = c.PostId) WHERE c.Text LIKE '%This does not provide an answer to the question.%' AND c.Score >= 0 AND p.Score <= 0 AND NOT EXISTS(SELECT * FROM PostHistory AS h WHERE PostHistoryTypeId IN (12, 13) A...
sede
CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcod...
SELECT COUNT(*), dept_code FROM class AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code
spider
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id num...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality ORDER BY COUNT(Nationality) DESC
nvbench
CREATE TABLE mzb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '卫博裕' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8489.49) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '卫博裕' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT...
css
CREATE TABLE table_name_46 ( round INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rounds is the fight against Michael Chavez?
SELECT AVG(round) FROM table_name_46 WHERE opponent = "michael chavez"
sql_create_context
CREATE TABLE table_train_173 ( "id" int, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hepatitis_c" bool, "hepatitis_b" bool, "cirrhosis" bool, "renal_disease" bool, "hepatic_disease" bool, "allergy_to_egg" bool, "estimated_glomerular_filtration_rate_egfr" int, "NOUSE"...
SELECT * FROM table_train_173 WHERE hiv_infection = 1 OR hepatitis_c = 1 OR hepatitis_b = 1
criteria2sql
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Urinary incontinence NOS"
mimicsql_data
CREATE TABLE table_name_1 ( nationality VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality is Demetris Nichols?
SELECT nationality FROM table_name_1 WHERE player = "demetris nichols"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_80457 ( "Representative" text, "Years" text, "State" text, "Party" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party has Peter A. Quinn as a representative?
SELECT "Party" FROM table_80457 WHERE "Representative" = 'peter a. quinn'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "Osmolality, Measured"
mimicsql_data
CREATE TABLE table_name_60 ( name VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What School is in the kio kio area?
SELECT name FROM table_name_60 WHERE area = "kio kio"
sql_create_context
CREATE TABLE table_53364 ( "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. -- Where did a home team score 8.14 (62)?
SELECT "Venue" FROM table_53364 WHERE "Home team score" = '8.14 (62)'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '窦碧玉' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-08-28' AND '2006-01-01' AND zzmzjzjlb.YLJGDM = '9175260' UNI...
css
CREATE TABLE table_name_89 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in week 6?
SELECT opponent FROM table_name_89 WHERE week = 6
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 WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "2078"
mimicsql_data
CREATE TABLE table_29171931_3 ( incoming_head_coach VARCHAR, outgoing_head_coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incoming head coach after Wan Jamak Wan Hassan quit the coaching job?
SELECT incoming_head_coach FROM table_29171931_3 WHERE outgoing_head_coach = "Wan Jamak Wan Hassan"
sql_create_context
CREATE TABLE authors ( fname VARCHAR, lname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Retrieve all the first and last names of authors in the alphabetical order of last names.
SELECT fname, lname FROM authors ORDER BY lname
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-32407' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit...
eicu
CREATE TABLE table_4336 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the label for digital download for bonus tracks version
SELECT "Label" FROM table_4336 WHERE "Format" = 'digital download' AND "Edition(s)" = 'bonus tracks version'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime ti...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 903...
mimic_iii
CREATE TABLE table_58080 ( "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 the Crowd is larger than 23,327, what Home ...
SELECT "Home team" FROM table_58080 WHERE "Crowd" > '23,327'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '慢性咽炎' GROUP BY person_info.JGDM
css
CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalen...
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = "Orange")
spider
CREATE TABLE table_5887 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Men's singles of kilian pfister, and a Women's doub...
SELECT AVG("Year") FROM table_5887 WHERE "Men's singles" = 'kilian pfister' AND "Women's doubles" = 'astrid eidenbenz claudia jehle'
wikisql
CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real ) CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show dif...
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher
nvbench
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 gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '朱飞宇' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1829.32) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '朱飞宇' AND fgwyjzb....
css
CREATE TABLE table_78394 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team when the visiting team was Toronto?
SELECT "Home" FROM table_78394 WHERE "Visitor" = 'toronto'
wikisql
CREATE TABLE table_name_67 ( laps VARCHAR, time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps does jean-christophe boullion have with a time/retired of +1 lap?
SELECT laps FROM table_name_67 WHERE time_retired = "+1 lap" AND driver = "jean-christophe boullion"
sql_create_context
CREATE TABLE table_65423 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Notes of the Country with a Rank of 4?
SELECT "Notes" FROM table_65423 WHERE "Rank" = '4'
wikisql
CREATE TABLE table_50321 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the college of dave adams, who has a pick greater than 7?
SELECT "College" FROM table_50321 WHERE "Pick" > '7' AND "Name" = 'dave adams'
wikisql
CREATE TABLE table_56436 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team played in front of 28,536 at an away s...
SELECT "Away team score" FROM table_56436 WHERE "Crowd" > '28,536'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId numb...
SELECT p.Id AS "post_link", p.OwnerUserId AS "user_link", SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) - SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS "netupvotes", p.ViewCount AS "views", ROUND(CAST(SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) - SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS FLO...
sede
CREATE TABLE table_name_36 ( kit_manufacturer VARCHAR, manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the kit manufacturer that has billy bonds as the manager?
SELECT kit_manufacturer FROM table_name_36 WHERE manager = "billy bonds"
sql_create_context
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 * 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 = '1388094' AND zyjzjlb.JZKSMC LIKE '%遗传%'
css
CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) ...
SELECT Location, COUNT(*) FROM performance GROUP BY Location
nvbench
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, AVG(cloud_cover) FROM weather
nvbench
CREATE TABLE table_203_731 ( id number, "pos." text, "city" text, "population\n(ab)" number, "surface\n(km2)" number, "density\n(ab/km2)" number, "altitude\n(mslm)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what city is the largest by...
SELECT "city" FROM table_203_731 ORDER BY "surface\n(km2)" DESC LIMIT 1
squall
CREATE TABLE table_28450 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT COUNT("Starts") FROM table_28450 WHERE "Avg. Finish" = '17.9'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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, subject_id number, had...
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42396) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) <= '2101' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'LHC' AND course.number = 399 AND instructor.name LIKE '%Stephen Lusmann%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor...
advising
CREATE TABLE table_name_15 ( gold INTEGER, nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gold have a National of New Zealand with a total less than 2?
SELECT SUM(gold) FROM table_name_15 WHERE nation = "new zealand" AND total < 2
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "B-complex defic NEC" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_15781170_2 ( _number VARCHAR, poll_winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the # for youtube
SELECT _number FROM table_15781170_2 WHERE poll_winner = "YouTube"
sql_create_context
CREATE TABLE table_70017 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which label has a date of 1987?
SELECT "Label" FROM table_70017 WHERE "Date" = '1987'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Manufacturer)
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
SELECT p.Id AS "post_link", 'site://posts/' + CAST(p.Id AS TEXT) + '/edit|' + 'Edit' AS "edit_link", p.CreationDate FROM Posts AS p WHERE 1 = 1 AND (NOT (p.AcceptedAnswerId != p.Id) OR p.AcceptedAnswerId IS NULL) AND YEAR(p.CreationDate) = @year AND (REPLACE(REPLACE(p.Body, '\\', ''), ' ', 'X') LIKE '%\XXXX%') AND (p.O...
sede
CREATE TABLE table_37906 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did lucy benjamin exit?
SELECT "Exited" FROM table_37906 WHERE "Celebrity" = 'lucy benjamin'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT DATE(CAST(t.yr AS TEXT(4)) + '-' + CAST(t.mnth AS TEXT(2)) + '-01') AS dt, (CASE WHEN t.r_mnth_count = 0 THEN NULL ELSE CAST(t.py_mnth_count AS FLOAT) / CAST(t.r_mnth_count AS FLOAT) END) AS py_div_r FROM (SELECT MONTH(CreationDate) AS mnth, YEAR(CreationDate) AS yr, SUM(CASE WHEN Tags LIKE '%<r>%' THEN 1 ELSE 0...
sede
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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL ABSCESS" AND demographic.dod_year <= "2179.0"
mimicsql_data
CREATE TABLE table_59271 ( "Position" real, "Club" text, "Games played" real, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lo...
SELECT MIN("Position") FROM table_59271 WHERE "Wins" = '2' AND "Loses" > '13'
wikisql
CREATE TABLE qtb ( CLINIC_ID 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, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3780652' AND qtb.IN_HOSP_DATE BETWEEN '2004-01-02' AND '2015-04-17' AND qtb.IN_DIAG_DIS_CD <> qtb.OUT_DIAG_DIS_CD UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3780652' AND gyb.IN_HOSP_DATE BETWEEN '2004-01-02' AND '2015-04-17' AND gyb.IN_DIAG_DIS_CD <> ...
css
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2027203' AND t_kc22.SOC_SRT_DIRE_CD = '1591'
css
CREATE TABLE table_1428 ( "Municipality" text, "Population" text, "Inhabitants per km\u00b2" real, "Area (in km\u00b2)" real, "Markatal" real, "Island" text, "Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the municpality for 57...
SELECT "Municipality" FROM table_1428 WHERE "Population" = '57'
wikisql
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.admityear < "2151" AND lab.itemid = "51100"
mimicsql_data
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE ground_service ( ...
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, state AS STATE_0, state AS STATE_1 WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.c...
atis
CREATE TABLE table_16327 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college is aligned to the Saskatchewan Roughriders?
SELECT "College" FROM table_16327 WHERE "CFL Team" = 'Saskatchewan Roughriders'
wikisql
CREATE TABLE table_43782 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Goals Against") FROM table_43782 WHERE "Goals For" > '55' AND "Goal Difference" = '+24'
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 prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Repaglinide"
mimicsql_data
CREATE TABLE table_name_57 ( dimension__m_ VARCHAR, range__km_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the dimension that has a range of 8,000 10,000
SELECT dimension__m_ FROM table_name_57 WHERE range__km_ = "8,000 – 10,000"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
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 = '025-23610')) AND treatment.treatmentname = 'angiotensin ii recept...
eicu
CREATE TABLE table_name_86 ( opponent VARCHAR, series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when the series was at 1-3?
SELECT opponent FROM table_name_86 WHERE series = "1-3"
sql_create_context
CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Project_Outcomes ( project_id INTEGER, outcome_code VARCHAR(10), outcome_details VARCHAR(255) ) ...
SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to
nvbench
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2180.0" AND prescriptions.drug = "Verapamil SR"
mimicsql_data
CREATE TABLE table_name_67 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the game where Melbourne was the away team, what did they score?
SELECT away_team AS score FROM table_name_67 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20251)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra...
mimic_iii
CREATE TABLE table_name_79 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2002 has a 2008 of 3 3?
SELECT 2002 FROM table_name_79 WHERE 2008 = "3–3"
sql_create_context