instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_19 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent with record of 6-2
| SELECT opponent FROM table_name_19 WHERE record = "6-2" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIR... | atis |
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 EMAIL, EMPLOYEE_ID 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_203_330 (
id number,
"year of election" number,
"candidates elected" number,
"# of seats available" number,
"# of votes" number,
"% of popular vote" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the smallest number o... | SELECT MIN("# of votes") FROM table_203_330 WHERE "year of election" < 2003 | squall |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | 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 = 'insulin regular human 100 unit/ml ij soln')) A... | eicu |
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(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 746 AND instructor.name LIKE '%Beth Wilensky%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offer... | advising |
CREATE TABLE table_21150 (
"Religion" text,
"Suriname" text,
"Paramaribo" text,
"Wanica" text,
"Nickerie" text,
"Coronie" text,
"Saramacca" text,
"Commewijne" text,
"Marowijne" text,
"Para" text,
"Brokopondo" text,
"Sipaliwini" text
)
-- Using valid SQLite, answer the f... | SELECT "Para" FROM table_21150 WHERE "Commewijne" = '1.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.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND lab.label = "Basophils" | mimicsql_data |
CREATE TABLE table_name_94 (
date VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when is the opponent lyoto machida?
| SELECT date FROM table_name_94 WHERE opponent = "lyoto machida" | sql_create_context |
CREATE TABLE table_name_9 (
points INTEGER,
club VARCHAR,
goal_difference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have a Club of cf calvo sotelo, and a Goal Difference larger than -3?
| SELECT MAX(points) FROM table_name_9 WHERE club = "cf calvo sotelo" AND goal_difference > -3 | sql_create_context |
CREATE TABLE table_name_12 (
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1st leg that has hemofarm?
| SELECT 1 AS st_leg FROM table_name_12 WHERE team__number1 = "hemofarm" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | SELECT Score FROM Posts WHERE Id = 298680 | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2144" AND lab.label = "Heparin, LMW" | mimicsql_data |
CREATE TABLE table_name_12 (
country VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From what Country is T6 Place Player Tom Weiskopf?
| SELECT country FROM table_name_12 WHERE place = "t6" AND player = "tom weiskopf" | sql_create_context |
CREATE TABLE table_27158 (
"Tie no" real,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team who played plymouth argyle?
| SELECT "Home team" FROM table_27158 WHERE "Away team" = 'Plymouth Argyle' | wikisql |
CREATE TABLE table_21919 (
"Year" real,
"Date" text,
"Driver" text,
"Manufacturer" text,
"Laps" real,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What manufacturer won the rac... | SELECT "Manufacturer" FROM table_21919 WHERE "Date" = 'November 2' | wikisql |
CREATE TABLE table_26998135_2 (
manner_of_departure VARCHAR,
date_of_appointment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the manner of departure for the date of appointment 24 may 2010?
| SELECT manner_of_departure FROM table_26998135_2 WHERE date_of_appointment = "24 May 2010" | sql_create_context |
CREATE TABLE table_68809 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position had notes of 20km and a year earlier than 2002?
| SELECT "Position" FROM table_68809 WHERE "Notes" = '20km' AND "Year" < '2002' | wikisql |
CREATE TABLE table_37303 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At which games did Tunisia win a bronze in the men's 1500 m freestyle?
| SELECT "Games" FROM table_37303 WHERE "Medal" = 'bronze' AND "Event" = 'men''s 1500 m freestyle' | wikisql |
CREATE TABLE table_72211 (
"Taxonomy" text,
"Species in the world" real,
"Species in Peru" real,
"Species in the Peruvian Amazon" real,
"Peru Vs. world (Percent)" real,
"Peruvian Amazon Vs. Peru (Percent)" real
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT COUNT("Species in the Peruvian Amazon") FROM table_72211 WHERE "Species in the world" = '8411' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | 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 = '015-59552')) AND DATETIME(medication.drugstarttime, 'start of ... | eicu |
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0869043' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 21) AS T | css |
CREATE TABLE table_46242 (
"School" text,
"Location" text,
"Founded" real,
"Enrollment" real,
"Nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent year founded with an enrollment of 42,708?
| SELECT MAX("Founded") FROM table_46242 WHERE "Enrollment" = '42,708' | wikisql |
CREATE TABLE table_test_29 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"trauma" bool,
"renal_disease" bool,
"creatinine_clearance_cl" float,
"hemorrhagic_stroke" ... | SELECT * FROM table_test_29 WHERE systolic_blood_pressure_sbp <= 90 | criteria2sql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '8653860' AND JZKSDM = '289' AND RYDJSJ BETWEEN '2011-09-23' AND '2013-03-08' | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | SELECT COUNT(*) FROM zyjzjlb WHERE JZKSDM = '948' AND RYDJSJ BETWEEN '2016-10-07' AND '2020-12-24' | css |
CREATE TABLE table_name_2 (
slalom VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Slalom was Switzerland in?
| SELECT slalom FROM table_name_2 WHERE country = "switzerland" | 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 AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "10" | mimicsql_data |
CREATE TABLE Catalog_Structure (
catalog_level_number INTEGER,
catalog_id INTEGER,
catalog_level_name VARCHAR(50)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
cata... | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name DESC | nvbench |
CREATE TABLE table_69264 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date for hard surface and tournament of fort walton beach
| SELECT "Date" FROM table_69264 WHERE "Surface" = 'hard' AND "Tournament" = 'fort walton beach' | wikisql |
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 prereq (
course_id varchar(8),
prereq_id varchar(8)
)... | SELECT building, COUNT(building) FROM department GROUP BY building ORDER BY COUNT(building) DESC | nvbench |
CREATE TABLE table_20745444_1 (
tar_heels_points VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many results finished in a loss?
| SELECT COUNT(tar_heels_points) FROM table_20745444_1 WHERE result = "Loss" | sql_create_context |
CREATE TABLE table_name_36 (
date VARCHAR,
visitor VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game when Colorado was the visiting team and Chicago was the home team?
| SELECT date FROM table_name_36 WHERE visitor = "colorado" AND home = "chicago" | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "55" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE table_name_11 (
points INTEGER,
podiums VARCHAR,
wins VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of points in the 2012 season, which has less than 1 wins and less than 0 podiums?
| SELECT AVG(points) FROM table_name_11 WHERE wins < 1 AND season = "2012" AND podiums < 0 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '45256601' AND hz_info.YLJGDM = '7264377' AND NOT wdmzjzjlb.JZZDSM LIKE '%后遗症%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND... | css |
CREATE TABLE roller_coaster (
Status VARCHAR,
LENGTH VARCHAR,
Height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the statuses of roller coasters longer than 3300 or higher than 100.
| SELECT Status FROM roller_coaster WHERE LENGTH > 3300 OR Height > 100 | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "3343" | mimicsql_data |
CREATE TABLE table_62201 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the result 0 3?
| SELECT "Date" FROM table_62201 WHERE "Result" = '0–3' | wikisql |
CREATE TABLE table_13197 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score if Millwall is the Home Team?
| SELECT "Score" FROM table_13197 WHERE "Home team" = 'millwall' | wikisql |
CREATE TABLE table_80426 (
"Season" text,
"Team Name" text,
"Games" real,
"Losses" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest number of points with fewer than 8 losses and fewer than 24 games for the vancouver bu... | SELECT MIN("Points") FROM table_80426 WHERE "Losses" < '8' AND "Team Name" = 'vancouver burrards' AND "Games" < '24' | wikisql |
CREATE TABLE table_204_360 (
id number,
"year" number,
"host" text,
"gold" text,
"silver" text,
"bronze" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which years did chile place silver or bronze ?
| SELECT "year" FROM table_204_360 WHERE "silver" = 'chile' OR "bronze" = 'chile' | squall |
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.marital_status = "SINGLE" AND procedures.long_title = "Insertion of one vascular stent" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155') AND NOT patient.unitdischarge... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSB... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
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 t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'osteomyelitis - extremity') AS t1 JOIN (... | eicu |
CREATE TABLE table_74958 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Years" text,
"ICFC" real,
"FCWC" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest ranking associated with a total of 23?
| SELECT MIN("Ranking") FROM table_74958 WHERE "Total" = '23' | wikisql |
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 (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE procedures (
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.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.short_title = "Oth periton adhesiolysis" | mimicsql_data |
CREATE TABLE table_name_22 (
city VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the city for athous lavrensis
| SELECT city FROM table_name_22 WHERE name = "athous lavrensis" | sql_create_context |
CREATE TABLE table_name_88 (
competition VARCHAR,
venue VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the venue is away and the opponents are the bracknell bees, what is the competition?
| SELECT competition FROM table_name_88 WHERE venue = "away" AND opponent = "bracknell bees" | sql_create_context |
CREATE TABLE table_20896 (
"Player" text,
"Team" text,
"Matches" real,
"Wickets" real,
"Average" text,
"Best Bowling" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the best bowling score when the average was 23.33?
| SELECT "Best Bowling" FROM table_20896 WHERE "Average" = '23.33' | wikisql |
CREATE TABLE table_name_88 (
race VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who holds the time of 17:11.572?
| SELECT race FROM table_name_88 WHERE time = "17:11.572" | 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 * FROM t_kc21 WHERE t_kc21.PERSON_NM = '何德本' AND t_kc21.MED_SER_ORG_NO = '2931380' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%美容%' | css |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 10 AND date_day.month_number = 11 A... | atis |
CREATE TABLE table_47673 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 1st Leg, when 2nd Leg is 0-1?
| SELECT "1st leg" FROM table_47673 WHERE "2nd leg" = '0-1' | wikisql |
CREATE TABLE table_21977704_1 (
chassis VARCHAR,
constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the chassis for alta
| SELECT chassis FROM table_21977704_1 WHERE constructor = "Alta" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
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,
JY... | SELECT wdmzjzjlb.JZZDBM, wdmzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '花志专' UNION SELECT bdmzjzjlb.JZZDBM, bdmzjzjlb.JZZDSM FROM person_info JOIN... | css |
CREATE TABLE table_46491 (
"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 round when the college is north carolina and the overall is more than 124?
| SELECT SUM("Round") FROM table_46491 WHERE "College" = 'north carolina' AND "Overall" > '124' | wikisql |
CREATE TABLE table_name_4 (
original_name VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the original name for the one from bulgaria
| SELECT original_name FROM table_name_4 WHERE country = "bulgaria" | sql_create_context |
CREATE TABLE table_name_30 (
result VARCHAR,
distance VARCHAR,
winner_or_2nd VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for the distance of 10f, and a winner or 2nd of Lampra?
| SELECT result FROM table_name_30 WHERE distance = "10f" AND winner_or_2nd = "lampra" | sql_create_context |
CREATE TABLE actor (
actor_id SMALLINT UNSIGNED,
first_name VARCHAR(45),
last_name VARCHAR(45),
last_update TIMESTAMP
)
CREATE TABLE store (
store_id TINYINT UNSIGNED,
manager_staff_id TINYINT UNSIGNED,
address_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE payment (
pa... | SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id ORDER BY T2.name | nvbench |
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 WHERE t_kc21.PERSON_ID = '39665457' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7246.13) | css |
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 (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120551') AND NOT patient.unitdischargetime ... | eicu |
CREATE TABLE procedures (
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
)
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay = "6" | mimicsql_data |
CREATE TABLE table_name_43 (
horse VARCHAR,
jockey VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What horse for jara?
| SELECT horse FROM table_name_43 WHERE jockey = "jara" | sql_create_context |
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.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Dorsal and dorsolumbar fusion of the posterior column, posterior technique" | mimicsql_data |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_i... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cl skul base fx/brf coma') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267) | mimic_iii |
CREATE TABLE table_name_82 (
report VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the report for 6 may
| SELECT report FROM table_name_82 WHERE date = "6 may" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT Id, DisplayName, WebsiteUrl, Location, AccountId FROM Users | sede |
CREATE TABLE table_79233 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What IHSAA Football Class has 20 elkhart as... | SELECT "IHSAA Football Class" FROM table_79233 WHERE "County" = '20 elkhart' | wikisql |
CREATE TABLE table_13480122_5 (
high_points VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the the high points with score being w 117 93
| SELECT high_points FROM table_13480122_5 WHERE score = "W 117–93" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT DISTINCT OwnerUserId FROM Posts WHERE 'body' LIKE '%{mhchem}%' | sede |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id ... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 66015 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'insulin' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_69 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team at victoria park?
| SELECT away_team FROM table_name_69 WHERE venue = "victoria park" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Abscess of intestine" | mimicsql_data |
CREATE TABLE Timed_Locations_of_Things (
thing_id INTEGER,
Date_and_Time DATETIME,
Location_Code CHAR(15)
)
CREATE TABLE Customer_Events (
Customer_Event_ID INTEGER,
customer_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
resident_id INTEGER,
thing_id INTEGER
)
CREATE TAB... | SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) | nvbench |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc24.MED_AMOUT) 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 '2017-05-05' AND '2018-01-22' | css |
CREATE TABLE table_name_7 (
american VARCHAR,
initial_syllable_open_semi_open_unstressed_vowels VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is American, when Initial-Syllable Open/Semi-Open Unstressed Vowels is 'y /a , /'?
| SELECT american FROM table_name_7 WHERE initial_syllable_open_semi_open_unstressed_vowels = "y /aɪ, ɨ/" | sql_create_context |
CREATE TABLE table_10840 (
"Year" real,
"Title" text,
"Role" text,
"Leading Lady" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the leading lady in a yank in the r.a.f.?
| SELECT "Leading Lady" FROM table_10840 WHERE "Title" = 'a yank in the r.a.f.' | wikisql |
CREATE TABLE table_45770 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team with the ny rangers as the visitor team?
| SELECT "Home" FROM table_45770 WHERE "Visitor" = 'ny rangers' | wikisql |
CREATE TABLE table_73659 (
"Episode no." real,
"Airdate" text,
"Viewers" real,
"BBC Three weekly ranking" text,
"Cable rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the cable rank for episode no. 4?
| SELECT "Cable rank" FROM table_73659 WHERE "Episode no." = '4' | wikisql |
CREATE TABLE table_name_8 (
commissioned VARCHAR,
pennant_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the ship with a Pennant number of Q144 commissioned?
| SELECT commissioned FROM table_name_8 WHERE pennant_number = "q144" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer treatment - antacids')) AND STR... | 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 d_items (
row_id number,
itemid ... | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 48706) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Paraplegia" | mimicsql_data |
CREATE TABLE table_203_563 (
id number,
"#" number,
"judge" text,
"state" text,
"born/died" text,
"active" text,
"chief" text,
"senior" text,
"appointed by" text,
"reason for\ntermination" text
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT COUNT("judge") FROM table_203_563 WHERE "appointed by" = 'carter' | squall |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Year, AVG(Price) FROM wine GROUP BY Year | nvbench |
CREATE TABLE table_name_11 (
round INTEGER,
position VARCHAR,
college_junior_club_team__league_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has a Position of lw, and a College/Junior/Club Team (League) of swift current broncos (wchl)?
| SELECT AVG(round) FROM table_name_11 WHERE position = "lw" AND college_junior_club_team__league_ = "swift current broncos (wchl)" | sql_create_context |
CREATE TABLE table_204_376 (
id number,
"date" text,
"venue" text,
"opponents" text,
"score" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the last opponent on the list , chronologically ?
| SELECT "opponents" FROM table_204_376 ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId n... | SELECT q.Id AS "post_link", q.Tags, q.LastActivityDate, q.Score, q.ViewCount, q.AnswerCount, q.OwnerUserId AS "user_link" FROM Posts AS q JOIN PostTags AS pt ON pt.PostId = q.Id JOIN PostTags AS pt2 ON pt2.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId JOIN Tags AS t2 ON t2.Id = pt2.TagId JOIN TagSynonyms AS ts ON ts.... | sede |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
Revision... | SELECT COUNT(p.Id) AS count_of_feature, DATE(p.CreationDate) AS datetime, t.Name AS name FROM Posts AS p INNER JOIN PostTypes AS t ON p.PostTypeId = t.Id LEFT JOIN Posts AS pp ON p.ParentId = pp.Id WHERE (p.Tags LIKE '%##tagname##%') OR (pp.Tags LIKE '%##tagname##%') GROUP BY DATE(p.CreationDate), t.Name ORDER BY DATE(... | sede |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,... | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
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 COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '6107007' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '6107007' AND fzzmzjzjlb.JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND fzzmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_1976898_1 (
post_code INTEGER,
chinese_name__simplified___traditional_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the post code of the county with the Chinese name / ?
| SELECT MIN(post_code) FROM table_1976898_1 WHERE chinese_name__simplified___traditional_ = "潜山县 / 潛山縣" | 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_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '2507652' AND qtb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '2507652' AND gyb.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2011-10-09' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '2507652' AND zyb.IN_HOSP_DATE BETW... | css |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "10" AND prescriptions.drug = "Phenytoin Sodium" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.