context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_24014 ( "Stations" text, "Connections" text, "City/ Neighborhood" text, "Parking" text, "Date Opened" text )
Which station has park & ride lot parking?
SELECT "Stations" FROM table_24014 WHERE "Parking" = 'Park & Ride Lot'
wikisql
CREATE TABLE table_name_89 ( school VARCHAR, locality VARCHAR, capacity VARCHAR, ofsted VARCHAR )
Which School has a Capacity larger than 730, and an Ofsted smaller than 106135, and a Locality of heaton mersey?
SELECT school FROM table_name_89 WHERE capacity > 730 AND ofsted < 106135 AND locality = "heaton mersey"
sql_create_context
CREATE TABLE table_name_27 ( losses INTEGER, against VARCHAR, draws VARCHAR )
What is the fewest losses that had an against score of 2190 and more than 0 draws?
SELECT MIN(losses) FROM table_name_27 WHERE against = 2190 AND draws > 0
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
Most popular Stack Overflow tags.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId GROUP BY TagName) AS rate INNER JOIN (SELECT COUNT(PostId)...
sede
CREATE TABLE table_name_2 ( ratio VARCHAR, in_×_in VARCHAR )
Which Ratio has an in in of 17 22?
SELECT ratio FROM table_name_2 WHERE in_×_in = "17 × 22"
sql_create_context
CREATE TABLE table_name_56 ( laps INTEGER, time VARCHAR, grid VARCHAR )
What is the total number of laps for the time of +7.277 and the grid number of more than 6?
SELECT SUM(laps) FROM table_name_56 WHERE time = "+7.277" AND grid > 6
sql_create_context
CREATE TABLE table_61996 ( "Source" text, "Date" text, "Kaine (D)" text, "Kilgore (R)" text, "Potts (I)" text )
What was Kilgore's (R) percentage when Potts (I) polled at 1%?
SELECT "Kilgore (R)" FROM table_61996 WHERE "Potts (I)" = '1%'
wikisql
CREATE TABLE table_17323092_8 ( high_points VARCHAR, game VARCHAR )
Who earned high points in game 69?
SELECT high_points FROM table_17323092_8 WHERE game = 69
sql_create_context
CREATE TABLE table_1676073_12 ( points_for VARCHAR, points_against VARCHAR )
How many teams had 632 points against?
SELECT COUNT(points_for) FROM table_1676073_12 WHERE points_against = "632"
sql_create_context
CREATE TABLE table_44642 ( "Election" real, "Number of PNC votes" text, "Share of votes" text, "Seats" text, "Outcome of election" text )
What is the earliest election with 2 seats and the outcome of the election of minority in parliament?
SELECT MIN("Election") FROM table_44642 WHERE "Outcome of election" = 'minority in parliament' AND "Seats" = '2'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, ...
Maximum score per day per post type.
SELECT CASE WHEN PostTypeId = 1 THEN 'Questions' ELSE 'Answers' END, MAX(CAST(Score AS FLOAT) / DATEDIFF(DAY, CreationDate, GETDATE())) AS Score FROM Posts WHERE DATEDIFF(DAY, CreationDate, GETDATE()) > 0 AND PostTypeId IN (1, 2) GROUP BY PostTypeId
sede
CREATE TABLE table_name_81 ( tonnage INTEGER, name_of_ship VARCHAR )
What is the average tonnage of the ship named proletarij?
SELECT AVG(tonnage) FROM table_name_81 WHERE name_of_ship = "proletarij"
sql_create_context
CREATE TABLE table_67298 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text )
What is the Transfer fee, when the Transfer window is 'winter', and when the item 'Moving to' is Northwich Victoria?
SELECT "Transfer fee" FROM table_67298 WHERE "Transfer window" = 'winter' AND "Moving to" = 'northwich victoria'
wikisql
CREATE TABLE table_12419515_5 ( written_by VARCHAR, series__number VARCHAR )
Name the people who wrote number 67
SELECT written_by FROM table_12419515_5 WHERE series__number = 67
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labi...
how many time did patient 82235 produce a or urine output until 11/2103?
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 82235)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'or urine' AND d_it...
mimic_iii
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
因为冠状动脉粥样硬化性心脏病在2007年10月12日到2010年5月2日间在科室2348住院的平均花费有多少?
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '2348' AND IN_HOSP_DATE BETWEEN '2007-10-12' AND '2010-05-02' AND IN_DIAG_DIS_NM = '冠状动脉粥样硬化性心脏病' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_28357 ( "Road race" text, "Distance" text, "Location" text, "Country" text, "Month held" text )
Where was the istanbul marathon?
SELECT "Location" FROM table_28357 WHERE "Road race" = 'Istanbul Marathon'
wikisql
CREATE TABLE table_name_30 ( top_10s INTEGER, wins INTEGER )
What is the best top 10 when there are fewer than 0 wins?
SELECT MAX(top_10s) FROM table_name_30 WHERE wins < 0
sql_create_context
CREATE TABLE table_1859855_2 ( age INTEGER, hometown VARCHAR )
When austin, texas is the hometown what is the lowest age?
SELECT MIN(age) FROM table_1859855_2 WHERE hometown = "Austin, Texas"
sql_create_context
CREATE TABLE table_15887683_1 ( content VARCHAR, television_service VARCHAR )
What is the content of the rai 1 television service?
SELECT content FROM table_15887683_1 WHERE television_service = "Rai 1"
sql_create_context
CREATE TABLE table_name_79 ( gold VARCHAR, total VARCHAR, bronze VARCHAR, rank VARCHAR )
How many golds for teams ranking below 7 with 3 bronze and less than 5 total medals?
SELECT COUNT(gold) FROM table_name_79 WHERE bronze = 3 AND rank > 7 AND total < 5
sql_create_context
CREATE TABLE table_203_481 ( id number, "n\u00b0" number, "name" text, "position" text, "date of birth" text, "nationality" text )
how many had position s ?
SELECT COUNT(*) FROM table_203_481 WHERE "position" = 's'
squall
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number,...
Top 100 Reputation in Iran.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_name_8 ( name VARCHAR, total VARCHAR )
Which player has a total of 8 (24)?
SELECT name FROM table_name_8 WHERE total = "8 (24)"
sql_create_context
CREATE TABLE table_name_1 ( area__km_2__ VARCHAR, telephone__052_ VARCHAR )
Which area has a telephone of (052) of 3862279?
SELECT area__km_2__ FROM table_name_1 WHERE telephone__052_ = "3862279"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
编号为88534904844医疗就诊的医疗费一共是多少?
SELECT t_kc21.MED_AMOUT FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '88534904844'
css
CREATE TABLE table_53791 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score of the Kings game when they had a record of 8 11 1?
SELECT "Score" FROM table_53791 WHERE "Record" = '8–11–1'
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...
2003年9月3日到2008年3月14日,编号为0389131的医院有多少科室涉及的医疗费总额在1563.42元以上
SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '0389131' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-09-03' AND '2008-03-14' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 1563.42) AS T
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Show minimal age from each job, I want to show by the bars in descending.
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC
nvbench
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, ...
列出各科室在医院2092473的编码和名称以及平均住院时长是什么,并按平均住院时长升序排序?
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2092473' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS)
css
CREATE TABLE table_name_14 ( launched VARCHAR, laid_down VARCHAR )
What was launched and laid down in February 1819?
SELECT launched FROM table_name_14 WHERE laid_down = "february 1819"
sql_create_context
CREATE TABLE table_40854 ( "Season" real, "Overall" text, "Slalom" text, "Giant Slalom" text, "Super G" text, "Downhill" text, "Combined" text )
What is the giant slalom with a 37 super g?
SELECT "Giant Slalom" FROM table_40854 WHERE "Super G" = '37'
wikisql
CREATE TABLE table_30665 ( "Couple" text, "Style" text, "Music" text, "Trine Dehli Cleve" real, "Tor Fl\u00f8ysvik" real, "Karianne Gulliksen" real, "Christer Tornell" real, "Total" real )
Name the style for 27
SELECT "Style" FROM table_30665 WHERE "Total" = '27'
wikisql
CREATE TABLE table_name_67 ( name VARCHAR, games VARCHAR, order VARCHAR )
Who had an order of 907 and more than 1 game?
SELECT name FROM table_name_67 WHERE games > 1 AND order = 907
sql_create_context
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
给病患患有白内障的开出的药品编号是什么名称都叫啥?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '白内障' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_...
css
CREATE TABLE table_203_375 ( id number, "name" text, "year built" text, "country" text, "town" text, "height" text, "remarks" text )
what is the total number of pylons listed ?
SELECT COUNT("name") FROM table_203_375
squall
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
Top uses from France in tag 'elixir' or 'phoenix-framework'.
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 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...
provide the number of patients whose admission location is transfer from hosp/extram and procedure long title is temporary colostomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Temporary colostomy"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
count the number of patients whose diagnoses is sarcoidosis and drug route is ng.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Sarcoidosis" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
what is the average base price of different bed type? List bed type and average base price.
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType
nvbench
CREATE TABLE table_name_37 ( school VARCHAR, location VARCHAR )
Which School has a Location of peru?
SELECT school FROM table_name_37 WHERE location = "peru"
sql_create_context
CREATE TABLE table_62121 ( "Date" text, "Ship Name" text, "Tonnage" real, "Ship Type" text, "Location" text, "Disposition of Ship" text )
What is the Ship Type of the Prize Disposition of ship and a tonnage less than 151?
SELECT "Ship Type" FROM table_62121 WHERE "Disposition of Ship" = 'prize' AND "Tonnage" < '151'
wikisql
CREATE TABLE club ( clubname VARCHAR )
What are the names of all clubs?
SELECT clubname FROM club
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by weekday, and sort by the the average of department id from high to low.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, ...
Find the order dates of the orders with price above 1000.
SELECT T1.order_date FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_price > 1000
spider
CREATE TABLE procedures ( 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 ) ...
what is the number of patients under the age of 70 who were admitted in emergency?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "70"
mimicsql_data
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
For each bed type, find the average base price of different bed type Show bar chart, and show by the Y from high to low.
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) DESC
nvbench
CREATE TABLE table_20524090_1 ( obama_percentage VARCHAR, mccain_percentage VARCHAR )
What was Obama's percentage in those places where McCain's percentage was 55.46%?
SELECT obama_percentage FROM table_20524090_1 WHERE mccain_percentage = "55.46%"
sql_create_context
CREATE TABLE table_name_37 ( year VARCHAR, title VARCHAR, result VARCHAR, genre VARCHAR, label VARCHAR )
Which year's genre was jazz under the columbia label when it was nominated for the title Trio jeepy?
SELECT year FROM table_name_37 WHERE genre = "jazz" AND label = "columbia" AND result = "nominated" AND title = "trio jeepy"
sql_create_context
CREATE TABLE table_12679326_1 ( district VARCHAR, party VARCHAR, committee VARCHAR )
What district is represented by a Republican Appropriations Committee?
SELECT district FROM table_12679326_1 WHERE party = "Republican" AND committee = "Appropriations"
sql_create_context
CREATE TABLE table_54524 ( "Grade" text, "Points" real, "Sit-up (reps)" text, "Standing Broad Jump (cm)" text, "Chin-up (reps)" text, "Shuttle Run (sec)" text, "2.4km Run (min:sec)" text )
How many points are there, when the grade is A?
SELECT MAX("Points") FROM table_54524 WHERE "Grade" = 'a'
wikisql
CREATE TABLE table_name_2 ( number_of_households INTEGER, median_household_income VARCHAR, population VARCHAR )
What is the most households with a median household income of $54,086 with less than 231,236 in population?
SELECT MAX(number_of_households) FROM table_name_2 WHERE median_household_income = "$54,086" AND population < 231 OFFSET 236
sql_create_context
CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year numbe...
How many faculty lines are there at San Francisco State University in 2004?
SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = "San Francisco State University"
spider
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
项目563098在医疗机构4874710一共有多少检查记录?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4874710' AND t_kc22.SOC_SRT_DIRE_CD = '563098'
css
CREATE TABLE table_10151 ( "Player" text, "Span" text, "Start" real, "Tries" real, "Conv" real, "Pens" real, "Drop" real )
What is the total of tries for a player with conv smaller than 45, 19 starts and pens fewer than 22?
SELECT COUNT("Tries") FROM table_10151 WHERE "Conv" < '45' AND "Start" = '19' AND "Pens" < '22'
wikisql
CREATE TABLE table_name_52 ( home_team VARCHAR )
What was the North Melbourne's score when they played as the home team?
SELECT home_team AS score FROM table_name_52 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_203_54 ( id number, "selected\nlatin american\ncountries" text, "internl.\ntourism\narrivals\n2010\n(x 1000)" number, "internl.\ntourism\nreceipts.\n2010\n(usd\n(x1000)" number, "average\nreceipt\nper visitor\n2009\n(usd/turista)" number, "tourist\narrivals\nper\n1000 inhab\n(...
which country had the least amount of tourism income in 2003 ?
SELECT "selected\nlatin american\ncountries" FROM table_203_54 ORDER BY "tourism\nincome\n%\ngdp\n2003" LIMIT 1
squall
CREATE TABLE table_name_12 ( laps INTEGER, rank VARCHAR )
What is the fewest number of laps completed by a rank 32?
SELECT MIN(laps) FROM table_name_12 WHERE rank = "32"
sql_create_context
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
how many jamerican cuisine are there in santa cruz county ?
SELECT COUNT(*) FROM geographic, restaurant WHERE geographic.county = 'santa cruz county' AND restaurant.city_name = geographic.city_name AND restaurant.name = 'jamerican cuisine'
restaurants
CREATE TABLE table_9812 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Place, when Player is 'Arnold Palmer'?
SELECT "Place" FROM table_9812 WHERE "Player" = 'arnold palmer'
wikisql
CREATE TABLE table_5180 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Tiger Woods has played less than 21 events and is what rank?
SELECT COUNT("Rank") FROM table_5180 WHERE "Player" = 'tiger woods' AND "Events" < '21'
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...
门诊诊断患者柏飞鸿为煤工尘肺,他的检测指标223006的结果定量及其单位均为?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
what is the last ward id patient 028-39354 got since 4 years ago.
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-39354') AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_52302 ( "D 49 \u221a" text, "D 48 \u221a" text, "D 47 \u221a" text, "D 46 \u221a" text, "D 45 \u221a" text, "D 44 \u221a" text, "D 43 \u221a" text, "D 42 \u221a" text, "D 41 \u221a" text )
What is the D 48 with a D 46 with r 33 o?
SELECT "D 48 \u221a" FROM table_52302 WHERE "D 46 \u221a" = 'r 33 o'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of patients whose admission location is emergency room admit and procedure short title is exc/dest hrt lesion open?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Exc/dest hrt lesion open"
mimicsql_data
CREATE TABLE table_75415 ( "Model" text, "Engine" text, "Displacement" text, "Valvetrain" text, "Fuel system" text, "Max. power at rpm" text, "Max. torque at rpm" text )
What is the maximum torque that has 2,445 CC Displacement, and an Iveco 8144.61 engine?
SELECT "Max. torque at rpm" FROM table_75415 WHERE "Displacement" = '2,445 cc' AND "Engine" = 'iveco 8144.61'
wikisql
CREATE TABLE table_203_47 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text )
how many games were won by the swarm by over 2 goals ?
SELECT COUNT("game") FROM table_203_47 WHERE "score" - "score" > 2
squall
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, could you rank total number of manager id in ascending order please?
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID)
nvbench
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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and employee_id , and display by the total number in ascending.
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
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...
病患00922703的检验结果指标均正常的检验报告单号是什么
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
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...
Draw a pie chart about the proportion of Sex and the sum of Weight.
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_10966926_2 ( player_name VARCHAR, college VARCHAR )
Which player went to Michigan State?
SELECT player_name FROM table_10966926_2 WHERE college = "Michigan State"
sql_create_context
CREATE TABLE table_20220 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
WHO WAS THE COVER MODEL OF PLAYBOY WHERE THE CENTERFOLD MODEL WAS SHALLAN MEIERS?
SELECT "Cover model" FROM table_20220 WHERE "Centerfold model" = 'Shallan Meiers'
wikisql
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...
Count questions tagged with a given tag combination.
SELECT COUNT(*) AS CNT FROM Posts WHERE Tags LIKE '%java%' AND Tags LIKE '%collision-detection%'
sede
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, stud...
What is the name of each course and the corresponding number of student enrollment. Show bar chart.
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name
nvbench
CREATE TABLE table_dev_30 ( "id" int, "gender" string, "leukopenia" int, "cd4_count" int, "stroke" bool, "platelets" int, "hematocrit_hct" float, "fasting_triglycerides" int, "coronary_stenosis" int, "hyperlipidemia" bool, "lymphopenia" int, "fasting_ldl_cholesterol" int,...
serum creatinine greater than or equal to 1.3 mg / dl for female , and greater than or equal to 1.5 mg / dl for male
SELECT * FROM table_dev_30 WHERE (serum_creatinine >= 1.3 AND gender = 'female') OR (serum_creatinine >= 1.5 AND gender = 'male')
criteria2sql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在医院4175966就诊的患者97703801,医院给他开的单价最高的药品名是什么?编码和单价呢
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '97703801' AND t_kc22.t_kc21_MED_SER_ORG_NO = '4175966') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
列出所有医疗就诊记录的统筹基金支出与医疗费总额在医院6000894的平均比值是多大,在不同科室编码下?
SELECT gwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '6000894' GROUP BY gwyjzb.MED_ORG_DEPT_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI...
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
在6947100这个医院的患者张永望的就诊记录中哪些名称中不包含科学的就诊科室
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '张永望' AND t_kc21.MED_SER_ORG_NO = '6947100' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%科学%'
css
CREATE TABLE table_34429 ( "Tournament" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text, "Win %" real )
Which 2005 has a 2004 of 3 2?
SELECT "2005" FROM table_34429 WHERE "2004" = '3–2'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE pr...
what are the five most frequent diagnoses of patients with age 30s since 6 years ago?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
患者82905019在2000年9月22日到2002年6月22日内有多少就诊医生?
SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '82905019' AND wdmzjzjlb.JZKSRQ BETWEEN '2000-09-22' AND '2002-06-22' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_...
css
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
My answers on the algorithm tag.
SELECT Q.Title, A.* FROM Posts AS A JOIN Posts AS Q ON A.ParentId = Q.Id JOIN PostTags ON PostTags.PostId = Q.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE A.OwnerUserId = '##UserId##' AND A.PostTypeId = 2 AND Q.PostTypeId = 1 AND TagName = 'algorithm' ORDER BY A.Score DESC
sede
CREATE TABLE table_name_99 ( bronze INTEGER, nation VARCHAR )
Which Bronze has a Nation of spain?
SELECT MAX(bronze) FROM table_name_99 WHERE nation = "spain"
sql_create_context
CREATE TABLE table_33609 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the attendance when the VFL played Glenferrie Oval?
SELECT SUM("Crowd") FROM table_33609 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_name_22 ( year INTEGER, wins VARCHAR, points VARCHAR )
What is the earliest year associated with 0 wins and 42 points?
SELECT MIN(year) FROM table_name_22 WHERE wins > 0 AND points = 42
sql_create_context
CREATE TABLE table_75490 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Which Men's doubles have a Year smaller than 1960, and Men's singles of noel b. radford?
SELECT "Men's doubles" FROM table_75490 WHERE "Year" < '1960' AND "Men's singles" = 'noel b. radford'
wikisql
CREATE TABLE table_73505 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where was the game in which Carl Landry (25) did the most high points played?
SELECT "Location Attendance" FROM table_73505 WHERE "High points" = 'Carl Landry (25)'
wikisql
CREATE TABLE table_name_47 ( played INTEGER, goals_conceded VARCHAR, draw VARCHAR )
What was the highest number played when there were 21 goals conceded and a draw greater than 3?
SELECT MAX(played) FROM table_name_47 WHERE goals_conceded = 21 AND draw > 3
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 zyjzjlb ( CYBQDM text, CYBQMC...
降钙素原这项在被门诊诊断为疾病E21.594的病人身上参考值范围下限与上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDBM = 'E21.594' AND jyjgzbb.JCZBMC = '降钙素原' UNION SELECT jyjgzbb.CKZFWXX,...
css
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 ...
20284523病人所有检验结果指标记录的检测员为李雅健的检验指标流水号是多少就在01年7月11日到2014年11月2日之间?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD...
css
CREATE TABLE table_name_54 ( attendance INTEGER, venue VARCHAR, date VARCHAR )
What is the average Attendance, when Venue is 'Candlestick Park', and when Date is 'November 25'?
SELECT AVG(attendance) FROM table_name_54 WHERE venue = "candlestick park" AND date = "november 25"
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_DIRE_CD text, MED_DIRE_NM text,...
编号51226934019的医疗就诊中,列出所有去外地就诊产生的费用明细项目
SELECT t_kc22.MED_EXP_DET_ID 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 = '51226934019' AND t_kc22.REMOTE_SETTLE_FLG = '异地1' OR t_kc22.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate ti...
SELECT TOP 10 * FROM tags ORDER BY Count DESC.
SELECT * FROM Tags ORDER BY Count DESC LIMIT 10
sede
CREATE TABLE table_name_60 ( school_club_team VARCHAR, pick VARCHAR )
Which school or club team has a pick of 139?
SELECT school_club_team FROM table_name_60 WHERE pick = 139
sql_create_context
CREATE TABLE table_name_15 ( circuit VARCHAR, team VARCHAR )
What circuit has volvo cars australia as the team?
SELECT circuit FROM table_name_15 WHERE team = "volvo cars australia"
sql_create_context
CREATE TABLE table_145439_1 ( economics VARCHAR, education VARCHAR )
what's the economics score with education being 92.0
SELECT economics FROM table_145439_1 WHERE education = "92.0"
sql_create_context
CREATE TABLE table_78774 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real, "Scorers" text )
What is the highest attendance at a game with a result of 5-1?
SELECT MAX("Attendance") FROM table_78774 WHERE "Result" = '5-1'
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 mzjzjlb ( HXPLC number, HZXM ...
病人奚子平的检验结果指标中哪些单号的检验报告单全部正常?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl...
css
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 ) ...
calculate the minimum age of male patients who were discharged to long term hospital care.
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data