instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numci...
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
scholar
CREATE TABLE table_10118412_6 ( filipino VARCHAR, indian VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many States have an Indian population of 30947?
SELECT COUNT(filipino) FROM table_10118412_6 WHERE indian = 30947
sql_create_context
CREATE TABLE country ( country_id number, name text, population number, area number, languages text ) CREATE TABLE roller_coaster ( roller_coaster_id number, name text, park text, country_id number, length number, height number, speed text, opened text, status te...
SELECT T2.name, T1.name FROM country AS T1 JOIN roller_coaster AS T2 ON T1.country_id = T2.country_id
spider
CREATE TABLE table_7936 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What da...
SELECT "Date" FROM table_7936 WHERE "Game" > '17'
wikisql
CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE course ( ...
SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title
nvbench
CREATE TABLE table_name_25 ( uni_number INTEGER, surname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the uniform number of the player whose last name is Wiltshire?
SELECT MIN(uni_number) FROM table_name_25 WHERE surname = "wiltshire"
sql_create_context
CREATE TABLE table_56701 ( "League" text, "Sport" text, "Season" text, "# of Teams" real, "Games" real, "Total attendance" text, "Average attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of average attenda...
SELECT SUM("Average attendance") FROM table_56701 WHERE "Games" = '1311'
wikisql
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType
nvbench
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) -- Using valid SQLite, answer...
SELECT Reign, Days_held FROM wrestler
nvbench
CREATE TABLE table_27294 ( "Freq" real, "Call" text, "City" text, "Owner" text, "Start" real, "Day Power ( W )" real, "Night Power" real, "Nickname" text, "Format" text, "Stereo" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In ...
SELECT "Start" FROM table_27294 WHERE "Nickname" = 'Voice of Muscatine'
wikisql
CREATE TABLE table_2639433_4 ( timeslot VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the timeslot for the episode in the year 2008?
SELECT timeslot FROM table_2639433_4 WHERE year = 2008
sql_create_context
CREATE TABLE table_41347 ( "RANK" real, "NAME" text, "TEAM" text, "COUNTRY" text, "POINTS" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country is in Rank 2?
SELECT "COUNTRY" FROM table_41347 WHERE "RANK" = '2'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEWISH" AND lab.label = "Total Protein, Urine"
mimicsql_data
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, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '何修明' AND t_kc22.STA_DATE BETWEEN '2013-12-16' AND '2014-11-24' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
SELECT DISTINCT OwnerUserId AS "user_link", COUNT(Id) AS "answers_count" FROM Posts WHERE PostTypeId = 1 AND Score = 0 GROUP BY OwnerUserId ORDER BY 2 DESC
sede
CREATE TABLE table_name_62 ( points INTEGER, drawn VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Drawn of 0, and a Games larger than 5 has what amount of highest points?
SELECT MAX(points) FROM table_name_62 WHERE drawn = 0 AND games > 5
sql_create_context
CREATE TABLE table_72763 ( "Track Name" text, "Location" text, "Length" text, "Sanction" text, "Program" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What programs were held at highland speedway?
SELECT "Program" FROM table_72763 WHERE "Track Name" = 'Highland Speedway'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmoun...
SELECT t1.TagName AS Tag, t2.TagName AS "Related Tag", COUNT(t2.TagName) AS "Count" FROM PostTags AS pt1 INNER JOIN Tags AS t1 ON pt1.TagId = t1.Id INNER JOIN PostTags AS pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId != pt2.TagId INNER JOIN Tags AS t2 ON pt2.TagId = t2.Id INNER JOIN Posts AS A ON pt2.PostId = A.Id WHERE...
sede
CREATE TABLE table_name_15 ( rank INTEGER, time VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total rank of the lane smaller than 8 with a time of 59.80?
SELECT SUM(rank) FROM table_name_15 WHERE time = "59.80" AND lane < 8
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC
nvbench
CREATE TABLE table_22683 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When dydek (8...
SELECT "High points" FROM table_22683 WHERE "High rebounds" = 'Dydek (8)'
wikisql
CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE...
SELECT rank, sex, COUNT(*) FROM faculty GROUP BY rank, sex
spider
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74752')) AND intakeoutput.celllabel = 'gastr...
eicu
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...
SELECT CreationDate, Score, Text, 'http://stackoverflow.com/questions/' + CAST(PostId AS TEXT(10)) + '#comment' + CAST(Id AS TEXT(10)) + '_' + CAST(PostId AS TEXT(10)) AS Link FROM Comments WHERE UserId = @UserId ORDER BY Score DESC
sede
CREATE TABLE table_name_8 ( silver INTEGER, bronze VARCHAR, gold VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average silver that has a gold greater than 3, with soviet union (urs) as the nation, and a bronze greater tha...
SELECT AVG(silver) FROM table_name_8 WHERE gold > 3 AND nation = "soviet union (urs)" AND bronze > 26
sql_create_context
CREATE TABLE table_69594 ( "Name" text, "Circuit" text, "Date" text, "Winning drivers" text, "Winning constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name for the race in the Miramas circuit?
SELECT "Name" FROM table_69594 WHERE "Circuit" = 'miramas'
wikisql
CREATE TABLE table_name_40 ( player VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player from Arizona State?
SELECT player FROM table_name_40 WHERE college = "arizona state"
sql_create_context
CREATE TABLE table_1341453_32 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates in the district whose incumbent is Bill Pascrell?
SELECT candidates FROM table_1341453_32 WHERE incumbent = "Bill Pascrell"
sql_create_context
CREATE TABLE table_name_88 ( position INTEGER, drawn VARCHAR, lost VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the position when lot is less than 14, goal difference is +1 and drawn is more than 15?
SELECT SUM(position) FROM table_name_88 WHERE lost < 14 AND goal_difference = "+1" AND drawn > 15
sql_create_context
CREATE TABLE table_73788 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes are written by Lew Schneider?
SELECT COUNT("Series #") FROM table_73788 WHERE "Written by" = 'Lew Schneider'
wikisql
CREATE TABLE table_14810 ( "Office" text, "Representative" text, "Party" text, "Residence" text, "First Elected" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Office has a Party of rep, and a Representative of brian bosma?
SELECT "Office" FROM table_14810 WHERE "Party" = 'rep' AND "Representative" = 'brian bosma'
wikisql
CREATE TABLE table_name_8 ( player VARCHAR, span VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player with a Span of 1998-2009?
SELECT player FROM table_name_8 WHERE span = "1998-2009"
sql_create_context
CREATE TABLE table_47942 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent when the H/A was H and the scorer was Ferguson?
SELECT "Opponents" FROM table_47942 WHERE "H / A" = 'h' AND "Scorers" = 'ferguson'
wikisql
CREATE TABLE table_204_516 ( id number, "date" text, "opponents" text, "h / a" text, "result\nf - a" text, "scorers" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the difference in score between the two teams f...
SELECT ABS("result\nf - a" - "result\nf - a") FROM table_204_516 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_70948 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total points were earned with ferrari 125 Chassis after 1952?
SELECT SUM("Points") FROM table_70948 WHERE "Chassis" = 'ferrari 125' AND "Year" > '1952'
wikisql
CREATE TABLE table_203_4 ( id number, "medal" text, "name" text, "sport" text, "event" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the total number of silver medals earned ?
SELECT COUNT(*) FROM table_203_4 WHERE "medal" = 'silver'
squall
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...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254232') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT ...
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 microlab ( microl...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'antiplatelet agent - aggregation inhibitors'...
eicu
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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51464" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_20 ( bronze VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals does South Korea have?
SELECT bronze FROM table_name_20 WHERE nation = "south korea"
sql_create_context
CREATE TABLE table_name_63 ( tournament VARCHAR, outcome VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when Outcome is Winner, and when Date is 13 July 2013?
SELECT tournament FROM table_name_63 WHERE outcome = "winner" AND date = "13 july 2013"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TAB...
SELECT * FROM (SELECT Id, Body, Score, DENSE_RANK() OVER (ORDER BY Score DESC) AS Rank FROM (SELECT a.Id, a.ParentId, a.Body, a.Score FROM Posts AS a WHERE a.ParentId = '##QuestionId##') AS x LIMIT 2) AS x WHERE (SELECT q.AcceptedAnswerId FROM Posts AS q WHERE q.Id = '##QuestionId##') = Id OR Rank = 1
sede
CREATE TABLE table_42838 ( "Name" text, "Seat" text, "Population (2011)" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For Stellenbosch, which has a population larger than 155,733, what is th...
SELECT AVG("Area (km 2 )") FROM table_42838 WHERE "Name" = 'stellenbosch' AND "Population (2011)" > '155,733'
wikisql
CREATE TABLE table_1557974_1 ( birthplace VARCHAR, debut VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where were the wrestlers born who debuted in 2002-7?
SELECT birthplace FROM table_1557974_1 WHERE debut = "2002-7"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jybgb JOIN jyjgzbb ON jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE jybgb.JZLSH = '18545084468' AND jyjgzbb.JCRXM LIKE '曹%'
css
CREATE TABLE table_9075 ( "Country or territory" text, "Area (km\u00b2)" real, "Population" real, "Population density (per km\u00b2)" real, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average area in canada with a population ...
SELECT AVG("Area (km\u00b2)") FROM table_9075 WHERE "Country or territory" = 'canada' AND "Population density (per km\u00b2)" > '3.4'
wikisql
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 allergy ( allergy...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-96048')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE table_7831 ( "Team" text, "Head Coach" text, "City" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is VFB Stuttgart II Team's Stadiuim?
SELECT "Stadium" FROM table_7831 WHERE "Team" = 'vfb stuttgart ii'
wikisql
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ...
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102'
nvbench
CREATE TABLE table_57574 ( "Ward" text, "Bello" text, "Ben-Tahir" text, "Doucet" text, "Furtenbacher" text, "Gauthier" text, "Haydon" text, "Larter" text, "Lawrance" text, "Libweshya" text, "Liscumb" text ) -- Using valid SQLite, answer the following questions for the table...
SELECT "Gauthier" FROM table_57574 WHERE "Liscumb" = '15'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-121402')) AND intakeoutput.cellpath LIKE '%o...
eicu
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 jybgb ( BBCJBW text, BBDM tex...
SELECT (SELECT COUNT(*) 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.RYBH = '76980404' AND mzjzjlb.JZKSRQ BETWEEN '2001-07-25' AND '2018-06-20') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = h...
css
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE table_52791 ( "Tournament" text, "Winner" text, "Runner-up" text, "Score" text, "Third Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the winner when Goran Ivani evi was in third place?
SELECT "Winner" FROM table_52791 WHERE "Third Place" = 'goran ivanišević'
wikisql
CREATE TABLE table_37667 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Home of buffalo happened on what date?
SELECT "Date" FROM table_37667 WHERE "Home" = 'buffalo'
wikisql
CREATE TABLE film_actor ( actor_id number, film_id number, last_update time ) CREATE TABLE address ( address_id number, address text, address2 text, district text, city_id number, postal_code text, phone text, last_update time ) CREATE TABLE film ( film_id number, t...
SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1
spider
CREATE TABLE table_name_12 ( opponent_in_final VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent in Final, when Date is '13 January 1992'?
SELECT opponent_in_final FROM table_name_12 WHERE date = "13 january 1992"
sql_create_context
CREATE TABLE table_name_55 ( overall INTEGER, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the overall sum of round 3?
SELECT SUM(overall) FROM table_name_55 WHERE round = 3
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
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_66412 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 3rd day result when the 4th day was bumped Fitzwilliam?
SELECT "3rd day" FROM table_66412 WHERE "4th Day" = 'bumped fitzwilliam'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
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 chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( r...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'sed,hyp,anxiolytc ab-con') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1232)
mimic_iii
CREATE TABLE table_181892_4 ( year VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was the chassis a lotus-ford 38/7?
SELECT COUNT(year) FROM table_181892_4 WHERE chassis = "Lotus-Ford 38/7"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
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 = "Meth sus pneum d/t Staph" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT 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.PERSON_NM = '花心宜' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID...
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id numbe...
SELECT t3.drug FROM (SELECT t2.drug, 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.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute lymphocyte count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51675) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME...
mimic_iii
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...
SELECT * FROM Users AS u WHERE UPPER(u.Location) LIKE UPPER('%' + '##YourLocation:string##' + '%') AND (u.Id IN (SELECT UserId FROM Comments AS c WHERE c.PostId IN (SELECT Id FROM Posts AS p WHERE UPPER(p.Tags) LIKE UPPER('%<' + '##Tag:string##' + '>%'))) OR u.Id IN (SELECT OwnerUserId FROM Posts AS p WHERE p.Tags LIKE...
sede
CREATE TABLE table_204_579 ( id number, "code" text, "district" text, "headquarters" text, "population (as of 2011)" number, "area (km2)" number, "density (/km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- if a person was headquartered...
SELECT "district" FROM table_204_579 WHERE "headquarters" = 'almora'
squall
CREATE TABLE table_name_69 ( club VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Club has a Rank of 1?
SELECT club FROM table_name_69 WHERE rank = "1"
sql_create_context
CREATE TABLE table_name_41 ( points VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of points of the honda hr-1 engine?
SELECT COUNT(points) FROM table_name_41 WHERE engine = "honda hr-1"
sql_create_context
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
nvbench
CREATE TABLE table_21063459_1 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game against Mississippi State?
SELECT result FROM table_21063459_1 WHERE opponent = "Mississippi State"
sql_create_context
CREATE TABLE zyb ( 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...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '56819536' AND t_kc22.STA_DATE BETWEEN '2006-11-26' AND '2021-01-02' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '5...
css
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight ( aircraft_code_sequence text, air...
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DAT...
atis
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'upper respiratory obstruction - suspected' AND DATET...
eicu
CREATE TABLE table_203_478 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which game date only had a bit more than 20,000 in attendance ?
SELECT "date" FROM table_203_478 WHERE "attendance" > 20000 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3153321' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-02-17' AND '2015-11-04' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 29
css
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...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 19412 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_60 ( year VARCHAR, nominee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was Best Musical Revival nominated?
SELECT COUNT(year) FROM table_name_60 WHERE nominee = "best musical revival"
sql_create_context
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, ...
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 = "Encephalopathy NOS" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
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 = '030-28944')) AND lab.labname = 'urinary specific gravity' AND DATETIME(lab.labresu...
eicu
CREATE TABLE table_name_84 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance for july 18?
SELECT COUNT(attendance) FROM table_name_84 WHERE date = "july 18"
sql_create_context
CREATE TABLE table_23089 ( "Country" text, "Area km\u00b2" real, "Population" real, "Population density per km\u00b2" real, "HDI (2011)" text, "Capital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which capitals have an area of exactly 377930...
SELECT "Capital" FROM table_23089 WHERE "Area km\u00b2" = '377930'
wikisql
CREATE TABLE table_20217456_7 ( rl_süd__1st_ VARCHAR, rl_südwest__1st_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was RL S d (1st) when FK Pirmasens was RL S dwest (1st)?
SELECT rl_süd__1st_ FROM table_20217456_7 WHERE rl_südwest__1st_ = "FK Pirmasens"
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT zzmzjzjlb.JZKSRQ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '34693713657' UNION SELECT fzzmzjzjlb.JZKSRQ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '34693713657'
css
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 te...
SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '81766246008'
css
CREATE TABLE table_name_57 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Richmond play as the away team?
SELECT venue FROM table_name_57 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Log ( problem_log_id INTEGER, assigned_to_staff_id INTEGER, problem_id INTEGER, problem_category_code VARCHAR(20), problem_status_code VARCHAR(20), log_entry_date...
SELECT log_entry_date, problem_log_id FROM Problem_Log WHERE problem_id = 10 ORDER BY log_entry_date DESC
nvbench
CREATE TABLE table_name_76 ( unit_test VARCHAR, msdn_integration VARCHAR, projects_templates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Unit test has a MSDN integration of full, and a Projects templates of yes?
SELECT unit_test FROM table_name_76 WHERE msdn_integration = "full" AND projects_templates = "yes"
sql_create_context
CREATE TABLE table_204_914 ( id number, "year" number, "team" text, "games" number, "attempts" number, "yards" number, "ypc" number, "long" number, "tds" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the only year that th...
SELECT "year" FROM table_204_914 WHERE "team" = 'atlanta falcons'
squall
CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_...
SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
nvbench
CREATE TABLE table_41209 ( "Year" real, "Film" text, "Director" text, "Producer" text, "Writer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year is the latest year that has no under director?
SELECT MAX("Year") FROM table_41209 WHERE "Director" = 'no'
wikisql
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- F...
SELECT location FROM track WHERE seating > 90000 INTERSECT SELECT location FROM track WHERE seating < 70000
spider
CREATE TABLE table_10364 ( "State" text, "Swimsuit" real, "Interview" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest swimsuit score a contestant from Rhode Island with an average larger than 9....
SELECT MIN("Swimsuit") FROM table_10364 WHERE "State" = 'rhode island' AND "Average" > '9.235'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-19005')) AND intakeoutput.celllabel = 'po cl...
eicu
CREATE TABLE zyb ( 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...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_NM = '牙折断' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_NM = '牙折断' UNION SELE...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id num...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro...
mimic_iii