instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop, food_service WHERE ((CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'NEW YOR... | atis |
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
total_value_purchased DECIMAL(19,4)
)
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER... | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id | nvbench |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 45316) AND microbiologyevents.spec_type_desc = 'tissue' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-58 month') ORDER BY mi... | mimic_iii |
CREATE TABLE table_9335 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the score when the game is higher than 66 on march 28?
| SELECT "Score" FROM table_9335 WHERE "Game" > '66' AND "March" = '28' | wikisql |
CREATE TABLE table_44001 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did Rich Manning play?
| SELECT "Position" FROM table_44001 WHERE "Player" = 'rich manning' | 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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.short_title = "Endosc retro cholangiopa" | mimicsql_data |
CREATE TABLE table_15187735_15 (
segment_a VARCHAR,
segment_c VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Segment A where Segment C is Sushi (part 1)?
| SELECT segment_a FROM table_15187735_15 WHERE segment_c = "Sushi (Part 1)" | sql_create_context |
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 (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_50441 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver had 35+3 poi... | SELECT "Driver" FROM table_50441 WHERE "Points" = '35+3' | wikisql |
CREATE TABLE table_77247 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position did Luca Sbisa play for the Philadelphia Flyers?
| SELECT "Position" FROM table_77247 WHERE "Player" = 'luca sbisa' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'dmii oth n... | mimic_iii |
CREATE TABLE table_79516 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Bronze has a Gold larger than 1, and a Silver smaller than 3, and a Nation of germa... | SELECT COUNT("Bronze") FROM table_79516 WHERE "Gold" > '1' AND "Silver" < '3' AND "Nation" = 'germany' AND "Total" > '11' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_cod... | 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 (((flight.airline_code = 'DL') AND flight.flight_number = 217) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRAN... | atis |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Other preterm infants, 1,750-1,999 grams" | mimicsql_data |
CREATE TABLE table_204_215 (
id number,
"airline" text,
"destination(s)" text,
"aircraft scheduled" text,
"service date(s)" text,
"comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what airline has the same scheduled aircraft as beaver av... | SELECT "airline" FROM table_204_215 WHERE "airline" <> 'beaver aviation / bas airlines' AND "aircraft scheduled" = (SELECT "aircraft scheduled" FROM table_204_215 WHERE "airline" = 'beaver aviation / bas airlines') | squall |
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 prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2004)) AND DATETIME(inputevents_cv.charttime) >= DATETIME(CURRENT_TIME(), '-1020 day') | mimic_iii |
CREATE TABLE table_name_36 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2011 when the 2010 shows grand slam tournaments?
| SELECT 2011 FROM table_name_36 WHERE 2010 = "grand slam tournaments" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
... | SELECT building, COUNT(building) FROM department GROUP BY building | nvbench |
CREATE TABLE table_15396 (
"Date" text,
"Opponent" text,
"Site" text,
"Score" text,
"Loss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game on Thursday, April 29, and they played the Chicago Cubs?
| SELECT "Site" FROM table_15396 WHERE "Opponent" = 'chicago cubs' AND "Date" = 'thursday, april 29' | wikisql |
CREATE TABLE table_203_131 (
id number,
"pos." number,
"car #" number,
"driver" text,
"make" text,
"team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did jason leffler race for braun racing or michael waltrip racing ?
| SELECT "team" FROM table_203_131 WHERE "team" IN ('braun racing', 'michael waltrip racing') AND "driver" = 'jason leffler' | squall |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT Posts.Id AS "post_link", Posts.Score FROM Posts WHERE Posts.ClosedDate IS NULL AND PostTypeId = 1 AND Posts.Id NOT IN (SELECT Comments.PostId FROM Comments) AND Posts.Id IN (SELECT Votes.PostId FROM Votes WHERE Votes.VoteTypeId = 3) ORDER BY Posts.Id DESC LIMIT 10000 | sede |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.itemid = "50914" | mimicsql_data |
CREATE TABLE table_16677887_2 (
record VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record for the game on Sept. 14?
| SELECT record FROM table_16677887_2 WHERE date = "Sept. 14" | sql_create_context |
CREATE TABLE table_dev_4 (
"id" int,
"hypothyroidism" bool,
"serum_bicarbonate" int,
"c_peptide_level" float,
"autoimmune_disease" bool,
"hemoglobin_a1c_hba1c" float,
"positive_serum" bool,
"inhaled_steroids" bool,
"diabetic_ketoacidosis" bool,
"creatinine_clearance_cl" float,
... | SELECT * FROM table_dev_4 WHERE hemoglobin_a1c_hba1c < 12 | criteria2sql |
CREATE TABLE table_78960 (
"Goalkeeper" text,
"Goals" real,
"Matches" real,
"Average" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Goals, when Matches is less than 29?
| SELECT SUM("Goals") FROM table_78960 WHERE "Matches" < '29' | wikisql |
CREATE TABLE table_name_76 (
competition VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Competition's Score was 1-2?
| SELECT competition FROM table_name_76 WHERE score = "1-2" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) DESC | nvbench |
CREATE TABLE table_22205 (
"Song title" text,
"Artist" text,
"Decade" text,
"Genre" text,
"Single / Pack name" text,
"Release date" text,
"Family Friendly" text,
"Additional Rock Band 3 Features" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT "Release date" FROM table_22205 WHERE "Song title" = 'Had a Dad' | wikisql |
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 treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-12508' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 1417 AND STRFTIME('%y', admissions.admittime) >= '2101' | mimic_iii |
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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '73506592' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2109.01) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '73506592' AND gyb.MED_CLINIC_ID IN (SELECT t_kc2... | css |
CREATE TABLE table_8317 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Opponent in Week 9?
| SELECT "Opponent" FROM table_8317 WHERE "Week" = '9' | 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 * FROM qtb WHERE qtb.PERSON_NM = '任光远' AND qtb.MED_SER_ORG_NO = '7880257' AND qtb.MED_ORG_DEPT_NM LIKE '%骨伤科%' UNION SELECT * FROM gyb WHERE gyb.PERSON_NM = '任光远' AND gyb.MED_SER_ORG_NO = '7880257' AND gyb.MED_ORG_DEPT_NM LIKE '%骨伤科%' UNION SELECT * FROM zyb WHERE zyb.PERSON_NM = '任光远' AND zyb.MED_SER_ORG_NO = '... | css |
CREATE TABLE table_2457 (
"#" real,
"Japanese title" text,
"R\u014dmaji" text,
"Japanese translation" text,
"Vocalist" text,
"Episodes used" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 1 is the number what episodes were used?
| SELECT "Episodes used" FROM table_2457 WHERE "#" = '1' | wikisql |
CREATE TABLE table_name_16 (
builder VARCHAR,
works_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the builder with a works number of 2534?
| SELECT builder FROM table_name_16 WHERE works_number = "2534" | sql_create_context |
CREATE TABLE table_23465864_5 (
mon_24_aug VARCHAR,
rider VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value of Monday August 24 if the rider is Benny Smith 600cc Yamaha?
| SELECT mon_24_aug FROM table_23465864_5 WHERE rider = "Benny Smith 600cc Yamaha" | sql_create_context |
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(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_NM = '柳静雅' AND IN_HOSP_DATE BETWEEN '2010-04-28' AND '2020-04-14' | 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 icustays (
row_id number,
... | 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, 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_... | mimic_iii |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'Y37.102' AND jyjgzbb.JCZBMC = '转铁蛋白' | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'potassium chloride' ORDER BY prescriptions.s... | mimic_iii |
CREATE TABLE table_name_71 (
season VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season has a Result of 6 9?
| SELECT season FROM table_name_71 WHERE result = "6–9" | sql_create_context |
CREATE TABLE table_41172 (
"Issue" text,
"Date" text,
"Title" text,
"Penciller" text,
"Color" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Issue with the Title Homecoming come out?
| SELECT "Date" FROM table_41172 WHERE "Title" = 'homecoming' | wikisql |
CREATE TABLE table_name_74 (
fcc_info VARCHAR,
city_of_license VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the FCC info for the city of Tribune, Kansas?
| SELECT fcc_info FROM table_name_74 WHERE city_of_license = "tribune, kansas" | sql_create_context |
CREATE TABLE table_25146455_1 (
position INTEGER,
winnings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what position was the driver who won $60,000?
| SELECT MIN(position) FROM table_25146455_1 WHERE winnings = "$60,000" | sql_create_context |
CREATE TABLE field (
fieldid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int... | SELECT DISTINCT WRITES_0.paperid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'Philipp Haberstock' AND AUTHOR_1.authorname = 'Ludwig Nastansky' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WR... | scholar |
CREATE TABLE table_name_15 (
years VARCHAR,
distance VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the years for marathon distance and wins of 3
| SELECT years FROM table_name_15 WHERE distance = "marathon" AND wins = 3 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE T... | SELECT ph.PostId AS "post_link", revisions = 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' FROM PostHistory AS ph INNER JOIN Posts AS p ON p.Id = ph.PostId WHERE (ph.PostHistoryTypeId = 16) AND (ph.UserId != p.OwnerUserId) AND ph.Id IN (SELECT MAX(Id) AS last FROM PostHistory GROUP BY PostId) ORDER BY ph.Pos... | sede |
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 t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '水宏茂' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-01-30' AND '2008-06-28' | css |
CREATE TABLE table_name_49 (
canadian_kennel_club_toy_dogs_group VARCHAR,
australian_national_kennel_council_toy_dogs_group VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Canadian Kennel Club Toy Dogs Group with the australian silky terrier as th... | SELECT canadian_kennel_club_toy_dogs_group FROM table_name_49 WHERE australian_national_kennel_council_toy_dogs_group = "australian silky terrier" | sql_create_context |
CREATE TABLE table_53246 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the Circuit of India... | SELECT "Date" FROM table_53246 WHERE "Circuit" = 'indianapolis' | wikisql |
CREATE TABLE table_54155 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the crowd over 19,298 when Sout... | SELECT "Date" FROM table_54155 WHERE "Crowd" > '19,298' AND "Home team" = 'south melbourne' | wikisql |
CREATE TABLE table_53645 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for the away team when the hom... | SELECT "Away team score" FROM table_53645 WHERE "Home team score" = '19.17 (131)' | 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 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2203" AND procedures.long_title = "Regional lymph node excision" | mimicsql_data |
CREATE TABLE table_name_52 (
birth VARCHAR,
became_duchess VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Birth of the lady that has a Became Duchess on 18 august 1593 husband's accession?
| SELECT birth FROM table_name_52 WHERE became_duchess = "18 august 1593 husband's accession" | sql_create_context |
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_number number,
draft_class text,
college text
)
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREA... | SELECT T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T2.position = "Forward" INTERSECT SELECT T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T2.position = "Defender" | spider |
CREATE TABLE table_name_67 (
english_title__chinese_title_ VARCHAR,
airing_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which title aired on 18 dec 2006- 10 feb 2007?
| SELECT english_title__chinese_title_ FROM table_name_67 WHERE airing_date = "18 dec 2006- 10 feb 2007" | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType DESC | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-164523')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURR... | eicu |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpa... | SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'li dong' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_train_52 (
"id" int,
"pregnancy_or_lactation" bool,
"consent" bool,
"surgery" bool,
"hemodynamic_instability" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- surgical intervention in context with... | SELECT * FROM table_train_52 WHERE surgery = 1 | criteria2sql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
... | SELECT ID, salary FROM instructor ORDER BY salary | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLO... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1796719' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-06-11' AND '2015-12-01' | css |
CREATE TABLE table_204_261 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total of medals earned by russia ?
| SELECT "total" FROM table_204_261 WHERE "nation" = 'russia' | squall |
CREATE TABLE table_24928 (
"Name" text,
"Position" text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Home Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the height is 185cm and the home team is Heaton Mersey, what is the date o... | SELECT "Date of Birth" FROM table_24928 WHERE "Height" = '185cm' AND "Home Team" = 'Heaton Mersey' | wikisql |
CREATE TABLE table_28088 (
"Episode Number" real,
"Episode" text,
"Rating" text,
"Share" real,
"Rating/Share (18-49)" text,
"Viewers (millions)" text,
"Rank (Timeslot)" real,
"Rank (Night)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Rating" FROM table_28088 WHERE "Share" = '4' AND "Rating/Share (18-49)" = '0.7/2' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE a... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-910')) AND treatment.treatmentname = 'external fixation device' AND STRF... | eicu |
CREATE TABLE table_46278 (
"Club" text,
"Champions" real,
"Runners-up" real,
"3rd-Place" real,
"4th-Place" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Runners-Up, when Champions is less than 0?
| SELECT MAX("Runners-up") FROM table_46278 WHERE "Champions" < '0' | wikisql |
CREATE TABLE table_67111 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the host team for january 1 (2006)
| SELECT "Host Team" FROM table_67111 WHERE "Date" = 'january 1 (2006)' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND procedures.icd9_code = "3783" | mimicsql_data |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.OUT_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3002384' GROUP BY qtb.OUT_DIAG_DIS_NM UNION SELECT gyb.OUT_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3002384' GROUP BY gyb.OUT_DIAG_DIS_NM UNION SELECT zyb.OUT_DIAG_DIS_NM, AVG(zyb.PERSON_AGE) FROM zyb WHERE... | css |
CREATE TABLE table_name_51 (
population VARCHAR,
deed_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population for Deed number of 21352021?
| SELECT population FROM table_name_51 WHERE deed_number = "21352021" | sql_create_context |
CREATE TABLE table_77233 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round number for donnie caraway?
| SELECT MAX("Round") FROM table_77233 WHERE "Name" = 'donnie caraway' | wikisql |
CREATE TABLE procedures (
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 WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND demographic.days_stay > "14" | mimicsql_data |
CREATE TABLE table_58746 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has a Place of 2?
| SELECT "Country" FROM table_58746 WHERE "Place" = '2' | wikisql |
CREATE TABLE table_204_87 (
id number,
"courthouse" text,
"city" text,
"street address" text,
"jurisdiction" text,
"dates of use" text,
"named for" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which jurisdiction has the most courthouses ?
| SELECT "jurisdiction" FROM table_204_87 GROUP BY "jurisdiction" ORDER BY COUNT("courthouse") DESC LIMIT 1 | squall |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id 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 tex... | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '41430407750' | css |
CREATE TABLE table_68852 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the airport with IATA of dmk
| SELECT "Airport" FROM table_68852 WHERE "IATA" = 'dmk' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | 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, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code A... | atis |
CREATE TABLE table_204_459 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many people attended the game ... | SELECT "attendance" FROM table_204_459 WHERE "date" = '12/01/2013' | squall |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_203_300 (
id number,
"year" number,
"tournament" text,
"venue" text,
"result" text,
"extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when did she first win first place ?
| SELECT MIN("year") FROM table_203_300 WHERE "result" = 1 | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pantaprazole' AND d... | mimic_iii |
CREATE TABLE table_name_93 (
position VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player from Sweden?
| SELECT position FROM table_name_93 WHERE nationality = "sweden" | sql_create_context |
CREATE TABLE table_55670 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home team plays in the Corio Oval venue?
| SELECT "Home team" FROM table_55670 WHERE "Venue" = 'corio oval' | wikisql |
CREATE TABLE table_name_54 (
april INTEGER,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which April has a Game of 84
| SELECT MAX(april) FROM table_name_54 WHERE game = 84 | sql_create_context |
CREATE TABLE table_25987797_1 (
location VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the school in Lucas ?
| SELECT location FROM table_25987797_1 WHERE school = "Lucas" | sql_create_context |
CREATE TABLE table_70585 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Rank" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine was used by Curb Motorsports after 1982 that had 11 points?
| SELECT "Engine" FROM table_70585 WHERE "Year" > '1982' AND "Points" = '11' AND "Team" = 'curb motorsports' | wikisql |
CREATE TABLE table_name_92 (
year VARCHAR,
project VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Bulworth nominated?
| SELECT year FROM table_name_92 WHERE project = "bulworth" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "D10W" | mimicsql_data |
CREATE TABLE table_21795650_1 (
f_laps INTEGER,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of f/laps in the Italian Formula Renault 2.0 Winter Series?
| SELECT MIN(f_laps) FROM table_21795650_1 WHERE series = "Italian Formula Renault 2.0 Winter series" | sql_create_context |
CREATE TABLE table_name_55 (
total INTEGER,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the sum of total when year(s) won is 1985?
| SELECT SUM(total) FROM table_name_55 WHERE year_s__won = "1985" | sql_create_context |
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.discharge_location = "HOME" AND lab.label = "Rheumatoid Factor" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid nu... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'delirium tremens') AND STRFTIME('%y', diagnoses_icd.chartt... | mimic_iii |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '16021187507' | css |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1796719' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-06-11' AND '2015-12-01' AND t_kc21.SERVANT_FLG = '公务员' | 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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '沈馨欣' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3945.59) | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.