instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Room (
RoomNumber INTEGER,
RoomType VARCHAR(30),
BlockFloor INTEGER,
BlockCode INTEGER,
Unavailable BOOLEAN
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INT... | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY Name | nvbench |
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connectio... | SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id ORDER BY name | nvbench |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the oldest student?
| SELECT name FROM person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student') | spider |
CREATE TABLE table_775 (
"District" text,
"Incumbent" text,
"Party" text,
"Elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for california 2?
| SELECT "Result" FROM table_775 WHERE "District" = 'California 2' | wikisql |
CREATE TABLE table_68514 (
"Round" real,
"Name" text,
"Position" text,
"School" text,
"Signed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Was the University of Southern California Signed?
| SELECT "Signed" FROM table_68514 WHERE "School" = 'university of southern california' | 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.JYZBLSH 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 = jyjgzbb.YLJGDM A... | css |
CREATE TABLE table_8734 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value for Game, when Points... | SELECT MAX("Game") FROM table_8734 WHERE "Points" = '16' AND "Date" = 'november 11, 2008' AND "Attendance" > '19,289' | wikisql |
CREATE TABLE table_train_80 (
"id" int,
"mini_mental_state_examination_mmse" int,
"uncontrolled_diabetes" bool,
"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,
"cornell_scale_for_depression_in_dementia_csdd" int,
"clinical_dementia_rating_cdr" float,
"age" float,
"NOUSE" float
)... | SELECT * FROM table_train_80 WHERE age >= 60 | criteria2sql |
CREATE TABLE table_79619 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowe... | SELECT MIN("High Checkout") FROM table_79619 WHERE "140+" = '61' AND "Played" > '6' | wikisql |
CREATE TABLE table_44787 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the game score 103-94?
| SELECT "Date" FROM table_44787 WHERE "Score" = '103-94' | wikisql |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE Products (
Product_ID VARCHAR(100),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Product_Description VARCHAR(255),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Bookings_Services (
Order_ID INTEGER,
Product_ID INTEGER
)
CREATE TABLE Drama_Workshop_Groups... | SELECT Order_Date, COUNT(Order_Date) FROM Bookings | nvbench |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUser... | SELECT Tags.TagName, COUNT(DISTINCT Posts.Id) AS first_questions, Tags.Count AS total_questions, COUNT(DISTINCT Posts.Id) * 1.0 / Tags.Count AS ratio_of_questions_that_are_first_questions FROM Posts INNER JOIN (SELECT OwnerUserId, MIN(CreationDate) AS first_post FROM Posts GROUP BY OwnerUserId) AS sq ON Posts.OwnerUser... | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.label = "Homocysteine" | mimicsql_data |
CREATE TABLE table_name_52 (
venue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Venue is listed under the Date of 21st?
| SELECT venue FROM table_name_52 WHERE date = "21st" | sql_create_context |
CREATE TABLE table_20386 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what lagua... | SELECT "Language" FROM table_20386 WHERE "Television service" = 'ContoTV 5' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "9" AND lab.label = "Promyelocytes" | mimicsql_data |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | SELECT roomid, roomname FROM rooms ORDER BY baseprice DESC LIMIT 1 | spider |
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "43" | mimicsql_data |
CREATE TABLE table_19238 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the ground where th... | SELECT "Ground" FROM table_19238 WHERE "Crowd" = '19929' | wikisql |
CREATE TABLE Player (
weight INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum and minimum height of all players?
| SELECT MAX(weight), MIN(weight) FROM Player | sql_create_context |
CREATE TABLE table_37799 (
"Episode No." real,
"Episode Title" text,
"UK Broadcast Date" text,
"Narrator" text,
"Writer" text,
"Details of Journey" text,
"Countries Visited" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which countries visi... | SELECT "Countries Visited" FROM table_37799 WHERE "Episode No." < '7' AND "Writer" = 'ray gosling' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id | advising |
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '矽肺(硅肺)Ⅲ期' AND jyjgzbb.JCZBMC ... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "20" AND diagnoses.icd9_code = "42731" | mimicsql_data |
CREATE TABLE table_38425 (
"Party" text,
"Votes cast" real,
"Percentage" real,
"Seats won" real,
"Percent of seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party won less than 21 seats, has 0 percent of seats, and 69757 votes cast?
| SELECT "Party" FROM table_38425 WHERE "Seats won" < '21' AND "Percent of seats" = '0' AND "Votes cast" = '69757' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480' AND patient.hosp... | eicu |
CREATE TABLE table_17623902_1 (
production_code VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes did Julie Martin wrote for the show If every episode has its own production code?
| SELECT COUNT(production_code) FROM table_17623902_1 WHERE written_by = "Julie Martin" | sql_create_context |
CREATE TABLE table_3638 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many million... | SELECT "U.S. viewers (in millions)" FROM table_3638 WHERE "Title" = 'The Grandfather' | wikisql |
CREATE TABLE table_name_17 (
date VARCHAR,
internet_explorer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date when internet explorer was 62.2%
| SELECT date FROM table_name_17 WHERE internet_explorer = "62.2%" | sql_create_context |
CREATE TABLE table_train_89 (
"id" int,
"chronically_uncontrolled_hypertension" bool,
"uncontrolled_diabetes" bool,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"geriatric_depression_scale_gds" int,
"major_depression" bool,... | SELECT * FROM table_train_89 WHERE body_weight > 300 | criteria2sql |
CREATE TABLE table_30081 (
"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.
-- Name t... | SELECT COUNT("High assists") FROM table_30081 WHERE "Record" = '34-27' | wikisql |
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_procedures (
row_id number,
icd9_code text,
s... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26849) AND prescriptions.drug = 'senna' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescrip... | mimic_iii |
CREATE TABLE table_name_75 (
set_1 VARCHAR,
set_3 VARCHAR,
set_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Set 1 game score when Set 3 game score was 15 4, and a Set 2 game score was 15 7?
| SELECT set_1 FROM table_name_75 WHERE set_3 = "15–4" AND set_2 = "15–7" | sql_create_context |
CREATE TABLE table_78697 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what place was Tiger Woods of the United States?
| SELECT "Place" FROM table_78697 WHERE "Country" = 'united states' AND "Player" = 'tiger woods' | wikisql |
CREATE TABLE table_76099 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Player that spent the Year 2005 in Orlando?
| SELECT "Player" FROM table_76099 WHERE "Years in Orlando" = '2005' | wikisql |
CREATE TABLE table_65389 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" text,
"Total Goals" real
)
-- Usin... | SELECT COUNT("League Goals") FROM table_65389 WHERE "Name" = 'simon charlton' | wikisql |
CREATE TABLE table_31576 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the venue of 29 april 2007
| SELECT "Venue" FROM table_31576 WHERE "Date" = '29 april 2007' | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Arteriography of cerebral arteries" | mimicsql_data |
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 FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '张兴昌' 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 gyb.P... | css |
CREATE TABLE table_53539 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the time/retired when the driver is toulo de graffenried?
| SELECT "Time/retired" FROM table_53539 WHERE "Driver" = 'toulo de graffenried' | wikisql |
CREATE TABLE endowment (
endowment_id number,
school_id number,
donator_name text,
amount number
)
CREATE TABLE budget (
school_id number,
year number,
budgeted number,
total_budget_percent_budgeted number,
invested number,
total_budget_percent_invested number,
budget_invest... | SELECT school_name, location, mascot FROM school | spider |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69895 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'rocuronium' | mimic_iii |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password... | SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.student_id | nvbench |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50863" | mimicsql_data |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | 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 course.number BETWEEN 300 AND 300 + 100 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester... | advising |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
s... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'periph nerve transposit') AND DATETIME(procedures_ic... | mimic_iii |
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CREATE TABLE students (
student_id number,
date_of_registration tim... | SELECT personal_name FROM students EXCEPT SELECT T1.personal_name FROM students AS T1 JOIN student_course_enrolment AS T2 ON T1.student_id = T2.student_id | spider |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | (SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | 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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '39665457' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7246.13) | css |
CREATE TABLE table_name_3 (
name VARCHAR,
unit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the non mammal of the unit vyazniki assemblage?
| SELECT name FROM table_name_3 WHERE unit = "vyazniki assemblage" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Platelet Count" | mimicsql_data |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND diagnoses.long_title = "Chronic obstructive asthma, unspecified" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE table_name_80 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest 2010 that has a 2009 less than 6.5, 0.4 as the 2008, with a 2007 less than 0.5?
| SELECT MAX(2010) FROM table_name_80 WHERE 2009 < 6.5 AND 2008 = 0.4 AND 2007 < 0.5 | 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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '58596815' AND t_kc21.MED_SER_ORG_NO = '1792451' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%阻塞性%' | css |
CREATE TABLE table_53373 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Turkey scorers" text,
"Match report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the competition for score of 3-0
| SELECT "Competition" FROM table_53373 WHERE "Score" = '3-0' | wikisql |
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 lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'rbc'... | eicu |
CREATE TABLE table_20860739_1 (
round VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds did Virginia have?
| SELECT round FROM table_20860739_1 WHERE college = "Virginia" | sql_create_context |
CREATE TABLE table_25252080_3 (
november_3 VARCHAR,
march_27_29 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- november 3 where march 27-29 is 149?
| SELECT november_3 FROM table_25252080_3 WHERE march_27_29 = "149" | sql_create_context |
CREATE TABLE table_71175 (
"Year" real,
"Class" text,
"Tyres" text,
"Team" text,
"Co-Drivers" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which co-driver has fewer than 282 laps and type P ... | SELECT "Co-Drivers" FROM table_71175 WHERE "Laps" < '282' AND "Tyres" = 'p' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '6010828' GROUP BY qtb.MED_ORG_DEPT_CD HAVING MAX(qtb.IN_HOSP_DAYS) < 24 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '6010828' GROUP BY gyb.MED_ORG_DEPT_CD HAVING MAX(gyb.IN_HOSP_DAYS) < 24 UNION SELECT zyb.MED... | css |
CREATE TABLE table_27537870_5 (
december VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the december for record 14-17-4
| SELECT december FROM table_27537870_5 WHERE record = "14-17-4" | sql_create_context |
CREATE TABLE table_name_20 (
winner VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner for the match on October 7?
| SELECT winner FROM table_name_20 WHERE date = "october 7" | sql_create_context |
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_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '周兰若' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2010-11-15' AND '2020-06-07' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_5256 (
"Episode" real,
"Title" text,
"Airdate (Canada)" text,
"Airdate (USA)" text,
"CBS airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which episode aired in the USA on 20 May 2005?
| SELECT "Episode" FROM table_5256 WHERE "Airdate (USA)" = '20 may 2005' | wikisql |
CREATE TABLE table_42808 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people went to the game with Indiana visiting?
| SELECT "Attendance" FROM table_42808 WHERE "Visitor" = 'indiana' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Other finger(s) amputation status" | mimicsql_data |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TA... | 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 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CI... | atis |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2035" AND diagnoses.short_title = "Preterm NEC 1750-1999g" | mimicsql_data |
CREATE TABLE table_48089 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Method has a Round of 1, and a Record of 4 2?... | SELECT "Method" FROM table_48089 WHERE "Round" = '1' AND "Record" = '4–2' | wikisql |
CREATE TABLE gyb (
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '3850390' AND qtb.IN_DIAG_DIS_NM = '躁狂抑郁性精神病当前为抑郁相' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '3850390' AND gyb.IN_DIAG_DIS_NM = '躁狂抑郁性精神病当... | css |
CREATE TABLE table_14573770_4 (
winners INTEGER,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times did argentina win?
| SELECT MAX(winners) FROM table_14573770_4 WHERE nation = "Argentina" | sql_create_context |
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.gender = "M" AND prescriptions.formulary_drug_cd = "MIDO5" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientuni... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS N... | eicu |
CREATE TABLE table_name_42 (
time VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Time, when Laps is 22, and when Grid is 15?
| SELECT time FROM table_name_42 WHERE laps = 22 AND grid = 15 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_lo... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'US') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SER... | atis |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medication... | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-29268') | eicu |
CREATE TABLE table_name_93 (
channels VARCHAR,
clock_rate__mhz_ VARCHAR,
bandwidth__mb_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Clock rate (MHz) smaller than 400, and a Bandwidth (MB/s) of 1420 has what channels?
| SELECT channels FROM table_name_93 WHERE clock_rate__mhz_ < 400 AND bandwidth__mb_s_ = 1420 | sql_create_context |
CREATE TABLE camera_lens (
id number,
brand text,
name text,
focal_length_mm number,
max_aperture number
)
CREATE TABLE photos (
id number,
camera_lens_id number,
mountain_id number,
color text,
name text
)
CREATE TABLE mountain (
id number,
name text,
height number... | SELECT T1.id, T1.name FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id GROUP BY T1.id HAVING COUNT(*) >= 2 | spider |
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 AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'fentanyl 2000 mcg/100 ml ns')) AND STRFTIME('%... | eicu |
CREATE TABLE table_9329 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest round that had northwestern?
| SELECT MAX("Round") FROM table_9329 WHERE "School" = 'northwestern' | wikisql |
CREATE TABLE table_name_54 (
horse VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What horse was at the Badminton Horse Trials?
| SELECT horse FROM table_name_54 WHERE competition = "badminton horse trials" | sql_create_context |
CREATE TABLE table_203_247 (
id number,
"district" text,
"counties represented" text,
"delegate" text,
"party" text,
"first elected" number,
"committee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many delegates are under the democrat... | SELECT COUNT("delegate") FROM table_203_247 WHERE "party" = 'democratic' AND "counties represented" = 'frederick' | squall |
CREATE TABLE table_169955_1 (
saka_era VARCHAR,
sign_of_zodiac VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the saka era for sign of zodiac being pisces
| SELECT saka_era FROM table_169955_1 WHERE sign_of_zodiac = "Pisces" | sql_create_context |
CREATE TABLE table_name_55 (
film VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What film was in 1970?
| SELECT film FROM table_name_55 WHERE year = 1970 | sql_create_context |
CREATE TABLE table_27329 (
"Region" text,
"Public network" text,
"Own/community generator" text,
"Solar panel" text,
"Other source" text,
"None" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of public network in the regio... | SELECT "Public network" FROM table_27329 WHERE "Other source" = '0.1%' AND "Solar panel" = '0.0%' AND "Region" = 'Maule' | wikisql |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND procedures.icd9_code = "7761" | mimicsql_data |
CREATE TABLE table_name_3 (
launches INTEGER,
successes VARCHAR,
failures VARCHAR,
rocket VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are average launches with 0 failures, rocket of Soyuz, and less than 12 successes?
| SELECT AVG(launches) FROM table_name_3 WHERE failures = 0 AND rocket = "soyuz" AND successes < 12 | sql_create_context |
CREATE TABLE table_50593 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Outcome, when Surface is 'Carpet (I)', and when ... | SELECT "Outcome" FROM table_50593 WHERE "Surface" = 'carpet (i)' AND "Date" = '15 november 1993' | wikisql |
CREATE TABLE table_19575 (
"Rank" real,
"Country" text,
"International tourist arrivals (2012)" text,
"International tourist arrivals (2011)" text,
"Change (2011 to 2012)" text,
"Change (2010 to 2011)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT COUNT("International tourist arrivals (2012)") FROM table_19575 WHERE "Rank" = '1' | wikisql |
CREATE TABLE airport (
International_Passengers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all information on the airport that has the largest number of international passengers.
| SELECT * FROM airport ORDER BY International_Passengers DESC LIMIT 1 | 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 medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12221')) AND STRFTIME('%y-%m', medication.drugstarttime) =... | eicu |
CREATE TABLE table_name_48 (
date VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Game is '8'?
| SELECT date FROM table_name_48 WHERE game = 8 | sql_create_context |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperda... | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'reinforcement learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpape... | scholar |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CR... | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY COUNT(services) | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CHRISTIAN SCIENTIST" | mimicsql_data |
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 t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_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.MED_SER_ORG_NO = '1301114' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DI... | css |
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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "UPPER GI BLEED" | mimicsql_data |
CREATE TABLE table_31267 (
"Season" real,
"Apocalypstix" text,
"Denim Demons" text,
"Sake Tuyas" text,
"Toxic Shocks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent season where the Denim Demons placed 3rd?
| SELECT MAX("Season") FROM table_31267 WHERE "Denim Demons" = '3rd' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.