context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_760 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district does incumbent james c. davis represent? | SELECT "District" FROM table_760 WHERE "Incumbent" = 'James C. Davis' | wikisql |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
) | What is the average age for each gender? | SELECT AVG(age), gender FROM person GROUP BY gender | spider |
CREATE TABLE table_name_32 (
horse_1 VARCHAR,
rider_1 VARCHAR,
association VARCHAR
) | Which horse was Horse 1 when ren guzm n raced with the mulch n association? | SELECT horse_1 FROM table_name_32 WHERE rider_1 = "rené guzmán" AND association = "mulchén" | sql_create_context |
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_numb... | Find the name and capacity of the dorm with least number of amenities. | SELECT T1.dorm_name, T1.student_capacity FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid GROUP BY T2.dormid ORDER BY COUNT(*) LIMIT 1 | spider |
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 ... | Give the maximum age of patients of black/african american ethnicity who died before the year 2148. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dod_year < "2148.0" | mimicsql_data |
CREATE TABLE table_203_276 (
id number,
"album#" text,
"english title" text,
"chinese (traditional)" text,
"chinese (simplified)" text,
"release date" text,
"label" text
) | what label was she working with before universal music ? | SELECT "label" FROM table_203_276 WHERE id = (SELECT id FROM table_203_276 WHERE "label" = 'universal music') - 1 | squall |
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... | had patient 006-158338's sao2 ever been greater than 94.0 degrees on the last icu visit? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338') AND NOT patient.unitdischargetime IS NULL ORDER BY pati... | eicu |
CREATE TABLE table_name_5 (
name VARCHAR,
finals VARCHAR
) | What player had a finals score of 0 (10)? | SELECT name FROM table_name_5 WHERE finals = "0 (10)" | sql_create_context |
CREATE TABLE table_14752049_6 (
change__2011_to_2012_ VARCHAR,
change__2010_to_2011_ VARCHAR
) | When the change (2010 to 2011) is +1.0% what is the change (2011 to 2012)? | SELECT change__2011_to_2012_ FROM table_14752049_6 WHERE change__2010_to_2011_ = "+1.0%" | sql_create_context |
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 prescription... | What is the number of patients admitted before 2154 who were diagnosed with removal of other organ causing abnormal patient reaction, or later complication, without mention of misadventure at time of operation? | 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 = "Abn reac-organ rem NEC" | mimicsql_data |
CREATE TABLE table_12386 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Notes" text
) | What is the total number of Year, when Bronze is 'Jamie Stevenson'? | SELECT COUNT("Year") FROM table_12386 WHERE "Bronze" = 'jamie stevenson' | wikisql |
CREATE TABLE table_10812293_6 (
high_assists VARCHAR,
date VARCHAR
) | Who got high assists for the game played on February 9? | SELECT high_assists FROM table_10812293_6 WHERE date = "February 9" | sql_create_context |
CREATE TABLE table_1908049_1 (
league VARCHAR,
playoffs VARCHAR
) | in what playoffs the league was in the semifinals | SELECT league FROM table_1908049_1 WHERE playoffs = "Semifinals" | sql_create_context |
CREATE TABLE table_47159 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What location shows round was 1, and against Ricky Shivers? | SELECT "Location" FROM table_47159 WHERE "Round" = '1' AND "Opponent" = 'ricky shivers' | wikisql |
CREATE TABLE table_29218 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | where college is british columbia what are all the player | SELECT "Player" FROM table_29218 WHERE "College" = 'British Columbia' | wikisql |
CREATE TABLE table_38204 (
"Place" real,
"Nation" text,
"5 Hoops" real,
"3 Balls, 2 Ribbons" real,
"Total" real
) | Nation of bulgaria, and a Place larger than 1 had what highest 3 Balls, 2 Ribbons? | SELECT MAX("3 Balls, 2 Ribbons") FROM table_38204 WHERE "Nation" = 'bulgaria' AND "Place" > '1' | wikisql |
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
) | how many cities appear on this chart ? | SELECT COUNT("city") FROM table_203_731 | squall |
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.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '鲁宾鸿' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '鲁宾鸿' | css |
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... | provide the number of patients whose death status is 1 and primary disease is newborn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.diagnosis = "NEWBORN" | mimicsql_data |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE fare (
fare_id int,
from_airport va... | show me all flights from PITTSBURGH to BALTIMORE which leave thursday after 1500 o'clock pm | 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 ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_51957 (
"Year" text,
"Driver" text,
"Constructor" text,
"Location" text,
"Report" text
) | What is the constructor for Jackie Stewart's car? | SELECT "Constructor" FROM table_51957 WHERE "Driver" = 'jackie stewart' | wikisql |
CREATE TABLE table_2071644_2 (
web_thickness__mm_ VARCHAR,
flange_width__mm_ VARCHAR
) | What is the web thickness if the flange width is 100? | SELECT web_thickness__mm_ FROM table_2071644_2 WHERE flange_width__mm_ = 100 | sql_create_context |
CREATE TABLE table_41140 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | When was the last time, since December 14, 1986, that the attendance was lower than 47,096? | SELECT MAX("Week") FROM table_41140 WHERE "Date" = 'december 14, 1986' AND "Attendance" < '47,096' | wikisql |
CREATE TABLE table_70809 (
"Date" text,
"Course" text,
"Distance" text,
"Winner" text,
"Race Leader" text
) | Who is the winner of the Florence to Genoa course? | SELECT "Winner" FROM table_70809 WHERE "Course" = 'florence to genoa' | 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... | 列出编码为8988209的医院按不同的科室编码和出院诊断疾病名称所有医疗就诊记录中患者的平均年龄是哪些吗? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8988209' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '89... | css |
CREATE TABLE table_47941 (
"Tournament" text,
"Country" text,
"Location" text,
"Current Venue" text,
"Began" real,
"Court surface" text
) | What country was the Paris Masters tournament played in? | SELECT "Country" FROM table_47941 WHERE "Tournament" = 'paris masters' | wikisql |
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... | 孙文敏病患从07年9月1日到2018年9月21日之间所有检测结果指标记录的检测员为编码02458651的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 table_28691 (
"Role" text,
"Original Broadway Cast" text,
"2005 film" text,
"2008 Final Performance Film" text,
"Hollywood Bowl Cast" text,
"2011 Off-Broadway Revival" text
) | who was in the 2005 role when the original broadway cast was played by jesse l. martin? | SELECT "2005 film" FROM table_28691 WHERE "Original Broadway Cast" = 'Jesse L. Martin' | wikisql |
CREATE TABLE table_66410 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | How many lanes have a Time of 53.61, and a Rank larger than 3? | SELECT SUM("Lane") FROM table_66410 WHERE "Time" = '53.61' AND "Rank" > '3' | wikisql |
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numci... | What conferences does Noah A. Smith publish in ? | SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Noah A. Smith' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_17256857_1 (
fin_pos INTEGER,
points VARCHAR
) | Which position earned 50 points? | SELECT MAX(fin_pos) FROM table_17256857_1 WHERE points = "50" | sql_create_context |
CREATE TABLE table_204_567 (
id number,
"team" text,
"location" text,
"stadium" text,
"capacity" number,
"manager" text,
"captain" text,
"kit manufacturer" text,
"shirt sponsor" text
) | of those football venues containing the first and last name of a person as part of the name , which is in last place for seating capacity ? | SELECT "stadium" FROM table_204_567 ORDER BY "capacity" LIMIT 1 | squall |
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... | what is date of birth and diagnoses short title of subject name fernando wontor? | SELECT demographic.dob, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Fernando Wontor" | mimicsql_data |
CREATE TABLE table_11279 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | What chassis was used by roy salvadori? | SELECT "Chassis" FROM table_11279 WHERE "Driver" = 'roy salvadori' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
... | what is the name of the procedure that patient 73713 has undergone two or more times in 11/2105? | 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 = 737... | mimic_iii |
CREATE TABLE city (
city_id number,
city text,
hanzi text,
hanyu_pinyin text,
regional_population number,
gdp number
)
CREATE TABLE match (
match_id number,
date text,
venue text,
score text,
result text,
competition text
)
CREATE TABLE temperature (
city_id number,... | In February, which city marks the highest temperature? | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.feb DESC LIMIT 1 | spider |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, for manager_id, hire_date, visualize the trend, and I want to display by the x axis from high to low. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_203_148 (
id number,
"date" text,
"name" text,
"nationality" text,
"tonnage\n(grt)" number,
"fate" text
) | what was the number of tonnage for sweden ? | SELECT SUM("tonnage\n(grt)") FROM table_203_148 WHERE "nationality" = 'sweden' | squall |
CREATE TABLE table_43459 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | After week 2, how many people attended the game at Rich Stadium against the Miami Dolphins? | SELECT COUNT("Attendance") FROM table_43459 WHERE "Game Site" = 'rich stadium' AND "Opponent" = 'miami dolphins' AND "Week" > '2' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | since 411 days ago, when was the last time that patient 002-11679 had the minimum heartrate? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-11679')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
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
) | For those records from the products and each product's manufacturer, show me about the distribution of name and manufacturer , and group by attribute founder in a bar chart, and show by the bar from low to high. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY... | For those employees who was hired before 2002-06-21, find hire_date and the average of department_id bin hire_date by time, and visualize them by a bar chart, and display by the y-axis from high to low. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_name_76 (
time VARCHAR,
react VARCHAR,
athlete VARCHAR
) | What the time of Paul Hession with more than an 0.187 react? | SELECT time FROM table_name_76 WHERE react > 0.187 AND athlete = "paul hession" | sql_create_context |
CREATE TABLE table_204_54 (
id number,
"pondicherry assembly" text,
"duration" text,
"name of m.l.a." text,
"party affiliation" text,
"election year" number
) | how many were affiliated with the janata party ? | SELECT COUNT(*) FROM table_204_54 WHERE "party affiliation" = 'janata party' | squall |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
... | Sort your highly voted comments. | SELECT C.Id AS "comment_link", C.Score AS "comment_score", P.Score AS "post_score" FROM Comments AS C INNER JOIN Posts AS P ON P.Id = C.PostId WHERE C.UserId = @user AND C.Score >= 1 ORDER BY 'comment_score' DESC LIMIT @num | sede |
CREATE TABLE gyb (
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... | 患者99152621在2011年10月16日到2017年2月16日这个时间段一个在医疗机构1737840开了多少西药? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '99152621' AND t_kc22.STA_DATE BETWEEN '2011-10-16' AND '2017-02-16' AND qtb.MED_SER_ORG_NO = '1737840' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Review task - actions by one user. | SELECT tt.Name, rt.Name, rt.Description, COUNT(*) FROM ReviewTaskResults AS r INNER JOIN ReviewTaskResultTypes AS rt ON r.ReviewTaskResultTypeId = rt.Id INNER JOIN ReviewTasks AS t ON r.ReviewTaskId = t.Id INNER JOIN ReviewTaskTypes AS tt ON t.ReviewTaskTypeId = tt.Id WHERE r.CreationDate BETWEEN '2016-01-01' AND '2016... | sede |
CREATE TABLE table_5949 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff" text,
"Game site" text,
"Record" text,
"Match Report" text
) | Which Record has a Kickoff of 12:00pm cst, and a Game site of arrowhead stadium, and a Week of 15? | SELECT "Record" FROM table_5949 WHERE "Kickoff" = '12:00pm cst' AND "Game site" = 'arrowhead stadium' AND "Week" = '15' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 在号码是8450909的医院里按照不同的科室编码还有出院诊断疾病名称进行排列的医疗就诊记录中所有的患者们的平均年龄是多些啊? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8450909' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '84... | css |
CREATE TABLE table_79935 (
"Year" real,
"Awards" text,
"Categorie" text,
"Movie" text,
"Result" text
) | In what year was the movie 8 women up for a C sar Award? | SELECT MIN("Year") FROM table_79935 WHERE "Movie" = '8 women' AND "Awards" = 'césar award' | wikisql |
CREATE TABLE table_2846320_4 (
last_meeting VARCHAR,
name_of_rivalry VARCHAR
) | when was the ending time where the enemy met in the iron bowl | SELECT last_meeting FROM table_2846320_4 WHERE name_of_rivalry = "Iron Bowl" | sql_create_context |
CREATE TABLE table_203_187 (
id number,
"conference" text,
"bids" number,
"record" text,
"win %" number,
"quarterfinals" number,
"semifinals" number,
"final" number,
"champions" number
) | the independent conference and the colonial athletic association both received how many bids ? | SELECT "bids" FROM table_203_187 WHERE "conference" = 'independent' | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | For all employees who have the letters D or S in their first name, give me the trend about manager_id over hire_date , display in descending by the x-axis. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_53765 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest silver medal count when there is 1 Bronze medal and 1 Gold medal? | SELECT MAX("Silver") FROM table_53765 WHERE "Bronze" = '1' AND "Gold" = '1' | wikisql |
CREATE TABLE table_30094 (
"Series #" real,
"Season #" real,
"Title" text,
"Written by" text,
"Original air date" text,
"U.S. Viewers (millions)" text
) | What is the season number of the show written by both Kari Lizer and Jeff Astrof? | SELECT COUNT("Season #") FROM table_30094 WHERE "Written by" = 'Kari Lizer' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student_record (
student_... | What are the upper-level classes that offer 8 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 8 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_name_86 (
player VARCHAR,
round VARCHAR,
college_junior_club_team VARCHAR
) | Can you tell me the Player that has the Round smaller than 6, and the College/Junior/Club Team of hull olympiques (qmjhl)? | SELECT player FROM table_name_86 WHERE round < 6 AND college_junior_club_team = "hull olympiques (qmjhl)" | sql_create_context |
CREATE TABLE gyb (
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... | 把医院5697273所有的就诊记录记载的病人年龄的平均数根据科室的不同名字和出院时诊断的不同编码计算出来 | SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5697273' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5697273' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.... | css |
CREATE TABLE table_49642 (
"Governorate" text,
"Seats 2010" real,
"Seats 2005" real,
"In/de-creased by" real,
"Percentage in/de-crease" text
) | How many Seats 2005 has a Percentage in/de-crease of 50.0%, and a Governorate of dhi qar governorate, and a In/de-creased by larger than 6? | SELECT SUM("Seats 2005") FROM table_49642 WHERE "Percentage in/de-crease" = '50.0%' AND "Governorate" = 'dhi qar governorate' AND "In/de-creased by" > '6' | wikisql |
CREATE TABLE table_28021 (
"Agency" text,
"Route Number" text,
"North/East Terminal" text,
"South/West Terminal" text,
"More Information" text
) | Name the route number for santa rosa avenue | SELECT "Route Number" FROM table_28021 WHERE "North/East Terminal" = 'Santa Rosa Avenue' | wikisql |
CREATE TABLE table_13104 (
"Result" text,
"Opponent" text,
"Type" text,
"Rd., Time" text,
"Date" text
) | What was Tony Oakey's Rd., Time when he fought against hastings rasani? | SELECT "Rd., Time" FROM table_13104 WHERE "Opponent" = 'hastings rasani' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Tags (
Id number,
TagName text,
C... | Votes and Answers by Tag. | SELECT TagName, SUM(CASE WHEN VoteTypeId = 3 THEN 0 WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS Upvotes, SUM(CASE WHEN VoteTypeId = 3 THEN 1 WHEN VoteTypeId = 2 THEN 0 ELSE 0 END) AS Downvotes, SUM(CASE WHEN VoteTypeId = 3 THEN -1 WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS Score, COUNT(DISTINCT Posts.Id) AS Answers FROM T... | sede |
CREATE TABLE table_22014431_3 (
team_name VARCHAR,
tumbling VARCHAR
) | Which team names have 44.5 for tumbling? | SELECT team_name FROM table_22014431_3 WHERE tumbling = "44.5" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients are female? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" | mimicsql_data |
CREATE TABLE table_name_21 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
) | What is the score of the game with Grizzlies as the visitor team on 30 December 2007? | SELECT score FROM table_name_21 WHERE visitor = "grizzlies" AND date = "30 december 2007" | sql_create_context |
CREATE TABLE table_name_32 (
name_v_t_e VARCHAR,
jersey_number VARCHAR,
weight__kg_ VARCHAR,
position VARCHAR
) | What was the Name v t e, of the player whose Weight (kg) was 84, whose Position was D, and whose Jersey number was 2? | SELECT name_v_t_e FROM table_name_32 WHERE weight__kg_ = 84 AND position = "d" AND jersey_number = 2 | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 患者64170409以前有某些异常情况她还记得么? | (SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ... | css |
CREATE TABLE table_16319 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What player is on the Montreal Alouettes CFl team? | SELECT "Player" FROM table_16319 WHERE "CFL Team" = 'Montreal Alouettes' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
... | what are the top four commonly taken lab tests for patients 20s? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) GROUP BY labevents.itemid) AS ... | mimic_iii |
CREATE TABLE table_529 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
) | What was the callsign in Zamboanga? | SELECT "Callsign" FROM table_529 WHERE "Location" = 'Zamboanga' | wikisql |
CREATE TABLE table_name_98 (
district VARCHAR,
first_elected VARCHAR,
party VARCHAR
) | What district was a republican first elected in 2000? | SELECT district FROM table_name_98 WHERE first_elected = 2000 AND party = "republican" | sql_create_context |
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TAB... | How many residents does each property have? List property id and resident count. Visualize by scatter chart. | SELECT T1.property_id, COUNT(*) FROM Properties AS T1 JOIN Residents AS T2 ON T1.property_id = T2.property_id GROUP BY T1.property_id | nvbench |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of All_Home and the average of School_ID , and group by attribute All_Home, rank by the names in asc. | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home | nvbench |
CREATE TABLE table_10027 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | What is Date, when Opponent is 'Philadelphia 76ers'? | SELECT "Date" FROM table_10027 WHERE "Opponent" = 'philadelphia 76ers' | wikisql |
CREATE TABLE table_name_23 (
result VARCHAR,
location VARCHAR,
score VARCHAR
) | In guangzhou, who won the game with a score of 1-0? | SELECT result FROM table_name_23 WHERE location = "guangzhou" AND score = "1-0" | 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... | give me the number of patients whose insurance is government and procedure icd9 code is 3771? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.icd9_code = "3771" | mimicsql_data |
CREATE TABLE table_name_67 (
date VARCHAR,
pictorials VARCHAR
) | Which Date has a Pictorials of mercedes mcnab, girls of hawaiian tropic? | SELECT date FROM table_name_67 WHERE pictorials = "mercedes mcnab, girls of hawaiian tropic" | sql_create_context |
CREATE TABLE table_11391448_2 (
opponent VARCHAR,
week VARCHAR
) | How many teams did they play week 6 | SELECT COUNT(opponent) FROM table_11391448_2 WHERE week = 6 | sql_create_context |
CREATE TABLE program (
name VARCHAR,
origin VARCHAR
) | find the names of programs whose origin is not in Beijing. | SELECT name FROM program WHERE origin <> 'Beijing' | sql_create_context |
CREATE TABLE table_20928661_1 (
game VARCHAR,
record VARCHAR
) | Name the game for record being 3-0 | SELECT game FROM table_20928661_1 WHERE record = "3-0" | sql_create_context |
CREATE TABLE table_name_35 (
Id VARCHAR
) | What is listed for the 2005 that has a 2012 of 4.2%? | SELECT 2005 FROM table_name_35 WHERE 2012 = "4.2%" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | what are the five most common laboratory tests that patients had within 2 months after a diagnosis of s/p aortobifemoral bypass during the last year? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p aortobifemoral bypass' AND DATETIME(diagnosis.di... | eicu |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | how many times does patient 28443 since 178 months ago have flolan intake? | SELECT COUNT(*) 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 = 28443)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'flolan' AND ... | mimic_iii |
CREATE TABLE table_2395 (
"District" text,
"Capital City" text,
"Area (km\u00b2)" real,
"Area (sq.mi)" real,
"Population (2005 est)" real,
"2-letter abbreviation" text,
"3-letter abbreviation" text
) | What is the area in CZ? | SELECT MAX("Area (km\u00b2)") FROM table_2395 WHERE "2-letter abbreviation" = 'CZ' | wikisql |
CREATE TABLE table_name_37 (
administrative_panel INTEGER,
cultural_and_educational_panel VARCHAR,
nominated_by_the_taoiseach VARCHAR,
agricultural_panel VARCHAR
) | What is the biggest administrative panel with a nominated by the Taoiseach greater than 3 and an argricultural panel of 5, plust a cultural and educational panel larger than 2? | SELECT MAX(administrative_panel) FROM table_name_37 WHERE nominated_by_the_taoiseach > 3 AND agricultural_panel = 5 AND cultural_and_educational_panel > 2 | sql_create_context |
CREATE TABLE table_1710426_2 (
best_10_year_period VARCHAR,
best_15_year_period VARCHAR
) | Which people had the best 10-year period when Fischer had best 15-year period? | SELECT best_10_year_period FROM table_1710426_2 WHERE best_15_year_period = "Fischer" | sql_create_context |
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... | 统计一下在医疗机构2632106里,使用次数排在top19的项目 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '2632106' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 19 | css |
CREATE TABLE table_train_53 (
"id" int,
"immune_suppression" bool,
"need_hemodialysis" bool,
"steroid_therapy" bool,
"cardiogenic_shock" bool,
"hematologic_disease" bool,
"coronary_syndrome" bool,
"NOUSE" float
) | acute haematological malignancies | SELECT * FROM table_train_53 WHERE hematologic_disease = 1 | criteria2sql |
CREATE TABLE table_71998 (
"Region" text,
"Date" real,
"Label" text,
"Format" text,
"Catalog" text
) | When was Catalog CHD-9192 published? | SELECT "Date" FROM table_71998 WHERE "Catalog" = 'chd-9192' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Bar chart x axis date of birth y axis height, and could you list Y in descending order? | SELECT Date_of_Birth, Height FROM people ORDER BY Height DESC | nvbench |
CREATE TABLE table_32635 (
"FAT16" text,
"FAT32" text,
"HPFS" text,
"ISO 9660" text,
"NTFS" text,
"ReFS" text
) | Which ReFS has yes v3.0 for NTFS? | SELECT "ReFS" FROM table_32635 WHERE "NTFS" = 'yes v3.0' | wikisql |
CREATE TABLE table_14026 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | What actor has onderweg naar morgen, as the soap opera, with aafke couwenberg as the character? | SELECT "Actor" FROM table_14026 WHERE "Soap Opera" = 'onderweg naar morgen' AND "Character" = 'aafke couwenberg' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | what were the four most frequent lab tests those patients had in the same month after having had a insertion of venous catheter for hemodialysis - tunneled catheter procedure in 2104? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insertion of venous catheter for hemodialysis - tunn... | eicu |
CREATE TABLE table_59751 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | What shows for money ( ) when South Africa is the country? | SELECT MAX("Money ( \u00a3 )") FROM table_59751 WHERE "Country" = 'south africa' | wikisql |
CREATE TABLE table_name_81 (
gold INTEGER,
rank VARCHAR
) | What is the lowest gold medals of a rank 12 team? | SELECT MIN(gold) FROM table_name_81 WHERE rank = "12" | sql_create_context |
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,
... | 在医疗就诊44616393029里,患者陶乐容所有开具医疗项目的医师的编号和姓名均为什么? | SELECT t_kc22.HOSP_DOC_CD, t_kc22.HOSP_DOC_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '44616393029' | css |
CREATE TABLE table_61468 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Playing against Chelmsford City on 15 November 1986, who was the home team? | SELECT "Home team" FROM table_61468 WHERE "Date" = '15 november 1986' AND "Away team" = 'chelmsford city' | wikisql |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
) | What are the number of the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?, sort Y in ascending order. | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) | nvbench |
CREATE TABLE table_13877 (
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"Notes" text
) | Who had the time 13.6? | SELECT "Athlete" FROM table_13877 WHERE "Time" = '13.6' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients whose death status is 0 and procedure long title is incision of vessel, aorta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Incision of vessel, aorta" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.