instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_18461045_1 ( michigan VARCHAR, indiana VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the little league team from Michigan when the little league team from Indiana was Terre Haute North LL Terre Haute?
SELECT michigan FROM table_18461045_1 WHERE indiana = "Terre Haute North LL Terre Haute"
sql_create_context
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = course...
advising
CREATE TABLE table_2562572_8 ( population__2002_ INTEGER, population__2011_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowes population of 2002 when the 2011 population was 30076?
SELECT MIN(population__2002_) FROM table_2562572_8 WHERE population__2011_ = 30076
sql_create_context
CREATE TABLE table_41451 ( "Rank" real, "Location" text, "Total Passengers" real, "Annual change" text, "Capacity" real, "Capacity in use" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total capacity of the airport ranked less than ...
SELECT COUNT("Capacity") FROM table_41451 WHERE "Rank" < '7' AND "Capacity in use" = '114.2%' AND "Total Passengers" < '13,699,657'
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 ( facid number, lname text, fname text, rank text, ...
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
spider
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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, H...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4152205' AND t_kc21.IN_DIAG_DIS_NM = '精神分裂症')
css
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '10754397443'
css
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 COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5265726' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 12) AS T
css
CREATE TABLE table_9935 ( "Tournament" text, "Surface" text, "Week" text, "Winner" text, "Finalist" text, "Semifinalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Finalist, when the Surface is Clay, and when the Semifinalist is ...
SELECT "Finalist" FROM table_9935 WHERE "Surface" = 'clay' AND "Semifinalists" = 'yevgeny kafelnikov juan carlos ferrero (2)'
wikisql
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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '戚智纯' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '戚智纯' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '戚智纯' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz...
css
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which dates had below 80,000 in att...
SELECT "date" FROM table_204_55 WHERE "attendance" < 80000
squall
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_22680 ( "Name" text, "Career" text, "Matches" real, "Overs" text, "Maidens" real, "Runs" real, "Wickets" real, "Average" text, "Best" text, "5w" real, "10w" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Best" FROM table_22680 WHERE "Career" = '1971-1984'
wikisql
CREATE TABLE table_name_90 ( score VARCHAR, competition VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the league cup in the 2007-08 season?
SELECT score FROM table_name_90 WHERE competition = "league cup" AND season = "2007-08"
sql_create_context
CREATE TABLE table_name_57 ( derivatives VARCHAR, launch_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Derivative has a Launch Date of july 15, 1970; 15:05 gmt?
SELECT derivatives FROM table_name_57 WHERE launch_date = "july 15, 1970; 15:05 gmt"
sql_create_context
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.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9383115' GROUP BY t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Type, COUNT(Type) FROM ship GROUP BY Type ORDER BY Type DESC
nvbench
CREATE TABLE table_name_41 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has the player Ted Schulz?
SELECT country FROM table_name_41 WHERE player = "ted schulz"
sql_create_context
CREATE TABLE table_29361 ( "Vertical" real, "Horizontal" real, "Aspect ratio" text, "Pixel aspect ratio" text, "Scanning" text, "Frame rate ( Hz )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the minimum vertical measurement if the a...
SELECT MIN("Vertical") FROM table_29361 WHERE "Aspect ratio" = '16:9' AND "Scanning" = 'interlaced'
wikisql
CREATE TABLE table_name_39 ( tie_no VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tie no when Oxford city was the away team?
SELECT tie_no FROM table_name_39 WHERE away_team = "oxford city"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDat...
SELECT TagName AS Tag, Count FROM Tags WHERE TagName LIKE '%fhir%'
sede
CREATE TABLE table_74419 ( "Name" text, "Country" text, "Years" text, "Games" real, "Minutes" real, "Conceded" real, "Shutouts" real, "Int. caps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2010 is the year what is the game?
SELECT "Games" FROM table_74419 WHERE "Years" = '2010'
wikisql
CREATE TABLE table_66659 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Draws have Wins larger than 7, and a Wimmera FL of nhill, and Losses larger th...
SELECT SUM("Draws") FROM table_66659 WHERE "Wins" > '7' AND "Wimmera FL" = 'nhill' AND "Losses" > '8'
wikisql
CREATE TABLE table_204_206 ( id number, "saros" number, "member" number, "date" text, "time\n(greatest)\nutc" text, "type" text, "location\nlat,long" text, "gamma" number, "mag." number, "width\n(km)" number, "duration\n(min:sec)" text, "ref" number ) -- Using valid SQL...
SELECT "date" FROM table_204_206 WHERE "mag." > 1.00 ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_27948565_1 ( moto2_winner VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of moto2 winners for laguna seca
SELECT COUNT(moto2_winner) FROM table_27948565_1 WHERE circuit = "Laguna Seca"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6778599' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number...
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64519) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'neutrophils') AND STRFTIME('%y-%m', labevents.charttime) = '2104-07'
mimic_iii
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2120" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE table_15937 ( "UN Operation name" text, "UN Operation title" text, "Location" text, "Dates of Australian involvement" text, "Number of Australians involved" text, "Australian role" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT "UN Operation title" FROM table_15937 WHERE "UN Operation name" = 'UNCOK'
wikisql
CREATE TABLE table_2767 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT MIN("Production code") FROM table_2767 WHERE "Series #" = '153'
wikisql
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.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3916890' AND IN_HOSP_DATE BETWEEN '2003-07-01' AND '2021-03-29' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE table_203_823 ( id number, "model name" text, "date" text, "type" text, "thrust (kg) / power (eshp)" text, "fitted to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the top thrust achieved by a lyul ` ka engine before 1980...
SELECT "thrust (kg) / power (eshp)" FROM table_203_823 ORDER BY "thrust (kg) / power (eshp)" DESC LIMIT 1
squall
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '47604076' AND qtb.MED_SER_ORG_NO = '9869396' AND qtb.OUT_DIAG_DIS_NM LIKE '%肝功能%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '47604076' AND gyb.MED_SER_ORG_NO = '9869396' AND gyb.OUT_DIAG_DIS_NM LIKE '%肝功能%' UNION SELECT zyb.MED_CLINIC_ID FROM ...
css
CREATE TABLE table_name_69 ( points INTEGER, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is total amount of points for the 2007 season?
SELECT SUM(points) FROM table_name_69 WHERE season = 2007
sql_create_context
CREATE TABLE table_name_44 ( pick__number INTEGER, round VARCHAR, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A Round larger than 1, a College of Oklahoma state, and a average Pick # that has a Position of tight end is wh...
SELECT AVG(pick__number) FROM table_name_44 WHERE position = "tight end" AND college = "oklahoma state" AND round > 1
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_2 ( grid INTEGER, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Grid has a Time/Retired of clutch?
SELECT SUM(grid) FROM table_name_2 WHERE time_retired = "clutch"
sql_create_context
CREATE TABLE table_name_93 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home team played at MCG?
SELECT home_team FROM table_name_93 WHERE venue = "mcg"
sql_create_context
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,...
SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
nvbench
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
atis
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_203_836 ( id number, "title" text, "year" number, "platforms" text, "developer" text, "publisher" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many platforms did american mcgee 's grimm run on ?
SELECT "platforms" FROM table_203_836 WHERE "title" = "american mcgee's grimm"
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiviral therapy' AND STRFTIME('%y', treatment.tr...
eicu
CREATE TABLE table_24530 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winners share ( \u20ac )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Winning score" FROM table_24530 WHERE "Margin of victory" = '5 strokes'
wikisql
CREATE TABLE table_2429942_2 ( top_goalscorer VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the top goalscorer for season 1998-99?
SELECT top_goalscorer FROM table_2429942_2 WHERE season = "1998-99"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC
nvbench
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID
nvbench
CREATE TABLE table_20225 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was featured in 20 questions when the subject of ...
SELECT "20 Questions" FROM table_20225 WHERE "Interview subject" = 'Mike Piazza'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = co...
advising
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_name_1 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did the Victoria park home team score?
SELECT home_team AS score FROM table_name_1 WHERE venue = "victoria park"
sql_create_context
CREATE TABLE table_65267 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT MAX("Water (sqmi)") FROM table_65267 WHERE "Land ( sqmi )" > '33.576' AND "Township" = 'glenila' AND "Latitude" > '48.832189'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "JEWISH"
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 COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0952187' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-07-26' AND '2015-08-16' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 7027.62 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0952187' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-07-26' AND '...
css
CREATE TABLE table_57716 ( "Rd #" real, "Pick #" real, "Player" text, "Reg GP" real, "Pl GP" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Pick number that had a road number that was less than 6, featured Bob Dailey as a player,...
SELECT MAX("Pick #") FROM table_57716 WHERE "Rd #" < '6' AND "Player" = 'bob dailey' AND "Reg GP" > '257'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_27800 ( "Case" text, "1st pers. sing." text, "2nd pers. sing." text, "3rd pers. sing." text, "1st pers. pl" text, "2nd pers. pl." text, "3rd pers pl." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 3rd person pl f...
SELECT "3rd pers pl." FROM table_27800 WHERE "2nd pers. sing." = 'тонэн ~ тонэныд'
wikisql
CREATE TABLE table_30113 ( "Player" text, "Matches" real, "Innings" real, "Wickets" real, "Average" text, "BBI" text, "BBM" text, "5wi" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of matches?
SELECT MIN("Matches") FROM table_30113
wikisql
CREATE TABLE table_name_63 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On September 7 what was the record?
SELECT record FROM table_name_63 WHERE date = "september 7"
sql_create_context
CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE mill ( architect_id int, id int, location text, name text, ...
SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler'
nvbench
CREATE TABLE table_dev_5 ( "id" int, "anemia" bool, "gender" string, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "panel_reactive_antibodies" int, "psa" int, "body_mass_index_bmi" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT * FROM table_dev_5 WHERE panel_reactive_antibodies > 20
criteria2sql
CREATE TABLE table_name_14 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many spectators were at the away team Carlton?
SELECT crowd FROM table_name_14 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE table_43601 ( "Vacuum range" text, "Pressure in hPa (mbar)" text, "Molecules / cm 3" text, "Molecules / m 3" text, "Mean free path" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Pressure in hPa (mbar), when Vacuum Range is ...
SELECT "Pressure in hPa (mbar)" FROM table_43601 WHERE "Vacuum range" = 'medium vacuum'
wikisql
CREATE TABLE table_17357929_1 ( goal_average_1 VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the goal average 1 for teams that lost 9 games?
SELECT goal_average_1 FROM table_17357929_1 WHERE lost = 9
sql_create_context
CREATE TABLE table_38348 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the friendly match?
SELECT "Score" FROM table_38348 WHERE "Competition" = 'friendly match'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_11173827_1 ( rank VARCHAR, chinese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the chinese title ?
SELECT rank FROM table_11173827_1 WHERE chinese_title = "緣來自有機"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
SELECT COUNT(DISTINCT Comments.UserId) FROM Posts JOIN Comments ON Posts.Id = Comments.PostId WHERE Posts.ParentId = 520210
sede
CREATE TABLE table_60544 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the D Player born on 1983-07-19?
SELECT "Name" FROM table_60544 WHERE "Pos." = 'd' AND "Date of Birth" = '1983-07-19'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '69621807' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_35620 ( "Season" real, "Team" text, "Wins" real, "Losses" real, "Draws" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of losses for the team that had more than 0 draws during the seasons earlier than 1926...
SELECT MIN("Losses") FROM table_35620 WHERE "Draws" > '0' AND "Season" < '1926'
wikisql
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_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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '尤学义' AND gwyjzb.MED_SER_ORG_NO = '9145514' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '尤学义' AND fgwyjzb.MED_...
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microb...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'non-invasive mech vent') AND STRFTIME('%y', procedures_icd.charttime) = '2104'
mimic_iii
CREATE TABLE table_name_28 ( silver VARCHAR, bronze VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When volleyball has 2 bronze, what is the total number of silver?
SELECT COUNT(silver) FROM table_name_28 WHERE bronze = 2 AND sport = "volleyball"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
SELECT DISTINCT flight_id FROM flight WHERE ((departure_time <= 2100 AND departure_time >= 2000) AND from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.cit...
atis
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 WHERE t_kc21.MED_SER_ORG_NO = '4883889' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-08-03' AND '2009-12-16' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "QUET200"
mimicsql_data
CREATE TABLE table_69610 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the Boston Bruins away game on March 13?
SELECT "Score" FROM table_69610 WHERE "Visitor" = 'boston bruins' AND "Date" = 'march 13'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '82923898' AND MED_SER_ORG_NO = '7620449' AND NOT IN_DIAG_DIS_NM LIKE '%震颤麻痹%'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.formulary_drug_cd = "NIAC100"
mimicsql_data
CREATE TABLE table_name_83 ( bronze INTEGER, rank VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest bronze total that has a rank of 1 and more than 34 total medals?
SELECT MIN(bronze) FROM table_name_83 WHERE rank = "1" AND total > 34
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028') AND treatment.treatmen...
eicu
CREATE TABLE table_32838 ( "Player" text, "Span" text, "Start" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Lost" text, "Draw" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What drop has a 0 conv and Tries of 6?
SELECT "Drop" FROM table_32838 WHERE "Conv" = '0' AND "Tries" = '6'
wikisql
CREATE TABLE table_name_81 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent has april 23 as the date?
SELECT opponent FROM table_name_81 WHERE date = "april 23"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
atis
CREATE TABLE table_51830 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What constructor has a grid less than 13 with under 9 laps?
SELECT "Constructor" FROM table_51830 WHERE "Grid" < '13' AND "Laps" < '9'
wikisql
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_name_14 ( block_a VARCHAR, el_nosawa_mendoza VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Block A value for an El NOSAWA Mendoza value of kondo (7:08)?
SELECT block_a FROM table_name_14 WHERE el_nosawa_mendoza = "kondo (7:08)"
sql_create_context
CREATE TABLE table_19075 ( "Previous season" text, "Team" text, "Town" text, "Arena (capacity)" text, "Website" text, "Head Coach" text, "Foreign Players (max. 2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the head coach in seas...
SELECT "Head Coach" FROM table_19075 WHERE "Previous season" = '2'
wikisql
CREATE TABLE table_73998 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for augustine h. shepperd (j) 100%
SELECT "Result" FROM table_73998 WHERE "Candidates" = 'Augustine H. Shepperd (J) 100%'
wikisql
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUnder...
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name
nvbench
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 jyjgzbb ( JYZBLSH text, YLJGD...
SELECT COUNT(*) FROM jybgb WHERE JZLSH = '08934000082'
css
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 jyjgzbb ( JYZBLSH text, YLJGD...
SELECT JZKSDM, JZKSMC FROM zyjzjlb WHERE JZLSH = '81908444288'
css
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
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 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 person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJG...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.dob_year < "2134"
mimicsql_data