instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_1575 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the o...
SELECT "Outgoing manager" FROM table_1575 WHERE "Position in table" = '11th'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4611"
mimicsql_data
CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar )...
SELECT COUNT(DISTINCT (tip.text)) FROM tip, user WHERE user.name = 'Michelle' AND user.user_id = tip.user_id
yelp
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE table_name_12 ( time VARCHAR, eliminated_by VARCHAR, wrestler VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time was the Wrestler Henry eliminated by Batista?
SELECT time FROM table_name_12 WHERE eliminated_by = "batista" AND wrestler = "henry"
sql_create_context
CREATE TABLE table_3851 ( "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 is...
SELECT "Date" FROM table_3851 WHERE "High assists" = 'Raymond Felton (4)'
wikisql
CREATE TABLE table_name_43 ( attendance VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at the week 7 game?
SELECT attendance FROM table_name_43 WHERE week = 7
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE table_name_33 ( completed VARCHAR, type VARCHAR, list_entry_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the completed date of the church with list entry number 1068071?
SELECT completed FROM table_name_33 WHERE type = "church" AND list_entry_number = 1068071
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 demographic (...
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "6983"
mimicsql_data
CREATE TABLE table_48813 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the ...
SELECT SUM("Position") FROM table_48813 WHERE "Lost" < '14' AND "Goal Difference" = '+1' AND "Drawn" > '15'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNT...
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_5 ( year_8_1st_quad VARCHAR, year_8_3rd_quad VARCHAR, year_9_2nd_quad VARCHAR, year_9_1st_quad VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the Crew with Year 9 2nd Quads of STM, Year 9 1st Quads of SOM, and a Year 8 3rd...
SELECT year_8_1st_quad FROM table_name_5 WHERE year_9_2nd_quad = "stm" AND year_9_1st_quad = "som" AND year_8_3rd_quad = "sta"
sql_create_context
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year)
nvbench
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 = '章傲晴' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' 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_CLIN...
css
CREATE TABLE table_22879323_8 ( score VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game in which Brook Lopez (8) did the high rebounds?
SELECT score FROM table_22879323_8 WHERE high_rebounds = "Brook Lopez (8)"
sql_create_context
CREATE TABLE table_1493 ( "No. in series" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date for the episode written ...
SELECT "Original airdate" FROM table_1493 WHERE "Written by" = 'Bob Goodman'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'digoxin 125 mcg po tabs' AND DATETIME(medication.dr...
eicu
CREATE TABLE table_name_64 ( deaths VARCHAR, storm_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many deaths occurred during Darby?
SELECT deaths FROM table_name_64 WHERE storm_name = "darby"
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT demographic.insurance FROM demographic WHERE demographic.subject_id = "18372"
mimicsql_data
CREATE TABLE table_2146364_2 ( third_place INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest third place finish?
SELECT MIN(third_place) FROM table_2146364_2
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopi...
SELECT Id AS "post_link", Id, Body, LENGTH(Body) AS length FROM Posts WHERE PostTypeId = 2 AND Body LIKE '%<a %</blockquote>%' AND NOT Body LIKE '%</blockquote>%<p>%' AND Id < 100000 AND DeletionDate IS NULL AND ClosedDate IS NULL ORDER BY LENGTH(Body) DESC LIMIT 100
sede
CREATE TABLE txmzjzjlb ( 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...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '2003934' AND jybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 12 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb...
css
CREATE TABLE table_46798 ( "Reserve" text, "District" text, "IUCN" text, "Co-management" text, "Est." real, "Description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IUNC of district of Cayo and reserve of Actun Tunichil Muknal?
SELECT "IUCN" FROM table_46798 WHERE "District" = 'cayo' AND "Reserve" = 'actun tunichil muknal'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "99592"
mimicsql_data
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...
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '83701090' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 3099.06)
css
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 ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE course ( crs_code text, dept_code text, crs_description text, crs_credit number ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, ...
SELECT COUNT(*) FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code WHERE T1.crs_code = 'ACCT-211'
spider
CREATE TABLE table_name_82 ( record VARCHAR, february VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record on February 23?
SELECT record FROM table_name_82 WHERE february = 23
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-123134' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1)...
eicu
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '88852897778'
css
CREATE TABLE table_1140067_2 ( date VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date for the pole position of alain prost?
SELECT date FROM table_1140067_2 WHERE pole_position = "Alain Prost"
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT Id, Title, CreationDate, LastActivityDate, Score, ViewCount, Body, AnswerCount, Tags FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%<firebase-authentication>%'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.insurance, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "4333"
mimicsql_data
CREATE TABLE table_name_64 ( round VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round where there was a KO (punch)?
SELECT round FROM table_name_64 WHERE method = "ko (punch)"
sql_create_context
CREATE TABLE table_name_99 ( callsign VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Frequency of 0 864 has what callsign?
SELECT callsign FROM table_name_99 WHERE frequency = "0 864"
sql_create_context
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-monos')
eicu
CREATE TABLE table_name_99 ( retitled_as_same VARCHAR, last_aired VARCHAR, show VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Retitled as/Same has a Last Aired larger than 1982, and a Show of we got it made?
SELECT retitled_as_same FROM table_name_99 WHERE last_aired > 1982 AND show = "we got it made"
sql_create_context
CREATE TABLE table_204_866 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first name on the chart
SELECT "name" FROM table_204_866 WHERE id = 1
squall
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, avail...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_91 ( _jerk VARCHAR, clean_ INTEGER, snatch VARCHAR, bodyweight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the biggest clean and jerk number when snatch was less than 150 and the bodyweight was bigger than 93.13?
SELECT MAX(clean_) & _jerk FROM table_name_91 WHERE snatch < 150 AND bodyweight > 93.13
sql_create_context
CREATE TABLE table_42829 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date for the actual title archie bunker's place?
SELECT "Date" FROM table_42829 WHERE "Actual Title" = 'archie bunker''s place'
wikisql
CREATE TABLE table_203_394 ( id number, "title" text, "author" text, "date" number, "length\n(first edition)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many bulldog drummond books did gerard fairlie write ?
SELECT COUNT("title") FROM table_203_394 WHERE "author" = 'gerard fairlie'
squall
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MEMPHIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V...
atis
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, ...
SELECT * 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 = '80814674' AND hz_info.YLJGDM = '0600104' AND wdmzjzjlb.JZZDSM LIKE '%牙龈%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_i...
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptions ( row_id number, s...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4718) AND prescriptions.route = 'tt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-48 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM Users WHERE (LOWER(Location) LIKE '%kuwait%' OR Location LIKE '%KW') AND NOT (LOWER(Location) LIKE '%ontario%') AND LENGTH(Location) > 1 LIMIT 100
sede
CREATE TABLE table_37262 ( "Season" text, "Competition" text, "Round" text, "Club" text, "Home" text, "Away" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what place has the club of sevilla
SELECT "Away" FROM table_37262 WHERE "Club" = 'sevilla'
wikisql
CREATE TABLE table_24429 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With an original artist names Bette Midler, what is the order number?
SELECT COUNT("Order #") FROM table_24429 WHERE "Original artist" = 'Bette Midler'
wikisql
CREATE TABLE book ( book_id number, title text, issues number, writer text ) CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT price FROM publication WHERE publisher = "Person" OR publisher = "Wiley"
spider
CREATE TABLE table_name_67 ( nation VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nation finished with 11 silver medals?
SELECT nation FROM table_name_67 WHERE silver = 11
sql_create_context
CREATE TABLE table_1116 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Locale" FROM table_1116 WHERE "Skip" = 'Suzanne Gaudet'
wikisql
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
SELECT txmzjzjlb.KH, txmzjzjlb.KLX FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '74453436990' UNION SELECT ftxmzjzjlb.KH, ftxmzjzjlb.KLX FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '74453436990'
css
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 SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '鲁和颂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-03-16' AND '2004-10-26'
css
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...
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '4523226' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_...
css
CREATE TABLE table_19646 ( "Distance" text, "Event" text, "Record" text, "Athletes" text, "Nationality" text, "Year" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the records when Elzbieta Urbanczik competed?
SELECT "Record" FROM table_19646 WHERE "Athletes" = 'Elzbieta Urbanczik'
wikisql
CREATE TABLE table_47887 ( "Name" text, "Height (m)" real, "Height (ft)" real, "Location" text, "Year built" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year that the building in sonnemannstra e/r ckertstra e, ostend was buil...
SELECT MIN("Year built") FROM table_47887 WHERE "Location" = 'sonnemannstraße/rückertstraße, ostend' AND "Height (m)" > '185'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRADYCARDIA" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_19802 ( "#" real, "Episode" text, "Writer" text, "Director" text, "Original air date" text, "Viewing figure" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all episodes with a viewing figure of 6.72 million?
SELECT "Episode" FROM table_19802 WHERE "Viewing figure" = '6.72 million'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, Dele...
SELECT post.Id, post.Id AS "post_link", post.OwnerUserId AS "user_link", post.CreationDate, post.LastActivityDate, post.Score, COALESCE(post.ViewCount, parent.ViewCount) AS ViewCount FROM Posts AS post LEFT JOIN Posts AS parent ON post.ParentId = parent.Id WHERE (post.Body LIKE '%alt text%' OR post.Body LIKE '%enter im...
sede
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '94975740' AND hz_info.YLJGDM = '0156079' AND zyjzjlb.JZKSMC LIKE '%重症%'
css
CREATE TABLE table_120778_1 ( for_prohibition INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the minimum for prohibition?
SELECT MIN(for_prohibition) FROM table_120778_1
sql_create_context
CREATE TABLE table_71980 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where in 1985 was tim mayotte runner up?
SELECT "Location" FROM table_71980 WHERE "Year" > '1985' AND "Runner-up" = 'tim mayotte'
wikisql
CREATE TABLE table_60577 ( "Name" text, "Years" text, "MLS Cup" real, "U.S. Open Cup" real, "CONCACAF" real, "Other" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which MLS Cup has another larger than 9, and a Total smaller th...
SELECT AVG("MLS Cup") FROM table_60577 WHERE "Other" > '9' AND "Total" < '72'
wikisql
CREATE TABLE wdmzjzjlb ( 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...
SELECT jyjgzbb.JCFF FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH...
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '017-30133' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND diagnosis.diagnosisname = 'bacteremia - community acquired'...
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX ...
css
CREATE TABLE table_77141 ( "Blocks" text, "Opponent" text, "Home/Away" text, "Minutes played" real, "Points" real, "Rebounds" real, "Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were there when there were less than...
SELECT COUNT("Points") FROM table_77141 WHERE "Assists" = '5' AND "Rebounds" < '16'
wikisql
CREATE TABLE table_39221 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has a First elected larger than 1876, and an Incumbent of john s. richardson?
SELECT "Result" FROM table_39221 WHERE "First elected" > '1876' AND "Incumbent" = 'john s. richardson'
wikisql
CREATE TABLE table_24732 ( "Date" text, "Event #" text, "Event" text, "Winner" text, "Prize" text, "Entries" text, "Prize Pool" text, "Elapsed Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many categories for elapsed time exis...
SELECT COUNT("Elapsed Time") FROM table_24732 WHERE "Event" = '$16.50 Fixed-Limit Badugi'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
css
CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party ( Party_ID int, Minister text, Took_offi...
SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY Minister DESC
nvbench
CREATE TABLE table_name_42 ( surface VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the surface when the partner was Robert Haybittel?
SELECT surface FROM table_name_42 WHERE partner = "robert haybittel"
sql_create_context
CREATE TABLE table_name_93 ( score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was spain's score?
SELECT score FROM table_name_93 WHERE country = "spain"
sql_create_context
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_10877 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many caps for alister campbell from brumbies?
SELECT MIN("Caps") FROM table_10877 WHERE "Club/province" = 'brumbies' AND "Player" = 'alister campbell'
wikisql
CREATE TABLE table_15938543_1 ( original_air_date VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes had an original air date with 5.1 million viewers
SELECT COUNT(original_air_date) FROM table_15938543_1 WHERE us_viewers__million_ = "5.1"
sql_create_context
CREATE TABLE table_49517 ( "Poll Source" text, "Dates administered" text, "Democrat: Vivian Davis Figures" text, "Republican: Jeff Sessions" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the poll source for Vivian Davis ...
SELECT "Poll Source" FROM table_49517 WHERE "Lead Margin" > '27' AND "Democrat: Vivian Davis Figures" = '29%'
wikisql
CREATE TABLE table_203_431 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- according to this table , did mexico or italy have ...
SELECT "opponent" FROM table_203_431 WHERE "opponent" IN ('mexico', 'italy') AND "competition" = 'friendly' GROUP BY "opponent" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_97 ( visitor VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is listed as the Visitor that has a Home of Boston Bruins and a Date of November 15?
SELECT visitor FROM table_name_97 WHERE home = "boston bruins" AND date = "november 15"
sql_create_context
CREATE TABLE table_name_76 ( engine VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the engine for year less than 1977
SELECT engine FROM table_name_76 WHERE year < 1977
sql_create_context
CREATE TABLE table_204_772 ( id number, "team" text, "county" text, "wins" number, "years won" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last team on the chart
SELECT "team" FROM table_204_772 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2498) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-5 year') ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_79884 ( "Year" real, "Chassis" text, "Engine" text, "Tyres" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was for the vehicle with a cooper t43 chassis?
SELECT "Engine" FROM table_79884 WHERE "Chassis" = 'cooper t43'
wikisql
CREATE TABLE table_0 ( "Player" text, "No." text, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is terrence ross' nationality
SELECT "Nationality" FROM table_0 WHERE "Player" = 'Terrence Ross'
wikisql
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE tra...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 43052 AND STRFTIME('%y', admissions.admittime) >= '2105'
mimic_iii
CREATE TABLE table_54530 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Grid with 25 laps manufactured by Honda with a time of +54.103?
SELECT MIN("Grid") FROM table_54530 WHERE "Laps" = '25' AND "Manufacturer" = 'honda' AND "Time/Retired" = '+54.103'
wikisql
CREATE TABLE table_25520 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode which originally aired Februa...
SELECT "Directed by" FROM table_25520 WHERE "Original air date" = 'February 4, 2005'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, subject_i...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid 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 = 50065)) AND STRFTIME('%y-%m-%d', outputeve...
mimic_iii
CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE locations ( location_id number, street_address text, postal_code text, city text, state_province text, countr...
SELECT employee_id, first_name, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE first_name LIKE '%T%')
spider
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '魏倚云'
css
CREATE TABLE races ( name VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the race held most recently?
SELECT name FROM races ORDER BY date DESC LIMIT 1
sql_create_context
CREATE TABLE table_20324 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the college that Jeffrey Simmer plays for?
SELECT "College" FROM table_20324 WHERE "Player" = 'Jeffrey Simmer'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport_service ( city_code varchar, ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 23 AND date_day.month_number = ...
atis
CREATE TABLE table_1966992_1 ( census_2006_population INTEGER, lga_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum 2006 census population of LGA name Opobo/Nkoro?
SELECT MAX(census_2006_population) FROM table_1966992_1 WHERE lga_name = "Opobo/Nkoro"
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,...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2155704' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-11-10' AND '2009-02-24' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE qtb ( 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.PERSON_ID = '04382901' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' 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 ...
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 89037 ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii