context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
count the number of patients whose admission type is newborn and lab test item id is 50801.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "50801"
mimicsql_data
CREATE TABLE albums ( aid number, title text, year number, label text, type text ) CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE songs ( songid num...
Find all the songs that do not have a lead vocal.
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "lead"
spider
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Unanswered or non-canon answered HP questions.
SELECT Posts.Title, TagName FROM Tags, Posts WHERE TagName LIKE 'Harry-Potter' LIMIT 50
sede
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 medication ( medi...
did patient 031-16123 undergo a cultures - blood procedure?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND treatment.treatmentname = 'cultures - blood'
eicu
CREATE TABLE table_203_873 ( id number, "model name" text, "length" text, "width" text, "height" text, "riders" number, "capacity" number, "description" text, "portable" text, "notes" number )
what is the number of capacity that mega disk ' o is able to hold ?
SELECT "capacity" FROM table_203_873 WHERE "model name" = "mega disk'o"
squall
CREATE TABLE table_22180 ( "Season" real, "Average Attendance Home" text, "Highest Attendance Home" text, "Average Attendance Away" text, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" text )
In which division did they compete in 2012?
SELECT "Division / Section" FROM table_22180 WHERE "Season" = '2012'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TA...
i would like an afternoon flight from DENVER COLORADO to DALLAS TEXAS
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city...
atis
CREATE TABLE table_2421 ( "Political parties" text, "% 2006" text, "Seats 2006" real, "% 2001" text, "Seats 2001" real, "% 1997" text )
How many political parties had a %2006 rating of 43.5?
SELECT COUNT("Political parties") FROM table_2421 WHERE "% 2006" = '43.5'
wikisql
CREATE TABLE table_name_44 ( res VARCHAR, round VARCHAR, opponent VARCHAR )
What is the result for rounds under 2 against D.J. Linderman?
SELECT res FROM table_name_44 WHERE round < 2 AND opponent = "d.j. linderman"
sql_create_context
CREATE TABLE table_name_20 ( round INTEGER, school_club_team VARCHAR )
Which Round is the lowest one that has a School/Club Team of virginia?
SELECT MIN(round) FROM table_name_20 WHERE school_club_team = "virginia"
sql_create_context
CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age...
Show different nationalities along with the number of hosts of each nationality Visualize by bar chart, I want to list in ascending by the x-axis.
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_name_42 ( pick__number INTEGER, cfl_team VARCHAR )
what is the highest pick number of the CFL team, the winnipeg blue bombers?
SELECT MAX(pick__number) FROM table_name_42 WHERE cfl_team = "winnipeg blue bombers"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
count the number of patients who have been dead after having been diagnosed with metabolic acidosis - due to bicarbonate loss during the same hospital visit in a year before.
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
has any microbiological test been performed on patient 55281's sputum in 12/2105?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281) AND microbiologyevents.spec_type_desc = 'sputum' AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2105-12'
mimic_iii
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 ( ...
Count the average age of patients who are still living with a known history of st elevation myocardial infarction/cardiac catheterization as the primary disease.
SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_name_57 ( studio_s_ VARCHAR, year VARCHAR, director VARCHAR )
What studio had the director Peter Lord Nick Park before 2004?
SELECT studio_s_ FROM table_name_57 WHERE year < 2004 AND director = "peter lord nick park"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardi...
count the number of patients who were prescribed lr within 2 months after being diagnosed with crnry athrscl natve vssl since 2105.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'crnry athrscl natv...
mimic_iii
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 ...
患者63825529的842142指标在06年12月24日到11年5月11日期间是怎样的
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_66647 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
What is the Game with a Record of 19-15?
SELECT "Game" FROM table_66647 WHERE "Record" = '19-15'
wikisql
CREATE TABLE table_name_99 ( total INTEGER, silver VARCHAR, gold VARCHAR )
What is the lowest Total, when Silver is greater than 7, and when Gold is greater than 73?
SELECT MIN(total) FROM table_name_99 WHERE silver > 7 AND gold > 73
sql_create_context
CREATE TABLE table_26486 ( "Year" real, "Putri Pariwisata Indonesia" text, "1st Runner Up" text, "2nd Runner Up" text, "3rd Runner Up" text, "4th Runner Up" text )
List the number of runners up when albertina fransisca mailoa won the putri pariwisata contest?
SELECT COUNT("3rd Runner Up") FROM table_26486 WHERE "Putri Pariwisata Indonesia" = 'Albertina Fransisca Mailoa'
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_NM = '矽肺壹期'
css
CREATE TABLE table_name_58 ( pick INTEGER, name VARCHAR, overall VARCHAR )
What is the pick of Charley Taylor, who has an overall greater than 3?
SELECT SUM(pick) FROM table_name_58 WHERE name = "charley taylor" AND overall > 3
sql_create_context
CREATE TABLE table_61669 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Place has a Player of bernhard langer?
SELECT "Place" FROM table_61669 WHERE "Player" = 'bernhard langer'
wikisql
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
Group and count brand for each camera lens using a bar chart, sort by the bar in ascending.
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY brand
nvbench
CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_...
A bar chart for what are the number of the purchase details of transactions with amount bigger than 10000?, and could you rank in asc by the the number of purchase details?
SELECT purchase_details, COUNT(purchase_details) FROM Purchases AS T1 JOIN Transactions AS T2 ON T1.purchase_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction > 10000 GROUP BY purchase_details ORDER BY COUNT(purchase_details)
nvbench
CREATE TABLE table_74490 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" real, "Regional Finals" real )
What is the average Regional Finals score when the record is 3-2 and there are more than 3 bids?
SELECT AVG("Regional Finals") FROM table_74490 WHERE "Record" = '3-2' AND "# of Bids" > '3'
wikisql
CREATE TABLE table_name_36 ( result VARCHAR, attendance VARCHAR )
What was the final score (result) for the game where 51,100 attended?
SELECT result FROM table_name_36 WHERE attendance = "51,100"
sql_create_context
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(...
On what dates were employees without the letter M in their first names hired, and count them by a bar chart, and list y axis from high to low order please.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_71381 ( "Polling Firm" text, "Date" text, "Link" text, "PSOE" text, "Others" text, "Lead" text )
Which date has a PSOE of 36.1%?
SELECT "Date" FROM table_71381 WHERE "PSOE" = '36.1%'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, ...
Are any of my last classes ULCS classes ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%ULCS%' AND student_record.student_id = 1
advising
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
在二零二一年七月一号以前的住院就诊记录中有哪些是编号为22200311的患者对应的检验报告单?住院就诊的流水号能列出来吗?
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '22200311' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2021-07-01' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_17122 ( "Year" real, "B\u00f6tzow" text, "Schwante" text, "Vehlefanz" text, "Neu-Vehlefanz" real, "Marwitz" text, "B\u00e4renklau" text, "Eichst\u00e4dt" real )
How many years where Eichst dt had a number of 939?
SELECT COUNT("Year") FROM table_17122 WHERE "Eichst\u00e4dt" = '939'
wikisql
CREATE TABLE table_name_51 ( kv_85_m1943 VARCHAR, kv_1s_m1942 VARCHAR )
What's the KV-85 when the KV-1S is 45?
SELECT kv_85_m1943 FROM table_name_51 WHERE kv_1s_m1942 = "45"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, ...
amount of posts per day.
SELECT ROW_NUMBER() OVER (ORDER BY MIN(CreationDate)) AS rowNumber, COUNT(*) AS amount, DATE(MIN(CreationDate)) AS date FROM Posts WHERE OwnerUserId = '##UserId##' AND CreationDate BETWEEN '2008-08-01' AND '2008-08-17' GROUP BY DATE(CreationDate) ORDER BY MIN(CreationDate)
sede
CREATE TABLE table_test_13 ( "id" int, "systolic_blood_pressure_sbp" int, "tachycardia" int, "diastolic_blood_pressure_dbp" int, "total_cholesterol" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "serum_creatinine" float, "alcohol_abuse" bool, "drug_abuse" bool, "body_mas...
systolic blood pressure < 140 mmhg
SELECT * FROM table_test_13 WHERE systolic_blood_pressure_sbp < 140
criteria2sql
CREATE TABLE table_name_98 ( owner VARCHAR, built VARCHAR )
Who is the owner that built in 2009-2011?
SELECT owner FROM table_name_98 WHERE built = "2009-2011"
sql_create_context
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 mzjzjlb ( HXPLC number, HZXM ...
列出患者赵宏义的所有检验结果指标记录在2014-02-10到2019-02-10内的检测人为56821852的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_i...
css
CREATE TABLE table_73630 ( "Institution" text, "Location" text, "Team Name" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Year Joined" real )
What is the location when founded was 1957?
SELECT "Location" FROM table_73630 WHERE "Founded" = '1957'
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, ...
编码为6222694的医院中苏馨欣病患的出院科室名称中不包含整形外科的住院就诊记录分别是那几条?
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_49201 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
What are the Jersey numbers for Notre Dame?
SELECT "Jersey Number(s)" FROM table_49201 WHERE "From" = 'notre dame'
wikisql
CREATE TABLE table_8612 ( "Peak" text, "Location" text, "Height (m)" real, "Prominence (m)" real, "Col (m)" real )
What is the height when col is 1,077 and prominence is more than 2,349?
SELECT AVG("Height (m)") FROM table_8612 WHERE "Col (m)" = '1,077' AND "Prominence (m)" > '2,349'
wikisql
CREATE TABLE table_name_99 ( driver VARCHAR, points VARCHAR )
What Driver had 50+3 Points?
SELECT driver FROM table_name_99 WHERE points = "50+3"
sql_create_context
CREATE TABLE table_67510 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score of the game that had a loss of Embree (1-2)?
SELECT "Score" FROM table_67510 WHERE "Loss" = 'embree (1-2)'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE T...
All Answerers for a Given Tag with a Minimum Reputation of .... The Stats of a Tag only gives the Top-20 answerers. This query can list more of them and give other info as well.
SELECT Users.Id AS "user_link", DisplayName, MAX(Age) AS Age, MAX(Location) AS Location, MAX(WebsiteUrl) AS Website, MAX(Reputation) AS Rep, COUNT(Answers.Id) AS Answers, SUM(Answers.Score) AS Score, CAST(AVG(CAST(Answers.Score AS FLOAT)) AS FLOAT(6, 1)) AS "avg" FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id JOIN...
sede
CREATE TABLE table_2594 ( "Year" text, "Day" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
On what day was the race that Cale Yarborough won in 364 laps?
SELECT "Day" FROM table_2594 WHERE "Laps" = '364' AND "Driver" = 'Cale Yarborough'
wikisql
CREATE TABLE table_41392 ( "Year" real, "Senior PGA Championship" text, "The Tradition" text, "Senior Players Championship" text, "U.S. Senior Open" text, "Senior British Open" text )
When Mark O'meara was the senior player champion in a year greater than 1998, who was the tradition?
SELECT "The Tradition" FROM table_41392 WHERE "Year" > '1998' AND "Senior Players Championship" = 'mark o''meara'
wikisql
CREATE TABLE table_9512 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the most losses for positions under 15 and 66 goals against?
SELECT MAX("Lost") FROM table_9512 WHERE "Goals Against" = '66' AND "Position" < '15'
wikisql
CREATE TABLE table_name_36 ( crowd INTEGER, venue VARCHAR )
What is the fewest number of attendees at Kardinia Park?
SELECT MIN(crowd) FROM table_name_36 WHERE venue = "kardinia park"
sql_create_context
CREATE TABLE table_17975 ( "Value" text, "Diameter" text, "Thickness" text, "Mass" text, "Composition" text, "Edge" text, "Obverse" text, "Reverse" text, "first minting" real, "issue" text, "withdrawal" text, "lapse" text )
How many coins have a diameter of 23mm?
SELECT COUNT("Reverse") FROM table_17975 WHERE "Diameter" = '23mm'
wikisql
CREATE TABLE table_52057 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the attendance of week 8?
SELECT "Attendance" FROM table_52057 WHERE "Week" = '8'
wikisql
CREATE TABLE table_12219 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is Record, when Date is 'April 24'?
SELECT "Record" FROM table_12219 WHERE "Date" = 'april 24'
wikisql
CREATE TABLE trust ( source_u_id integer, target_u_id integer, trust integer ) CREATE TABLE item ( i_id integer, title varchar(20) ) CREATE TABLE review ( a_id integer, u_id integer, i_id integer, rating integer, rank integer ) CREATE TABLE useracct ( u_id integer, nam...
Find each target user's name and average trust score. Show a pie chart.
SELECT name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
患者64014857的身高和体重分别是多少?
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz...
css
CREATE TABLE table_23264 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the incumbent for north carolina 9
SELECT "Incumbent" FROM table_23264 WHERE "District" = 'North Carolina 9'
wikisql
CREATE TABLE table_5363 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What is the played value with 51 points?
SELECT "Played" FROM table_5363 WHERE "Points" = '51'
wikisql
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.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '赵怡宁'
css
CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) CREATE TABLE teachers ( lastname text, firstname text, classroom number )
Find the number of teachers who teach the student called CHRISSY NABOZNY.
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY"
spider
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Average answer length (and min and max).
SELECT (TIME_TO_STR(p.CreationDate, '%y') + (TIME_TO_STR(p.CreationDate, '%W') - 1) / 52.0) AS YR_WK, MIN(LENGTH(p.Body)) AS "min", AVG(LENGTH(p.Body)) AS "average", MAX(LENGTH(p.Body)) AS "max" FROM Users AS u, Posts AS p WHERE p.PostTypeId = 2 AND p.Score > 0 AND p.CreationDate >= '2015-01-01 00:00' GROUP BY (TIME_TO...
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...
患者07451583在编号为6810321的医院有哪些出院诊断结果是姓钱的医生诊断的
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '07451583' AND qtb.MED_SER_ORG_NO = '6810321' AND qtb.OUT_DIAG_DOC_NM LIKE '钱%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '07451583' AND gyb.MED_SER_ORG_NO = '6810321' AND gyb.OUT_DIAG_DOC_NM LIKE '...
css
CREATE TABLE table_28195898_1 ( written_by VARCHAR, directed_by VARCHAR )
Who wrote the episode which was directed by Nick Marck?
SELECT written_by FROM table_28195898_1 WHERE directed_by = "Nick Marck"
sql_create_context
CREATE TABLE table_22464308_2 ( points_classification VARCHAR, stage VARCHAR )
Which points classification has 4 as the stage?
SELECT points_classification FROM table_22464308_2 WHERE stage = 4
sql_create_context
CREATE TABLE table_test_29 ( "id" int, "bleeding" int, "left_ventricular_ejection_fraction_lvef" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "trauma" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "hemorrhagic_stroke" ...
kidney failure ( creatinin > 140 )
SELECT * FROM table_test_29 WHERE kidney_disease = 1 OR creatinine_clearance_cl > 140
criteria2sql
CREATE TABLE table_35389 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What was the pick number for Deji Karim, in a round lower than 6?
SELECT AVG("Pick #") FROM table_35389 WHERE "Name" = 'deji karim' AND "Round" < '6'
wikisql
CREATE TABLE table_name_66 ( country VARCHAR, lane VARCHAR )
Tell me the country for lane of 6
SELECT country FROM table_name_66 WHERE lane = 6
sql_create_context
CREATE TABLE table_name_95 ( withdrawal VARCHAR, sr_number VARCHAR, lb VARCHAR, sc_number VARCHAR )
what is the withdrawal when the lb&sc number is less than 16 and the s.r. number is 2011?
SELECT withdrawal FROM table_name_95 WHERE lb & sc_number < 16 AND sr_number = 2011
sql_create_context
CREATE TABLE table_59510 ( "School" text, "Suburb/Town" text, "Years" text, "Founded" real, "Website" text )
Which website has 1921 as the year founded?
SELECT "Website" FROM table_59510 WHERE "Founded" = '1921'
wikisql
CREATE TABLE table_53502 ( "Location" text, "Londonborough" text, "Post town" text, "Postcodedistrict" text, "Dialcode" text )
What is the name of the Post code district that is in Eden Park?
SELECT "Postcodedistrict" FROM table_53502 WHERE "Location" = 'eden park'
wikisql
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...
Top Flutter users in Ireland.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_45706 ( "Date" text, "Opponent" text, "Site" text, "Result" text, "Attendance" text )
What is the attendance for the t7-7 result?
SELECT "Attendance" FROM table_45706 WHERE "Result" = 't7-7'
wikisql
CREATE TABLE table_name_31 ( rank INTEGER, runner__up INTEGER )
Which Rank has a Runner -up smaller than 0?
SELECT MAX(rank) FROM table_name_31 WHERE runner__up < 0
sql_create_context
CREATE TABLE table_68101 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
which election year has henry wyndham as the 2nd member and walter barttelot as 1st member?
SELECT "Election" FROM table_68101 WHERE "2nd Member" = 'henry wyndham' AND "1st Member" = 'walter barttelot'
wikisql
CREATE TABLE table_52990 ( "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text )
How many rounds did geoff lees drive with chassis of n180?
SELECT "Rounds" FROM table_52990 WHERE "Chassis" = 'n180' AND "Driver" = 'geoff lees'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid ...
was there any microbiology tests until 1 year ago for the bronchial lavage of patient 031-19622?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622')) AND microlab.culturesite = 'bronchial lavage' AND DATETIME(microlab.c...
eicu
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
从08年7月20日到13年10月17日这段时间里,患者38917711所有检验结果指标记录中的检测方法都有什么啊?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH =...
css
CREATE TABLE table_45951 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text )
What is No.1, when No. 2 is Emma, and when No. 7 is Olivia?
SELECT "No. 1" FROM table_45951 WHERE "No. 2" = 'emma' AND "No. 7" = 'olivia'
wikisql
CREATE TABLE Customer_Payments ( customer_id INTEGER, datetime_payment DATETIME, payment_method_code VARCHAR(10), amount_payment DOUBLE ) CREATE TABLE Staff ( staff_id INTEGER, staff_address_id INTEGER, nickname VARCHAR(80), first_name VARCHAR(80), middle_name VARCHAR(80), last_...
List all customer status codes and the number of customers having each status code in a bar chart.
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code
nvbench
CREATE TABLE table_name_51 ( weight_of_shot VARCHAR, designation__bore_ VARCHAR )
what is the weight of a shot that is xx-inch?
SELECT weight_of_shot FROM table_name_51 WHERE designation__bore_ = "xx-inch"
sql_create_context
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, a bar chart shows the distribution of name and the average of code , and group by attribute name, and display in desc by the X please.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TA...
Total answers and Accepted Answers By Date.
SELECT Users.DisplayName AS "user_name", COUNT(DISTINCT answer.Id) AS "total_answers", COUNT(DISTINCT question.Id) AS "accepted_answers" FROM Posts AS answer LEFT OUTER JOIN Posts AS question ON question.AcceptedAnswerId = answer.Id INNER JOIN Users ON answer.OwnerUserId = Users.Id INNER JOIN PostTags ON answer.ParentI...
sede
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartments ( apt_id INTEGER, ...
What is the number of booking end dates of the apartments with type code 'Duplex' in each year? Return a bar chart.
SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex"
nvbench
CREATE TABLE table_55005 ( "Year" text, "Make & Model" text, "Length" text, "Engine Type" text, "Numbers" text )
What is the length for a diesel engine with numbers of tbd (13 buses)?
SELECT "Length" FROM table_55005 WHERE "Engine Type" = 'diesel' AND "Numbers" = 'tbd (13 buses)'
wikisql
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) ...
papers by oren etzioni
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'oren etzioni' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_42120 ( "City" text, "State" text, "AAM Accredited" text, "AAM Member" text, "ASTC Member" text )
What is ASTC Member, when State is Arkansas, when AAM Member is No, and when AAM Accredited is Yes?
SELECT "ASTC Member" FROM table_42120 WHERE "State" = 'arkansas' AND "AAM Member" = 'no' AND "AAM Accredited" = 'yes'
wikisql
CREATE TABLE table_16531 ( "Year" real, "Numer of Jamaicans granted British citizenship" real, "Naturalisation by residence" real, "Naturalisation by marriage" real, "Registration of a minor child" real, "Registration by other means" real )
how many numer of jamaicans granted british citizenship with naturalisation by marriage being 1060
SELECT COUNT("Numer of Jamaicans granted British citizenship") FROM table_16531 WHERE "Naturalisation by marriage" = '1060'
wikisql
CREATE TABLE table_204_234 ( id number, "round" text, "100 yd (91 m)" text, "80 yd (73 m)" text, "60 yd (55 m)" text, "50 yd (46 m)" text, "40 yd (37 m)" text )
who shot the best 73 m
SELECT "round" FROM table_204_234 ORDER BY "80 yd (73 m)" DESC LIMIT 1
squall
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 ReviewTaskTypes ( Id number, Name tex...
Top 100 User of Bhubaneswar.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bhubaneswar%' ORDER BY Reputation DESC LIMIT 100
sede
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what dose of calcium gluconate was last prescribed to patient 95470 since 12/2102?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95470) AND prescriptions.drug = 'calcium gluconate' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2102-12' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_65 ( driver VARCHAR, entrant VARCHAR )
Who is the drive for an Entrant of Scuderia Ambrosiana?
SELECT driver FROM table_name_65 WHERE entrant = "scuderia ambrosiana"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departu...
show me CO flights from CHICAGO to SEATTLE on saturday morning
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND date_day.day_number = 26 AND date_day.month_number = 7 AND...
atis
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...
从13年1月21日到20年1月10日医疗机构0655890统筹金额消耗量是多少?
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0655890' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-01-21' AND '2020-01-10'
css
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 admission type and date of death of subject id 2560?
SELECT demographic.admission_type, demographic.dod FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE ...
i would like to leave early in the morning
SELECT DISTINCT flight_id FROM flight WHERE departure_time BETWEEN 0 AND 800
atis
CREATE TABLE table_11287 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the average Lap of damon hill, with a Grid smaller than 1?
SELECT AVG("Laps") FROM table_11287 WHERE "Driver" = 'damon hill' AND "Grid" < '1'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description v...
Are there any ULCS courses in the courses I 've taken ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON student_record.course_id = program_course.course_id WHERE program_course.category LIKE '%ULCS%' AND student_record.student_id = 1
advising
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...
give me the number of patients born before 2060 who had ascitic fluid lab test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2060" AND lab.fluid = "Ascites"
mimicsql_data
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...
how many patients whose primary disease is pituitary bleed and year of death is less than or equal to 2138?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dod_year <= "2138.0"
mimicsql_data
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...
what is item id of subject id 2560?
SELECT lab.itemid FROM lab WHERE lab.subject_id = "2560"
mimicsql_data
CREATE TABLE table_25952 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What's the minimal number of points scored in any game?
SELECT MIN("Points") FROM table_25952
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, pat...
what was the name of the specimen test that patient 031-3355 had first received in this hospital encounter?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) ORDER BY microla...
eicu