context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of price , and group by attribute name, and I want to rank y-axis from high to low order.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
In Winter 2019 , is there a 13 -credit upper level class ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.credits = 13 AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Winter' AND s...
advising
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE va...
Show me a bar chart for what is the total credit does each department offer?, order y-axis in desc order please.
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY SUM(CRS_CREDIT) DESC
nvbench
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, ...
把杨学名住在医院0347215期间的记录里出院科室名字和骨关节无关的记载列出来
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_12729 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the Away team of the Merthyr Tydfil Home game with a Score of 1 1?
SELECT "Away team" FROM table_12729 WHERE "Score" = '1–1' AND "Home team" = 'merthyr tydfil'
wikisql
CREATE TABLE table_17104539_10 ( score VARCHAR, date VARCHAR )
On July 8, what was the score?
SELECT score FROM table_17104539_10 WHERE date = "July 8"
sql_create_context
CREATE TABLE table_68003 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the margin of victory when Mark Calcavecchia was the runner-up?
SELECT "Margin of victory" FROM table_68003 WHERE "Runner(s)-up" = 'mark calcavecchia'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_type_code VARCHAR(20), address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, gender VA...
List the name of all products along with the number of complaints that they have received with a bar chart, and show from high to low by the Y-axis.
SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY COUNT(*) DESC
nvbench
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, ...
患者秦茉莉在门诊诊断为疾病O29.001时的二氧化碳结果定量及单位分别是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = j...
css
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
what were the three most frequent medications prescribed to the patients of the 40s within the same hospital visit after they were diagnosed with pressure sore - stage 4 since 2103?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pressure sore -...
eicu
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
how many patients are staying at ward 32 until 4 years ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 32 AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-4 year'))
mimic_iii
CREATE TABLE table_name_94 ( goals_against INTEGER, goals_for VARCHAR, goal_difference VARCHAR )
What is the highest number of goals against when the number of goals were 55 and the difference was +24?
SELECT MAX(goals_against) FROM table_name_94 WHERE goals_for > 55 AND goal_difference = "+24"
sql_create_context
CREATE TABLE table_16388478_3 ( away_team VARCHAR, home_team VARCHAR )
What score did the away team receive against home team Port Adelaide?
SELECT away_team AS score FROM table_16388478_3 WHERE home_team = "Port Adelaide"
sql_create_context
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
在医院2864800编码为01420537的患者入院诊断疾病名称不包含脑瘫的医疗就诊记录编码是什么?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '01420537' AND qtb.MED_SER_ORG_NO = '2864800' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%脑瘫%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '01420537' AND gyb.MED_SER_ORG_NO = '2864800' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%脑瘫%' UNION SELECT zyb.MED_CLINIC_ID F...
css
CREATE TABLE table_43065 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1990\u20131991 Team" text )
What is the highest Weight for the position of D, and the 1990 1991 Team was the chicago blackhawks?
SELECT MAX("Weight (kg)") FROM table_43065 WHERE "Position" = 'd' AND "1990\u20131991 Team" = 'chicago blackhawks'
wikisql
CREATE TABLE table_name_47 ( duration VARCHAR, province VARCHAR )
What is the duration of the commissioner from the zeeland province?
SELECT duration FROM table_name_47 WHERE province = "zeeland"
sql_create_context
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, ...
How many papers does james fogarty have in uist ?
SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'james fogarty' AND venue.venueid = paper.venueid AND venue.venuename = 'uist' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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 d_icd_diagnoses ( row_id number, icd9_code text, ...
when did patient 21110 for the first time this year be admitted via the emergency room admit into the hospital?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 21110 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is procedure long title of procedure icd9 code 3613?
SELECT procedures.long_title FROM procedures WHERE procedures.icd9_code = "3613"
mimicsql_data
CREATE TABLE table_58464 ( "Number & Name" text, "Description" text, "Livery" text, "Owner(s)" text, "Date" text )
What is the date of the British Rail class 111 tslrb description?
SELECT "Date" FROM table_58464 WHERE "Description" = 'british rail class 111 tslrb'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what are the three most commonly given diagnoses for patients who were previously diagnosed with agitation - severe in the same month, until 2104?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 'agitation - severe' AND STRFTIME('%y', d...
eicu
CREATE TABLE Drama_Workshop_Groups ( Workshop_Group_ID INTEGER, Address_ID INTEGER, Currency_Code CHAR(15), Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Bookings_Services ( ...
Give me a bar chart for mean product price of each product name, I want to sort from high to low by the Y-axis.
SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY AVG(Product_Price) DESC
nvbench
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...
83368624588住院就诊中,查询门诊的中医诊断的编号
SELECT MZZYZDZZBM FROM zyjzjlb WHERE JZLSH = '83368624588'
css
CREATE TABLE table_name_52 ( t_score VARCHAR, e_score VARCHAR )
What is the T score of the team with an E score of 6.625?
SELECT t_score FROM table_name_52 WHERE e_score = 6.625
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
questions to edit or close.
SELECT 'https://movies.stackexchange.com/questions/' + CAST(Id AS VARCHAR(50)) AS link, Score FROM Posts WHERE PostTypeId = 1 AND DeletionDate IS NULL AND ClosedDate IS NULL AND CreationDate <= DATEADD(mm, -2, GETDATE()) AND LastEditDate <= DATEADD(mm, -2, GETDATE()) ORDER BY Score
sede
CREATE TABLE table_66096 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Time" real )
What is the average time with a rank lower than 2 for Andy Turner?
SELECT AVG("Time") FROM table_66096 WHERE "Rank" > '2' AND "Name" = 'andy turner'
wikisql
CREATE TABLE table_39253 ( "Rank" real, "Town" text, "Population" real, "Year" real, "Borough" text, "Definition" text )
Which Definition has a Rank smaller than 12, and a Town of tadcaster?
SELECT "Definition" FROM table_39253 WHERE "Rank" < '12' AND "Town" = 'tadcaster'
wikisql
CREATE TABLE table_name_64 ( date VARCHAR, loss VARCHAR )
When did tav rez lose?
SELECT date FROM table_name_64 WHERE loss = "tavárez"
sql_create_context
CREATE TABLE table_51709 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
In what week was the Result L 15-13?
SELECT AVG("Week") FROM table_51709 WHERE "Result" = 'l 15-13'
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 )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of revenue , and group by attribute name, list by the total number in asc.
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
count the number of patients diagnosed with headache - severe who did not come to the hospital within 2 months since 6 years ago.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'headache - severe' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-6 year')) AS ...
eicu
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
what is the minimum total bilirubin value on the last hospital encounter for patient 021-83942?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-83942' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital...
eicu
CREATE TABLE table_14260687_3 ( android VARCHAR, quarter VARCHAR )
During the quarter 2012 Q4, how many millions of android phones were shipped?
SELECT COUNT(android) FROM table_14260687_3 WHERE quarter = "2012 Q4"
sql_create_context
CREATE TABLE table_32677 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home team's score at the game where Richmond was the away team?
SELECT "Home team score" FROM table_32677 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_204_414 ( id number, "name" text, "armenian" text, "location" text, "# of prisoners designed for" number, "notes" text )
which is the smallest prison on the list ?
SELECT "name" FROM table_204_414 ORDER BY "# of prisoners designed for" LIMIT 1
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
when was patient 002-58884 prescribed for the first time the last month a medication via subq route?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884')) AND medication.routeadmin = 'subq' AND DATETIME(m...
eicu
CREATE TABLE table_69527 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the highest total number of medals associated with 1 gold, more than 0 silver, and 2 bronze?
SELECT MAX("Total") FROM table_69527 WHERE "Bronze" = '2' AND "Gold" = '1' AND "Silver" > '0'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
until 2 years ago what are the top five most common diagnoses that patients were given in the same month after diagnosis of paralysis agitans?
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
How many of the patients died in or before the year 2122?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2122.0"
mimicsql_data
CREATE TABLE table_37226 ( "Year" real, "Title" text, "Role" text, "Producer" text, "Director" text )
What title has a producer of MAQ and Anna as a role?
SELECT "Title" FROM table_37226 WHERE "Producer" = 'maq' AND "Role" = 'anna'
wikisql
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...
列举出病患苏兰娜在06年7月30日到19年10月4日内被开出的所有检验报告单的名称以及科室编号是什么?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_...
css
CREATE TABLE table_16508 ( "Hand" text, "1 credit" real, "2 credits" real, "3 credits" real, "4 credits" real, "5 credits" text )
What is the hand for 4 credits is 1600?
SELECT "Hand" FROM table_16508 WHERE "4 credits" = '1600'
wikisql
CREATE TABLE table_203_254 ( id number, "position" number, "team" text, "points" number, "played" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "difference" number )
what is the only team to have scored 16 points ?
SELECT "team" FROM table_203_254 WHERE "points" = 16
squall
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...
在医院4746068中,按照出院诊断疾病名称列出不同疾病的平均患者年龄
SELECT qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4746068' GROUP BY qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4746068' GROUP BY gyb.OUT_DIAG_DIS_NM UNION SELECT zyb.OUT_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
09967594504好在医疗就诊期间开出的医疗发票项目类别药品3338是哪类?
SELECT t_kc22.MED_INV_ITEM_TYPE 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 = '09967594504' AND t_kc22.SOC_SRT_DIRE_CD = '3338'
css
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
what is the cost for these flights from BALTIMORE to PHILADELPHIA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci...
atis
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 procedures ( ...
give me the number of patients whose admission type is urgent and procedure icd9 code is 12?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "12"
mimicsql_data
CREATE TABLE table_26160007_1 ( total_trade VARCHAR, exports VARCHAR )
Where the exports is 13,608.65, what is the total trade?
SELECT total_trade FROM table_26160007_1 WHERE exports = "13,608.65"
sql_create_context
CREATE TABLE table_16556 ( "Season" real, "Grand FinalDate" text, "WinningTeam" text, "Score" text, "LosingTeam" text, "Location" text, "GF Attendance" real, "Clive Churchill Medal" text )
How many teams lost at the sydney football stadium, sydney (11)?
SELECT COUNT("LosingTeam") FROM table_16556 WHERE "Location" = 'Sydney Football Stadium, Sydney (11)'
wikisql
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...
门诊诊断病人方鹏云为精神分裂症的检测指标162731的结果定量及其单位各是什么呀?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE a...
when did until 12 months ago patient 031-23724 last get a blood, venipuncture microbiology test?
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND...
eicu
CREATE TABLE table_56858 ( "Name" text, "City" text, "Height (m)" real, "Height (ft)" real, "Floors" real, "Years as tallest" text )
How high was the highest building in feet in the city of cologne?
SELECT MAX("Height (ft)") FROM table_56858 WHERE "City" = 'cologne'
wikisql
CREATE TABLE table_67185 ( "Year" real, "Class" text, "Team" text, "Points" real, "Rank" text, "Wins" real )
Name the least year for wins more than 0
SELECT MIN("Year") FROM table_67185 WHERE "Wins" > '0'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(50), customer_middle_initial VARCHAR(1), customer_last_name VARCHAR(50), gender VARCHAR(1), email_address VARCHAR(255), login_name VARCHAR(80), login_password VARCHAR(20), phone_number VARCHAR(255), town_ci...
Show sum transaction amount from each transaction type, could you order in ascending by the X?
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type
nvbench
CREATE TABLE table_name_77 ( format VARCHAR, date VARCHAR )
Which format is released on May 27, 2009?
SELECT format FROM table_name_77 WHERE date = "may 27, 2009"
sql_create_context
CREATE TABLE table_9701 ( "Year" real, "Association" text, "Category" text, "Nominee" text, "Result" text )
What was the association for Indonesian Idol after 2005 with a Nominated Result?
SELECT "Association" FROM table_9701 WHERE "Nominee" = 'indonesian idol' AND "Year" > '2005' AND "Result" = 'nominated'
wikisql
CREATE TABLE table_25393 ( "Team" text, "SEC Wins" real, "SEC Losses" real, "Percentage" text, "Home Record" text, "Road Record" text, "Overall Record" text )
Name the overall record for road record being 4-3
SELECT "Overall Record" FROM table_25393 WHERE "Road Record" = '4-3'
wikisql
CREATE TABLE table_204_798 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
how many world championships were held previous to the world championships in 2001 ?
SELECT COUNT(*) FROM table_204_798 WHERE "competition" = 'world championships' AND "year" < 2001
squall
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, ...
What is the name and salary for employee with id 242518965?
SELECT name, salary FROM employee WHERE eid = 242518965
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
how many patients are with medicaid insurance and diagnosed for chronic obst asthma nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "Chronic obst asthma NOS"
mimicsql_data
CREATE TABLE farm_competition ( Official_Name VARCHAR, City_ID VARCHAR, Host_city_ID VARCHAR ) CREATE TABLE city ( Official_Name VARCHAR, City_ID VARCHAR, Host_city_ID VARCHAR )
List the official names of cities that have not held any competition.
SELECT Official_Name FROM city WHERE NOT City_ID IN (SELECT Host_city_ID FROM farm_competition)
sql_create_context
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
病患50606376在2011-11-27之后做过的检验报告在哪些门诊?列出这些门诊就诊的流水编码
SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '50606376' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2011-11-27') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE table_48189 ( "Release Title" text, "Series" text, "No. of DVDs" text, "No. of Blu-ray Discs" text, "Release Date" text, "Episode No." text, "Region No." real, "Released by" text )
WHAT SERIES WAS RELEASED BY ITV STUDIOS AND A RELEASE DATE OF AUGUST 15, 2012?
SELECT "Series" FROM table_48189 WHERE "Released by" = 'itv studios' AND "Release Date" = 'august 15, 2012'
wikisql
CREATE TABLE table_2668243_22 ( party VARCHAR, result VARCHAR, district VARCHAR )
What 'party' was re-elected in district South Carolina 7?
SELECT party FROM table_2668243_22 WHERE result = "Re-elected" AND district = "South Carolina 7"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number ...
Do any courses in Advanced Southeast Asian Studies satisfy the PreMajor requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Southeast Asian Studies%' OR course.description LIKE '%Advanced Southeast Asian Studies...
advising
CREATE TABLE table_204_601 ( id number, "area served" text, "city of license" text, "vc" number, "rf" number, "callsign" text, "network" text, "notes" text )
what is the total number of stations serving the the cape girardeau area ?
SELECT COUNT(*) FROM table_204_601 WHERE "area served" = 'cape girardeau'
squall
CREATE TABLE table_79008 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text )
What is the ranking when Archie Compston is the player and the money is $73?
SELECT "Place" FROM table_79008 WHERE "Money ( $ )" = '73' AND "Player" = 'archie compston'
wikisql
CREATE TABLE table_70997 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
Name the condition with partial thromboplastin time of unaffected and prothrombin time of unaffected with platelet count of decreased
SELECT "Condition" FROM table_70997 WHERE "Partial thromboplastin time" = 'unaffected' AND "Prothrombin time" = 'unaffected' AND "Platelet count" = 'decreased'
wikisql
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text )
What are the names of different tracks, and how many races has each had Plot them as bar chart, could you list in asc by the Y-axis?
SELECT T2.Name, COUNT(*) FROM race AS T1 JOIN track AS T2 ON T1.Track_ID = T2.Track_ID GROUP BY T1.Track_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
what amount of furosemide had been prescribed to patient 88659 in total since 09/2104?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND prescriptions.drug = 'furosemide' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-09'
mimic_iii
CREATE TABLE table_4542 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the date when South Melbourne was the home team?
SELECT "Date" FROM table_4542 WHERE "Home team" = 'south melbourne'
wikisql
CREATE TABLE table_52537 ( "Competition" text, "Played" real, "Drawn" real, "Lost" real, "Position" text, "Coach" text, "Captain" text, "Main Article" text )
What Captain has Lost 13?
SELECT "Captain" FROM table_52537 WHERE "Lost" = '13'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by weekday, and order total number in ascending order.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_name_27 ( overall_pick INTEGER, position VARCHAR, nfl_draft VARCHAR )
What is the highest overall pick that has c as the position, with an NFL Draft greater than 1977?
SELECT MAX(overall_pick) FROM table_name_27 WHERE position = "c" AND nfl_draft > 1977
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDis...
Top 500 tagged with tidyverse.
SELECT Id AS "post_link", Score, ViewCount, Tags FROM Posts WHERE Tags LIKE '%<##tag?tidyverse##>%' ORDER BY ViewCount DESC LIMIT 500
sede
CREATE TABLE table_name_16 ( attendance INTEGER, week INTEGER )
What is the total attendance before week 1?
SELECT SUM(attendance) FROM table_name_16 WHERE week < 1
sql_create_context
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...
从07-7-22到15-4-15,哪几位工号及姓名的医务人员在患者韩嘉玉就诊时为其提供检测指标303131服务的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.J...
css
CREATE TABLE table_name_24 ( leading_scorer VARCHAR, year VARCHAR, goals VARCHAR, league VARCHAR )
Leading Scorer that has a Goal smaller than 23, and a League of football league division 3, and a Year of 1997 98 is who?
SELECT leading_scorer FROM table_name_24 WHERE goals < 23 AND league = "football league division 3" AND year = "1997–98"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
has patient 28447 received any medication this month?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE table_1194 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
When segment b is dining room tables what is segment d?
SELECT "Segment D" FROM table_1194 WHERE "Segment B" = 'Dining Room Tables'
wikisql
CREATE TABLE table_45387 ( "Stop no." text, "Platform" text, "Line" text, "Stopping pattern" text, "Destination" text )
Which Stopping pattern has a Platform of [2777] mciver station platforms?
SELECT "Stopping pattern" FROM table_45387 WHERE "Platform" = '[2777] mciver station platforms'
wikisql
CREATE TABLE table_16388478_2 ( away_team VARCHAR, crowd VARCHAR )
What were all the away teams when the crowd was 13304?
SELECT away_team FROM table_16388478_2 WHERE crowd = 13304
sql_create_context
CREATE TABLE table_name_51 ( avg_game INTEGER, goals VARCHAR, rank VARCHAR )
What is the average avg/game of the player with 97 goals and a rank above 7?
SELECT AVG(avg_game) FROM table_name_51 WHERE goals = 97 AND rank < 7
sql_create_context
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 was the last thing patient 17010 received for intake until 192 days ago?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17010)) AND DATETIME(inputevents_cv....
mimic_iii
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...
患者99152621在2011年10月16日到2017年2月16日这个时间段一个在医疗机构1737840开了多少西药?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '99152621' AND t_kc22.STA_DATE BETWEEN '2011-10-16' AND '2017-02-16' AND t_kc21.MED_SER_ORG_NO = '1737840' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_65721 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text )
What's the mascot of Eastern Pekin having less than 627 enrolled and an AA for their IHSAA Class?
SELECT "Mascot" FROM table_65721 WHERE "Enrollment" < '627' AND "IHSAA Class" = 'aa' AND "School" = 'eastern pekin'
wikisql
CREATE TABLE table_15869204_7 ( score VARCHAR, game VARCHAR )
What was the score in game 51?
SELECT score FROM table_15869204_7 WHERE game = 51
sql_create_context
CREATE TABLE table_204_793 ( id number, "call-sign" text, "location" text, "rf" number, "psip" number, "programming" text )
which 2 stations both have faith ministries radio ?
SELECT "call-sign" FROM table_204_793 WHERE "programming" = 'faith ministries radio'
squall
CREATE TABLE table_name_27 ( date VARCHAR, week VARCHAR )
What date did Week 9 begin?
SELECT date FROM table_name_27 WHERE week = 9
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about the average of Team_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, and sort by the x-axis from low to high please.
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
nvbench
CREATE TABLE table_name_14 ( coombe_road VARCHAR, woodside VARCHAR )
What is the Coombe Road with a Woodside time of 07:23?
SELECT coombe_road FROM table_name_14 WHERE woodside = "07:23"
sql_create_context
CREATE TABLE table_1970 ( "Year" real, "Formula" text, "Driver" text, "Constructor" text, "Location" text, "Report" text )
What is the location of the car that has a constructor of Lorraine-Dietrich?
SELECT "Location" FROM table_1970 WHERE "Constructor" = 'Lorraine-Dietrich'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) 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 re...
Give me the comparison about the average of Weight over the Sex , and group by attribute Sex by a bar chart, and could you list total number in descending order?
SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY AVG(Weight) DESC
nvbench
CREATE TABLE table_15909409_2 ( country VARCHAR, agricultural_use__m_3__p_yr__in__percentage_ VARCHAR )
What was the country in which the agricultural use (m 3 /p/yr)(in %) was 794(86%)?
SELECT country FROM table_15909409_2 WHERE agricultural_use__m_3__p_yr__in__percentage_ = "794(86%)"
sql_create_context
CREATE TABLE table_4889 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Footscray's Home team score?
SELECT "Home team score" FROM table_4889 WHERE "Home team" = 'footscray'
wikisql
CREATE TABLE table_name_75 ( area INTEGER, population VARCHAR, density VARCHAR, rank VARCHAR )
What is the lowest area when the density is greater than 234.77, the population is less than 965,040, and the rank is 32?
SELECT MIN(area) FROM table_name_75 WHERE density > 234.77 AND rank = 32 AND population < 965 OFFSET 040
sql_create_context
CREATE TABLE table_name_25 ( Id VARCHAR )
What is the 2010 Lukoil oil prodroduction when in 2009 oil production 21.662 million tonnes?
SELECT 2010 FROM table_name_25 WHERE 2009 = "21.662"
sql_create_context
CREATE TABLE table_name_79 ( nationality VARCHAR, rank VARCHAR )
What is the nationality for rank 27?
SELECT nationality FROM table_name_79 WHERE rank = 27
sql_create_context
CREATE TABLE table_name_60 ( score_in_the_final VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR )
What is the score in the final with a hard surface and is against Hiromi Nagano?
SELECT score_in_the_final FROM table_name_60 WHERE surface = "hard" AND opponent_in_the_final = "hiromi nagano"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is the number of patients under urgent admission type who had combined right and left heart cardiac catheterization?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Combined right and left heart cardiac catheterization"
mimicsql_data