instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_21347 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Competition" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the venue for 19th date
| SELECT "Venue" FROM table_21347 WHERE "Date" = '19th' | wikisql |
CREATE TABLE table_74350 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pick number was marc deschamps?
| SELECT "Pick #" FROM table_74350 WHERE "Player" = 'Marc Deschamps' | wikisql |
CREATE TABLE table_11448 (
"Rank" real,
"English title" text,
"Chinese title" text,
"Average" real,
"Peak" real,
"Premiere" real,
"Finale" real,
"HK viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With 1.97 million HK viewers and... | SELECT COUNT("Peak") FROM table_11448 WHERE "HK viewers" = '1.97 million' AND "Finale" > '33' | wikisql |
CREATE TABLE table_35368 (
"Region" text,
"Total Population" real,
"Catholic" real,
"% Catholic" text,
"% of global Catholic pop." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- with catholic of 3.33% and total population more than 1,528,384,440, wh... | SELECT "% of global Catholic pop." FROM table_35368 WHERE "Total Population" > '1,528,384,440' AND "% Catholic" = '3.33%' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_78022 (
"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.
-- How much did the away team score at victoria par... | SELECT "Away team score" FROM table_78022 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10425) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') | mimic_iii |
CREATE TABLE table_204_409 (
id number,
"date" text,
"race name" text,
"location" text,
"uci rating" number,
"winner" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did the tour of libya last ?
| SELECT "date" FROM table_204_409 WHERE "race name" = 'tour of libya' | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | 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 = '006-232560')) AND diagnosis.diagnosisname = 'headache' AND DATETI... | eicu |
CREATE TABLE table_31408 (
"No. for season" real,
"No. for series" real,
"Episode" text,
"Airdate" text,
"Viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the episode name for series number 45?
| SELECT "Episode" FROM table_31408 WHERE "No. for series" = '45' | wikisql |
CREATE TABLE table_203_410 (
id number,
"game" number,
"date" text,
"opponent" text,
"location" text,
"score" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did the new york titans win or lose game num... | SELECT "score" FROM table_203_410 WHERE "game" = 13 | squall |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_70751 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year with less than 3 points and Parmalat Forti Ford was the entrant?
| SELECT MIN("Year") FROM table_70751 WHERE "Points" < '3' AND "Entrant" = 'parmalat forti ford' | 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, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC | nvbench |
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 text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '16242595642' | css |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | SELECT u.Id, u.AboutMe, SUBSTRING(u.AboutMe, STR_POSITION(u.AboutMe, '@', 0) - 30, STR_POSITION(u.AboutMe, '@', 0) + 30) AS email, SUBSTRING(u.AboutMe, STR_POSITION(UPPER(u.AboutMe), 'TWITTER', 0) - 30, STR_POSITION(UPPER(u.AboutMe), 'TWITTER', 0) + 30) AS twitter, COUNT(*) FROM Tags AS t INNER JOIN PostTags AS pt ON p... | sede |
CREATE TABLE table_25016824_2 (
reward VARCHAR,
immunity VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the reward when immunity went to martin and finish is 13th voted out 8th jury member day 46?
| SELECT reward FROM table_25016824_2 WHERE immunity = "Martin" AND finish = "13th voted Out 8th Jury Member Day 46" | sql_create_context |
CREATE TABLE table_name_82 (
rd__number INTEGER,
player VARCHAR,
pl_gp VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Steve Hazlett is the Player, and the PI GP is under 0, what is the average Rd #?
| SELECT AVG(rd__number) FROM table_name_82 WHERE player = "steve hazlett" AND pl_gp < 0 | sql_create_context |
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
country VARCHAR(50),
other_address_details VARCHAR(255)
)
CREATE TABLE Students (
student_id... | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_49462 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long did it take to ride when the laps were 23 and the grid of 13?
| SELECT "Time" FROM table_49462 WHERE "Laps" = '23' AND "Grid" = '13' | wikisql |
CREATE TABLE table_18729 (
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode with p... | SELECT "Written by" FROM table_18729 WHERE "Production code" = '1ANJ01' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | SELECT q.ViewCount, q.Tags, a.CreationDate AS Answered, a.Id AS "post_link", a.Score FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserID##' ORDER BY Score | sede |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType | nvbench |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_20866024_2 (
engine VARCHAR,
gvw__kg_ton_ VARCHAR,
model_designation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the engine for the model model designation 97G00 and GVW of 2500/2.46 kg/ton?
| SELECT engine FROM table_20866024_2 WHERE gvw__kg_ton_ = "2500/2.46" AND model_designation = "97G00" | sql_create_context |
CREATE TABLE table_8137 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is... | SELECT "Team" FROM table_8137 WHERE "High rebounds" = 'david lee (15)' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT gwyjzb.MAIN_COND_DES FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '76565041487' UNION SELECT fgwyjzb.MAIN_COND_DES FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '76565041487' | css |
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE artist (
artist_name varchar2(50),
co... | SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages | nvbench |
CREATE TABLE table_27615896_18 (
sd VARCHAR,
status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of sd listings where the status is quarterfinals lost to Novak Djokovic [1]?
| SELECT COUNT(sd) FROM table_27615896_18 WHERE status = "Quarterfinals lost to Novak Djokovic [1]" | sql_create_context |
CREATE TABLE table_name_16 (
prod_code VARCHAR,
episode_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code fore the episode titled, life's no fun anymore?
| SELECT prod_code FROM table_name_16 WHERE episode_title = "life's no fun anymore" | sql_create_context |
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | SELECT Open_Date, COUNT(Open_Date) FROM church ORDER BY COUNT(Open_Date) DESC | nvbench |
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 WHERE demographic.expire_flag = "0" | mimicsql_data |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypothyroidism') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagn... | eicu |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE albums (
... | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state | spider |
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 intakeoutput (
in... | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52327') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-... | eicu |
CREATE TABLE table_58542 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who constructed olivier panis' car that retired after +1 lap?
| SELECT "Constructor" FROM table_58542 WHERE "Time/Retired" = '+1 lap' AND "Driver" = 'olivier panis' | wikisql |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
... | SELECT languages, AVG(rating) FROM song GROUP BY languages | nvbench |
CREATE TABLE table_name_88 (
heat VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Heat for Smiljana Marinovi ?
| SELECT COUNT(heat) FROM table_name_88 WHERE name = "smiljana marinović" | sql_create_context |
CREATE TABLE table_19873 (
"Task No." real,
"Day announced" text,
"Description" text,
"Options" text,
"Viewers selection" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final result when the viewers selected ejay?
| SELECT "Result" FROM table_19873 WHERE "Viewers selection" = 'Ejay' | wikisql |
CREATE TABLE table_23812628_1 (
team__number2 VARCHAR,
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team #2 for river plate
| SELECT team__number2 FROM table_23812628_1 WHERE team__number1 = "River Plate" | sql_create_context |
CREATE TABLE table_name_20 (
pick__number INTEGER,
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the sum of Pick # that has the Position of sb, and the College of minnesota?
| SELECT SUM(pick__number) FROM table_name_20 WHERE position = "sb" AND college = "minnesota" | sql_create_context |
CREATE TABLE table_17473 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What leagues includes division 3
| SELECT "League" FROM table_17473 WHERE "Division" = '3' | wikisql |
CREATE TABLE gwyjzb (
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0641138' AND gwyjzb.OUT_DIAG_DIS_CD = 'N99.229' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0641138' AND fgwyjzb.OUT_D... | css |
CREATE TABLE table_train_251 (
"id" int,
"gender" string,
"left_ventricular_ejection_fraction_lvef" int,
"allergy_to_rabbit_proteins" bool,
"recurring_alcohol_related_legal_problem" bool,
"hyperlipidemia" bool,
"fasting_ldl_cholesterol" int,
"baseline_hemoglobin_hgb" float,
"NOUSE" f... | SELECT * FROM table_train_251 WHERE baseline_hemoglobin_hgb < 11.7 AND gender = 'female' | criteria2sql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | SELECT CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '58630087217' | css |
CREATE TABLE table_name_60 (
date VARCHAR,
competition VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date when the competition is 1996 tiger cup and the result is drew?
| SELECT date FROM table_name_60 WHERE competition = "1996 tiger cup" AND result = "drew" | sql_create_context |
CREATE TABLE table_75152 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for the 1964 summer olympics on october 18?
| SELECT "Results\u00b9" FROM table_75152 WHERE "Type of game" = '1964 summer olympics' AND "Date" = 'october 18' | wikisql |
CREATE TABLE table_204_387 (
id number,
"name" text,
"country" text,
"top rugby league level" text,
"top union level" text,
"top representation level" text,
"rugby league debut" number,
"rugby union debut" number
)
-- Using valid SQLite, answer the following questions for the tables pr... | SELECT "name" FROM table_204_387 WHERE id = (SELECT id FROM table_204_387 WHERE "name" = 'chris ashton') - 1 | squall |
CREATE TABLE table_name_45 (
percentage_democrats VARCHAR,
democratic_seat_plurality VARCHAR,
democratic__republican VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage democrats with democratic plurality of -3, and 2/5 democrat/republi... | SELECT percentage_democrats FROM table_name_45 WHERE democratic_seat_plurality = "-3" AND democratic__republican = "2/5" | sql_create_context |
CREATE TABLE table_26561498_1 (
written_by VARCHAR,
patient_portrayer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was written by alex carter?
| SELECT written_by FROM table_26561498_1 WHERE patient_portrayer = "Alex Carter" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLO... | 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 | nvbench |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop... | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code AND ... | atis |
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_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.... | css |
CREATE TABLE table_name_79 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date had a record of 15-14-4?
| SELECT date FROM table_name_79 WHERE record = "15-14-4" | sql_create_context |
CREATE TABLE table_25173505_13 (
character VARCHAR,
special_edition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the character where the special edition is koichi sakaguchi?
| SELECT character FROM table_25173505_13 WHERE special_edition = "Koichi Sakaguchi" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid tex... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... | eicu |
CREATE TABLE table_train_100 (
"id" int,
"systolic_blood_pressure_sbp" int,
"stroke" bool,
"body_weight" float,
"diastolic_blood_pressure_dbp" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer... | SELECT * FROM table_train_100 WHERE (systolic_blood_pressure_sbp < 90 OR systolic_blood_pressure_sbp > 160) OR (diastolic_blood_pressure_dbp > 100 OR diastolic_blood_pressure_dbp < 60) | criteria2sql |
CREATE TABLE table_name_67 (
rank INTEGER,
silver VARCHAR,
gold VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of a country with more than 2 gold, less than 5 silver, and less than 31 total medals?
| SELECT SUM(rank) FROM table_name_67 WHERE gold > 2 AND total < 31 AND silver < 5 | sql_create_context |
CREATE TABLE table_75522 (
"S.No." real,
"Name of janapada" text,
"Name of King" text,
"No. of villages" real,
"Capital" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of villages with a name of janapada of Punia?
| SELECT AVG("No. of villages") FROM table_75522 WHERE "Name of janapada" = 'punia' | wikisql |
CREATE TABLE table_588 (
"Institution" text,
"Location" text,
"Nickname" text,
"Current Conference" text,
"Classification" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the nickname of the University of Massachusetts Lowell (UMass Lowell)?
| SELECT "Nickname" FROM table_588 WHERE "Institution" = 'University of Massachusetts Lowell (UMass Lowell)' | wikisql |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name tex... | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister | nvbench |
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 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.JZZDBM = 'J44.682' GROUP BY person_info.JGDM | css |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 ORDER BY COUNT(date) DESC | nvbench |
CREATE TABLE table_66054 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which IHSAA Football Class has a IHSAA Clas... | SELECT "IHSAA Football Class" FROM table_66054 WHERE "IHSAA Class" = 'aaa' AND "Location" = 'nashville' | wikisql |
CREATE TABLE table_1949994_8 (
no INTEGER,
local_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What series number had the local title of Fort Boyard?
| SELECT MAX(no) FROM table_1949994_8 WHERE local_title = "Fort Boyard" | sql_create_context |
CREATE TABLE table_13065 (
"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 mo... | SELECT MAX("Draws") FROM table_13065 WHERE "Goals conceded" < '154' AND "Games played" < '36' | wikisql |
CREATE TABLE table_name_80 (
record VARCHAR,
week INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the record after week 16?
| SELECT record FROM table_name_80 WHERE week > 16 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE table_name_55 (
match INTEGER,
draw VARCHAR,
team VARCHAR,
lost VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average match has a lost greater than 0, points greater than 6, legia warszawa as the team, and a dr... | SELECT AVG(match) FROM table_name_55 WHERE lost > 0 AND points > 6 AND team = "legia warszawa" AND draw < 0 | sql_create_context |
CREATE TABLE table_76441 (
"Date" text,
"Event" text,
"City" text,
"Oil Pattern" text,
"Winner (Title #)" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Oil Pattern has a Winner (Title #) of mike wolfe (... | SELECT "Oil Pattern" FROM table_76441 WHERE "Winner (Title #)" = 'mike wolfe (3)' | wikisql |
CREATE TABLE table_12134383_1 (
date_of_birth VARCHAR,
end_of_term VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the date of birth with end of term being 5july1978
| SELECT date_of_birth FROM table_12134383_1 WHERE end_of_term = "5July1978" | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '31811112' AND t_kc22.STA_DATE BETWEEN '2014-10-25' AND '2015-12-28' AND t_kc22.SOC_SRT_DIRE_CD = '445109937' | css |
CREATE TABLE table_name_13 (
number_of_doses VARCHAR,
vaccine VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many doses for the bacillus calmette-gu rin?
| SELECT number_of_doses FROM table_name_13 WHERE vaccine = "bacillus calmette-guérin" | sql_create_context |
CREATE TABLE table_3367 (
"Date (YYYY-MM-DD)" text,
"Time (UTC)" text,
"Latitude" text,
"Longitude" text,
"Depth" text,
"Magnitude" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the longitude is 157.941 e, what is the latitude?
| SELECT "Latitude" FROM table_3367 WHERE "Longitude" = '157.941° E' | wikisql |
CREATE TABLE table_6874 (
"Year" real,
"Ceremony" text,
"Category" text,
"Work" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result with a Category of album of the year in a Year that is 2011?
| SELECT "Result" FROM table_6874 WHERE "Category" = 'album of the year' AND "Year" = '2011' | 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 diagnoses (
... | 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.long_title = "Paroxysmal ventricular tachycardia" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_name_31 (
film VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the year is year what was the film?
| SELECT film FROM table_name_31 WHERE "year" = "year" | sql_create_context |
CREATE TABLE table_66274 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Song has Points smaller than 53, and a Place larger than 8, and a Draw larger than 1?
| SELECT "Song" FROM table_66274 WHERE "Points" < '53' AND "Place" > '8' AND "Draw" > '1' | wikisql |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARC... | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.student_id | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'facial bone fracture - orbital fracture')) A... | eicu |
CREATE TABLE table_name_30 (
sub_parish__sokn_ VARCHAR,
year_built VARCHAR,
location_of_the_church VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Sub-Parish (Sokn) that was built in 1957 in the location of Stavang?
| SELECT sub_parish__sokn_ FROM table_name_30 WHERE year_built = "1957" AND location_of_the_church = "stavang" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_20424014_1 (
county VARCHAR,
obama__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- where did obama get 41.3%
| SELECT county FROM table_20424014_1 WHERE obama__percentage = "41.3%" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE presc... | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY prescriptions.dr... | mimic_iii |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DATETIME,
other_visit_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
faul... | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make DESC | nvbench |
CREATE TABLE table_name_96 (
year VARCHAR,
laps VARCHAR,
start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the year with Laps less than 197 and start of 2
| SELECT year FROM table_name_96 WHERE laps < 197 AND start = "2" | sql_create_context |
CREATE TABLE table_79144 (
"Date" text,
"Bowl Game" text,
"Big Ten Team" text,
"Opp. Team" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Purdue's opponent?
| SELECT "Opp. Team" FROM table_79144 WHERE "Big Ten Team" = 'purdue' | wikisql |
CREATE TABLE table_name_80 (
name VARCHAR,
style VARCHAR,
status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a ballet style with original cast?
| SELECT name FROM table_name_80 WHERE style = "ballet" AND status = "original cast" | sql_create_context |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Contacts (
contact_id INTEGER,
customer_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(50),
contact_phone VARCHAR(80)... | SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to ORDER BY date_to | nvbench |
CREATE TABLE table_name_53 (
ryusuke_taguchi VARCHAR,
jushin_liger VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the ryusuke taguchi for Jushin Liger of liger (9:57)
| SELECT ryusuke_taguchi FROM table_name_53 WHERE jushin_liger = "liger (9:57)" | sql_create_context |
CREATE TABLE table_name_52 (
party VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Party, when Incumbent is 'Rodney Alexander'?
| SELECT party FROM table_name_52 WHERE incumbent = "rodney alexander" | sql_create_context |
CREATE TABLE table_name_4 (
against VARCHAR,
team VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of all against values for the Corinthians with less than 3 lost?
| SELECT COUNT(against) FROM table_name_4 WHERE team = "corinthians" AND lost < 3 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airli... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WESTCHESTER COUNTY' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2104-10' ORDER BY microbiologyevents.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY COUNT(Governor) DESC | nvbench |
CREATE TABLE table_67942 (
"Country" text,
"Player name" text,
"Period" text,
"Position" text,
"Matches" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the period with matches of 0 0 of portugal
| SELECT "Period" FROM table_67942 WHERE "Matches" = '0 0' AND "Country" = 'portugal' | wikisql |
CREATE TABLE table_1342218_35 (
party VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party does the incumbent from the Ohio 5 district belong to?
| SELECT party FROM table_1342218_35 WHERE district = "Ohio 5" | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT LAST_NAME, COUNT(LAST_NAME) FROM employees WHERE SALARY > (SELECT SALARY FROM employees WHERE EMPLOYEE_ID = 163) GROUP BY LAST_NAME ORDER BY COUNT(LAST_NAME) DESC | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | 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.icd9_code = "36202" AND lab.flag = "abnormal" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.