instruction
stringlengths 0
1.06k
| input
stringlengths 33
7.14k
| response
stringlengths 2
4.44k
| source
stringclasses 25
values | text
stringlengths 302
8.5k
|
---|---|---|---|---|
What Dutch word has the same meaning as the Greek word (pl )?
|
CREATE TABLE table_40477 (
"English" text,
"German" text,
"Dutch" text,
"Icelandic" text,
"Latin" text,
"Greek" text,
"Russian" text
)
|
SELECT "Dutch" FROM table_40477 WHERE "Greek" = 'πλέω (pléō)'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Dutch word has the same meaning as the Greek word (pl )? ### Input: CREATE TABLE table_40477 (
"English" text,
"German" text,
"Dutch" text,
"Icelandic" text,
"Latin" text,
"Greek" text,
"Russian" text
) ### Response: SELECT "Dutch" FROM table_40477 WHERE "Greek" = 'πλέω (pléō)'
|
Which Country has a Top Team of jam, and an Edition of 31st?
|
CREATE TABLE table_name_93 (
country VARCHAR,
top_team VARCHAR,
edition VARCHAR
)
|
SELECT country FROM table_name_93 WHERE top_team = "jam" AND edition = "31st"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Country has a Top Team of jam, and an Edition of 31st? ### Input: CREATE TABLE table_name_93 (
country VARCHAR,
top_team VARCHAR,
edition VARCHAR
) ### Response: SELECT country FROM table_name_93 WHERE top_team = "jam" AND edition = "31st"
|
has patient 010-6010 been admitted to hospital until 3 years ago?
|
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 text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
|
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '010-6010' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: has patient 010-6010 been admitted to hospital until 3 years ago? ### Input: 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 text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
) ### Response: SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '010-6010' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
|
What was the home team's score when North Melbourne was the away team?
|
CREATE TABLE table_name_39 (
home_team VARCHAR,
away_team VARCHAR
)
|
SELECT home_team AS score FROM table_name_39 WHERE away_team = "north melbourne"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the home team's score when North Melbourne was the away team? ### Input: CREATE TABLE table_name_39 (
home_team VARCHAR,
away_team VARCHAR
) ### Response: SELECT home_team AS score FROM table_name_39 WHERE away_team = "north melbourne"
|
when did the usl a-league have conference finals?
|
CREATE TABLE table_74856 (
"Year" text,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
)
|
SELECT "Year" FROM table_74856 WHERE "League" = 'usl a-league' AND "Playoffs" = 'conference finals'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: when did the usl a-league have conference finals? ### Input: CREATE TABLE table_74856 (
"Year" text,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
) ### Response: SELECT "Year" FROM table_74856 WHERE "League" = 'usl a-league' AND "Playoffs" = 'conference finals'
|
When ihaia tainui is the incumbent what is the date?
|
CREATE TABLE table_28898948_3 (
date VARCHAR,
incumbent VARCHAR
)
|
SELECT date FROM table_28898948_3 WHERE incumbent = "Ihaia Tainui"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When ihaia tainui is the incumbent what is the date? ### Input: CREATE TABLE table_28898948_3 (
date VARCHAR,
incumbent VARCHAR
) ### Response: SELECT date FROM table_28898948_3 WHERE incumbent = "Ihaia Tainui"
|
let me know the number of patients with procedure icd9 code 40 who were admitted in hospital before 2103.
|
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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 diagnoses (
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.admityear < "2103" AND procedures.icd9_code = "40"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: let me know the number of patients with procedure icd9 code 40 who were admitted in hospital before 2103. ### Input: 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 text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2103" AND procedures.icd9_code = "40"
|
What is the sum of Year 2007(s), when the Year 2005 is greater than 29,377?
|
CREATE TABLE table_75898 (
"Team" text,
"Year 2007" real,
"Year 2006" real,
"Year 2005" real,
"Change 06/07" text
)
|
SELECT SUM("Year 2007") FROM table_75898 WHERE "Year 2005" > '29,377'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Year 2007(s), when the Year 2005 is greater than 29,377? ### Input: CREATE TABLE table_75898 (
"Team" text,
"Year 2007" real,
"Year 2006" real,
"Year 2005" real,
"Change 06/07" text
) ### Response: SELECT SUM("Year 2007") FROM table_75898 WHERE "Year 2005" > '29,377'
|
What is the High rebounds with a Game that is 62?
|
CREATE TABLE table_name_71 (
high_rebounds VARCHAR,
game VARCHAR
)
|
SELECT high_rebounds FROM table_name_71 WHERE game = 62
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the High rebounds with a Game that is 62? ### Input: CREATE TABLE table_name_71 (
high_rebounds VARCHAR,
game VARCHAR
) ### Response: SELECT high_rebounds FROM table_name_71 WHERE game = 62
|
What is the number of routes that end at John F Kennedy International Airport?
|
CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
|
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
|
spider
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of routes that end at John F Kennedy International Airport? ### Input: CREATE TABLE airports (
apid number,
name text,
city text,
country text,
x number,
y number,
elevation number,
iata text,
icao text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
) ### Response: SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
|
What is the sum of Population (1 July 2005 est.), when Area (km ) is less than 5,131, when Population density (per km ) is less than 180, when Subdivisions is Parishes, and when Capital is Roseau?
|
CREATE TABLE table_41612 (
"Name" text,
"Subdivisions" text,
"Area (km\u00b2)" real,
"Population (1 July 2005 est.)" real,
"Population density (per km\u00b2)" real,
"Capital" text
)
|
SELECT SUM("Population (1 July 2005 est.)") FROM table_41612 WHERE "Area (km\u00b2)" < '5,131' AND "Population density (per km\u00b2)" < '180' AND "Subdivisions" = 'parishes' AND "Capital" = 'roseau'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the sum of Population (1 July 2005 est.), when Area (km ) is less than 5,131, when Population density (per km ) is less than 180, when Subdivisions is Parishes, and when Capital is Roseau? ### Input: CREATE TABLE table_41612 (
"Name" text,
"Subdivisions" text,
"Area (km\u00b2)" real,
"Population (1 July 2005 est.)" real,
"Population density (per km\u00b2)" real,
"Capital" text
) ### Response: SELECT SUM("Population (1 July 2005 est.)") FROM table_41612 WHERE "Area (km\u00b2)" < '5,131' AND "Population density (per km\u00b2)" < '180' AND "Subdivisions" = 'parishes' AND "Capital" = 'roseau'
|
When the total was 11 and silver was greater than 4 what was the highest gold?
|
CREATE TABLE table_70068 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
|
SELECT MAX("Gold") FROM table_70068 WHERE "Total" = '11' AND "Silver" > '4'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When the total was 11 and silver was greater than 4 what was the highest gold? ### Input: CREATE TABLE table_70068 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) ### Response: SELECT MAX("Gold") FROM table_70068 WHERE "Total" = '11' AND "Silver" > '4'
|
Draw a bar chart about the distribution of Time and ID .
|
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
|
SELECT Time, ID FROM swimmer
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Draw a bar chart about the distribution of Time and ID . ### Input: CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
) ### Response: SELECT Time, ID FROM swimmer
|
Which Game has a Score of 3 6?
|
CREATE TABLE table_name_19 (
game INTEGER,
score VARCHAR
)
|
SELECT SUM(game) FROM table_name_19 WHERE score = "3–6"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Game has a Score of 3 6? ### Input: CREATE TABLE table_name_19 (
game INTEGER,
score VARCHAR
) ### Response: SELECT SUM(game) FROM table_name_19 WHERE score = "3–6"
|
What year was the 4-6-0 Wheel model train from 1908 withdrawn?
|
CREATE TABLE table_10251 (
"Class" text,
"Wheel arrangement" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Year(s) withdrawn" text
)
|
SELECT "Year(s) withdrawn" FROM table_10251 WHERE "Wheel arrangement" = '4-6-0' AND "Year made" = '1908'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the 4-6-0 Wheel model train from 1908 withdrawn? ### Input: CREATE TABLE table_10251 (
"Class" text,
"Wheel arrangement" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Year(s) withdrawn" text
) ### Response: SELECT "Year(s) withdrawn" FROM table_10251 WHERE "Wheel arrangement" = '4-6-0' AND "Year made" = '1908'
|
what is the drug patient 009-5351 has been allergic to until 11/2105?
|
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
|
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5351')) AND STRFTIME('%y-%m', allergy.allergytime) <= '2105-11'
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the drug patient 009-5351 has been allergic to until 11/2105? ### Input: CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) ### Response: SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5351')) AND STRFTIME('%y-%m', allergy.allergytime) <= '2105-11'
|
What did the Surname Lindberg rank?
|
CREATE TABLE table_8564 (
"Rank" real,
"Surname" text,
"Number of bearers 2008" real,
"Type" text,
"Etymology" text
)
|
SELECT COUNT("Rank") FROM table_8564 WHERE "Surname" = 'lindberg'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What did the Surname Lindberg rank? ### Input: CREATE TABLE table_8564 (
"Rank" real,
"Surname" text,
"Number of bearers 2008" real,
"Type" text,
"Etymology" text
) ### Response: SELECT COUNT("Rank") FROM table_8564 WHERE "Surname" = 'lindberg'
|
does patient 95986 had any pacu urine output since 1511 days ago?
|
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE 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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
|
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pacu urine' AND d_items.linksto = 'outputevents') AND DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-1511 day')
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: does patient 95986 had any pacu urine output since 1511 days ago? ### Input: CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE 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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
) ### Response: SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pacu urine' AND d_items.linksto = 'outputevents') AND DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-1511 day')
|
What is the lowest Apps with more than 1 level?
|
CREATE TABLE table_name_22 (
apps INTEGER,
level INTEGER
)
|
SELECT MIN(apps) FROM table_name_22 WHERE level > 1
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest Apps with more than 1 level? ### Input: CREATE TABLE table_name_22 (
apps INTEGER,
level INTEGER
) ### Response: SELECT MIN(apps) FROM table_name_22 WHERE level > 1
|
history of leukocyte dysfunction and deficiencies
|
CREATE TABLE table_train_260 (
"id" int,
"leukocyte_deficiencies" bool,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"leukocyte_dysfunction" bool,
"renal_disease" bool,
"hba1c" float,
"serum_creatinine" float,
"NOUSE" float
)
|
SELECT * FROM table_train_260 WHERE leukocyte_dysfunction = 1 AND leukocyte_deficiencies = 1
|
criteria2sql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: history of leukocyte dysfunction and deficiencies ### Input: CREATE TABLE table_train_260 (
"id" int,
"leukocyte_deficiencies" bool,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"leukocyte_dysfunction" bool,
"renal_disease" bool,
"hba1c" float,
"serum_creatinine" float,
"NOUSE" float
) ### Response: SELECT * FROM table_train_260 WHERE leukocyte_dysfunction = 1 AND leukocyte_deficiencies = 1
|
What was the losing bonus for the 20 played, and 353 points?
|
CREATE TABLE table_9116 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
|
SELECT "Losing bonus" FROM table_9116 WHERE "Played" = '20' AND "Points for" = '353'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the losing bonus for the 20 played, and 353 points? ### Input: CREATE TABLE table_9116 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) ### Response: SELECT "Losing bonus" FROM table_9116 WHERE "Played" = '20' AND "Points for" = '353'
|
where did rochdale play as opponent?
|
CREATE TABLE table_name_77 (
venue VARCHAR,
opponent VARCHAR
)
|
SELECT venue FROM table_name_77 WHERE opponent = "rochdale"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: where did rochdale play as opponent? ### Input: CREATE TABLE table_name_77 (
venue VARCHAR,
opponent VARCHAR
) ### Response: SELECT venue FROM table_name_77 WHERE opponent = "rochdale"
|
what was the last prescribed dose of erythromycin 0.5% ophth oint that patient 73693 got the last month?
|
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
|
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693) AND prescriptions.drug = 'erythromycin 0.5% ophth oint' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last prescribed dose of erythromycin 0.5% ophth oint that patient 73693 got the last month? ### Input: CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
) ### Response: SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693) AND prescriptions.drug = 'erythromycin 0.5% ophth oint' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1
|
For teams with 22 matches played, a losing bonus of 3, and 45 tries against, what was the number of points against?
|
CREATE TABLE table_name_10 (
points_against VARCHAR,
tries_against VARCHAR,
played VARCHAR,
losing_bonus VARCHAR
)
|
SELECT points_against FROM table_name_10 WHERE played = "22" AND losing_bonus = "3" AND tries_against = "45"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: For teams with 22 matches played, a losing bonus of 3, and 45 tries against, what was the number of points against? ### Input: CREATE TABLE table_name_10 (
points_against VARCHAR,
tries_against VARCHAR,
played VARCHAR,
losing_bonus VARCHAR
) ### Response: SELECT points_against FROM table_name_10 WHERE played = "22" AND losing_bonus = "3" AND tries_against = "45"
|
What is the number of league goals when Bill Dearden was the scorer and there was 0 league cup goals?
|
CREATE TABLE table_name_66 (
league_goals VARCHAR,
league_cup_goals VARCHAR,
scorer VARCHAR
)
|
SELECT league_goals FROM table_name_66 WHERE league_cup_goals = "0" AND scorer = "bill dearden"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the number of league goals when Bill Dearden was the scorer and there was 0 league cup goals? ### Input: CREATE TABLE table_name_66 (
league_goals VARCHAR,
league_cup_goals VARCHAR,
scorer VARCHAR
) ### Response: SELECT league_goals FROM table_name_66 WHERE league_cup_goals = "0" AND scorer = "bill dearden"
|
What's the total L/100km extra urban fueled by diesel, when the mpg-UK combines is more than 19.2, mpg-US is less than 50 and the L/100m combined is less than 5.7?
|
CREATE TABLE table_66550 (
"Manufacturer" text,
"Transmission" text,
"Engine Capacity" real,
"Fuel Type" text,
"L/100km Urban (Cold)" real,
"L/100km Extra-Urban" real,
"L/100km Combined" real,
"mpg-UK Urban (Cold)" real,
"mpg-UK Extra-Urban" real,
"mpg-UK Combined" real,
"mpg-US Urban" real,
"mpg-US Extra-Urban" real,
"mpg-US Combined" real,
"CO 2 g/km" real,
"Green Rating" text
)
|
SELECT COUNT("L/100km Extra-Urban") FROM table_66550 WHERE "mpg-UK Combined" > '19.2' AND "L/100km Combined" < '5.7' AND "Fuel Type" = 'diesel' AND "mpg-US Combined" < '50'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the total L/100km extra urban fueled by diesel, when the mpg-UK combines is more than 19.2, mpg-US is less than 50 and the L/100m combined is less than 5.7? ### Input: CREATE TABLE table_66550 (
"Manufacturer" text,
"Transmission" text,
"Engine Capacity" real,
"Fuel Type" text,
"L/100km Urban (Cold)" real,
"L/100km Extra-Urban" real,
"L/100km Combined" real,
"mpg-UK Urban (Cold)" real,
"mpg-UK Extra-Urban" real,
"mpg-UK Combined" real,
"mpg-US Urban" real,
"mpg-US Extra-Urban" real,
"mpg-US Combined" real,
"CO 2 g/km" real,
"Green Rating" text
) ### Response: SELECT COUNT("L/100km Extra-Urban") FROM table_66550 WHERE "mpg-UK Combined" > '19.2' AND "L/100km Combined" < '5.7' AND "Fuel Type" = 'diesel' AND "mpg-US Combined" < '50'
|
What place is the player with score of 70-68-70=208 from?
|
CREATE TABLE table_name_38 (
place VARCHAR,
score VARCHAR
)
|
SELECT place FROM table_name_38 WHERE score = 70 - 68 - 70 = 208
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What place is the player with score of 70-68-70=208 from? ### Input: CREATE TABLE table_name_38 (
place VARCHAR,
score VARCHAR
) ### Response: SELECT place FROM table_name_38 WHERE score = 70 - 68 - 70 = 208
|
How many byes for the team with more than 14 losses and more than 0 wins?
|
CREATE TABLE table_12670 (
"Mininera DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
|
SELECT AVG("Byes") FROM table_12670 WHERE "Losses" > '14' AND "Wins" > '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many byes for the team with more than 14 losses and more than 0 wins? ### Input: CREATE TABLE table_12670 (
"Mininera DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) ### Response: SELECT AVG("Byes") FROM table_12670 WHERE "Losses" > '14' AND "Wins" > '0'
|
What is every value for rushing yards per game if the season is 1984?
|
CREATE TABLE table_27487336_1 (
rushing_yards_per_game VARCHAR,
season VARCHAR
)
|
SELECT rushing_yards_per_game FROM table_27487336_1 WHERE season = "1984"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is every value for rushing yards per game if the season is 1984? ### Input: CREATE TABLE table_27487336_1 (
rushing_yards_per_game VARCHAR,
season VARCHAR
) ### Response: SELECT rushing_yards_per_game FROM table_27487336_1 WHERE season = "1984"
|
Name the least attendance for l 36 1
|
CREATE TABLE table_24126518_2 (
attendance INTEGER,
final_score VARCHAR
)
|
SELECT MIN(attendance) FROM table_24126518_2 WHERE final_score = "L 36–1"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the least attendance for l 36 1 ### Input: CREATE TABLE table_24126518_2 (
attendance INTEGER,
final_score VARCHAR
) ### Response: SELECT MIN(attendance) FROM table_24126518_2 WHERE final_score = "L 36–1"
|
what were the five specimen tests that were most frequently given to patients that were previously diagnosed with obtundation in the same month in the last year?
|
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
|
SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'obtundation' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.culturetakentime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.culturetakentime, 'start of month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 5
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the five specimen tests that were most frequently given to patients that were previously diagnosed with obtundation in the same month in the last year? ### Input: CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
) ### Response: SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'obtundation' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.culturetakentime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.culturetakentime, 'start of month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 5
|
in 2105 how many patients with s/p surgery for cancer - rectal were diagnosed within the same hospital visit after previously being diagnosed with myocardial infarction ruled out?
|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
|
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p surgery for cancer - rectal' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'myocardial infarction ruled out' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t2 WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: in 2105 how many patients with s/p surgery for cancer - rectal were diagnosed within the same hospital visit after previously being diagnosed with myocardial infarction ruled out? ### Input: CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
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,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
) ### Response: SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p surgery for cancer - rectal' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'myocardial infarction ruled out' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t2 WHERE t1.diagnosistime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid
|
What is the Club, when the value for Played is 22, and when the value for Tries is 41?
|
CREATE TABLE table_name_44 (
club VARCHAR,
played VARCHAR,
tries_for VARCHAR
)
|
SELECT club FROM table_name_44 WHERE played = "22" AND tries_for = "41"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Club, when the value for Played is 22, and when the value for Tries is 41? ### Input: CREATE TABLE table_name_44 (
club VARCHAR,
played VARCHAR,
tries_for VARCHAR
) ### Response: SELECT club FROM table_name_44 WHERE played = "22" AND tries_for = "41"
|
What Sweet Sixteen team is in the Colonial conference?
|
CREATE TABLE table_name_95 (
sweet_sixteen VARCHAR,
conference VARCHAR
)
|
SELECT sweet_sixteen FROM table_name_95 WHERE conference = "colonial"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What Sweet Sixteen team is in the Colonial conference? ### Input: CREATE TABLE table_name_95 (
sweet_sixteen VARCHAR,
conference VARCHAR
) ### Response: SELECT sweet_sixteen FROM table_name_95 WHERE conference = "colonial"
|
What FA cup apps has a total larger than 12 and league apps larger than 38, and FA Cup goals larger than 1?
|
CREATE TABLE table_name_50 (
fa_cup_apps VARCHAR,
fa_cup_goals VARCHAR,
total_apps VARCHAR,
league_apps VARCHAR
)
|
SELECT COUNT(fa_cup_apps) FROM table_name_50 WHERE total_apps > 12 AND league_apps > 38 AND fa_cup_goals > 1
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What FA cup apps has a total larger than 12 and league apps larger than 38, and FA Cup goals larger than 1? ### Input: CREATE TABLE table_name_50 (
fa_cup_apps VARCHAR,
fa_cup_goals VARCHAR,
total_apps VARCHAR,
league_apps VARCHAR
) ### Response: SELECT COUNT(fa_cup_apps) FROM table_name_50 WHERE total_apps > 12 AND league_apps > 38 AND fa_cup_goals > 1
|
what is the number of patients whose death status is 0 and primary disease is hypertension;rule out coronary artery disease\cardiac cath?
|
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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 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
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose death status is 0 and primary disease is hypertension;rule out coronary artery disease\cardiac cath? ### Input: 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,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
|
Alana Boyd of group B with a 4.30 result has what nationality?
|
CREATE TABLE table_64709 (
"Group" text,
"Name" text,
"Nationality" text,
"4.00" text,
"Result" text
)
|
SELECT "Nationality" FROM table_64709 WHERE "Group" = 'b' AND "Result" = '4.30' AND "Name" = 'alana boyd'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Alana Boyd of group B with a 4.30 result has what nationality? ### Input: CREATE TABLE table_64709 (
"Group" text,
"Name" text,
"Nationality" text,
"4.00" text,
"Result" text
) ### Response: SELECT "Nationality" FROM table_64709 WHERE "Group" = 'b' AND "Result" = '4.30' AND "Name" = 'alana boyd'
|
What was the first broadcast date of episode 4x03?
|
CREATE TABLE table_23292220_4 (
first_broadcast VARCHAR,
episode VARCHAR
)
|
SELECT first_broadcast FROM table_23292220_4 WHERE episode = "4x03"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the first broadcast date of episode 4x03? ### Input: CREATE TABLE table_23292220_4 (
first_broadcast VARCHAR,
episode VARCHAR
) ### Response: SELECT first_broadcast FROM table_23292220_4 WHERE episode = "4x03"
|
% downvoted questions per tag.
|
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostsWithDeleted (
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
|
SELECT t.TagName, t.Count AS "# of questions", ROUND(100.0 * (t.Count - COUNT(*)) / t.Count, 2) AS "% downvoted" FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId LEFT OUTER JOIN Votes AS v ON v.PostId = pt.PostId AND v.VoteTypeId = 3 WHERE v.PostId IS NULL GROUP BY t.TagName, t.Count ORDER BY ROUND(100.0 * (t.Count - COUNT(*)) / t.Count, 2) DESC
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: % downvoted questions per tag. ### Input: CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostsWithDeleted (
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
) ### Response: SELECT t.TagName, t.Count AS "# of questions", ROUND(100.0 * (t.Count - COUNT(*)) / t.Count, 2) AS "% downvoted" FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId LEFT OUTER JOIN Votes AS v ON v.PostId = pt.PostId AND v.VoteTypeId = 3 WHERE v.PostId IS NULL GROUP BY t.TagName, t.Count ORDER BY ROUND(100.0 * (t.Count - COUNT(*)) / t.Count, 2) DESC
|
What year was the Competition of World Junior Championships with a 20th (qf) position?
|
CREATE TABLE table_51831 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
)
|
SELECT AVG("Year") FROM table_51831 WHERE "Competition" = 'world junior championships' AND "Position" = '20th (qf)'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What year was the Competition of World Junior Championships with a 20th (qf) position? ### Input: CREATE TABLE table_51831 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) ### Response: SELECT AVG("Year") FROM table_51831 WHERE "Competition" = 'world junior championships' AND "Position" = '20th (qf)'
|
Who was the team captain for Crystal Palace?
|
CREATE TABLE table_70937 (
"Team" text,
"Manager 1" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
)
|
SELECT "Captain" FROM table_70937 WHERE "Team" = 'crystal palace'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Who was the team captain for Crystal Palace? ### Input: CREATE TABLE table_70937 (
"Team" text,
"Manager 1" text,
"Captain" text,
"Kit manufacturer" text,
"Shirt sponsor" text
) ### Response: SELECT "Captain" FROM table_70937 WHERE "Team" = 'crystal palace'
|
Questions with dependency-injection and dagger-2 tag.
|
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
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
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
|
SELECT Id, AcceptedAnswerId, CreationDate FROM Posts WHERE Tags LIKE '%dependency-injection%' AND Tags LIKE '%dagger-2%'
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Questions with dependency-injection and dagger-2 tag. ### Input: CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostsWithDeleted (
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
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
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
) ### Response: SELECT Id, AcceptedAnswerId, CreationDate FROM Posts WHERE Tags LIKE '%dependency-injection%' AND Tags LIKE '%dagger-2%'
|
find the number of patients with primary disease as s/p fall and their year of death is in or before 2112.
|
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2112.0"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: find the number of patients with primary disease as s/p fall and their year of death is in or before 2112. ### Input: 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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2112.0"
|
Return a bar chart on what are the id and name of the mountains that have at least 2 photos?, list from high to low by the bar.
|
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
|
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Return a bar chart on what are the id and name of the mountains that have at least 2 photos?, list from high to low by the bar. ### Input: CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id int,
color text,
name text
)
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
) ### Response: SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name DESC
|
what was the daily minimum amount of urine given to patient 002-38644 until 01/05/2104?
|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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
)
|
SELECT MIN(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 = '002-38644')) AND intakeoutput.celllabel = 'urine' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2104-01-05' GROUP BY STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime)
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the daily minimum amount of urine given to patient 002-38644 until 01/05/2104? ### Input: CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
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 treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
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
) ### Response: SELECT MIN(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 = '002-38644')) AND intakeoutput.celllabel = 'urine' AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2104-01-05' GROUP BY STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime)
|
What is the average weeks of a song with a larger than 3 position after 1977?
|
CREATE TABLE table_name_40 (
weeks_on_chart INTEGER,
position VARCHAR,
year VARCHAR
)
|
SELECT AVG(weeks_on_chart) FROM table_name_40 WHERE position > 3 AND year > 1977
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the average weeks of a song with a larger than 3 position after 1977? ### Input: CREATE TABLE table_name_40 (
weeks_on_chart INTEGER,
position VARCHAR,
year VARCHAR
) ### Response: SELECT AVG(weeks_on_chart) FROM table_name_40 WHERE position > 3 AND year > 1977
|
who had the best time ostrava or berlin ?
|
CREATE TABLE table_204_576 (
id number,
"year" number,
"best" text,
"location" text,
"date" text,
"world rank" text
)
|
SELECT "location" FROM table_204_576 WHERE "location" IN ('ostrava', 'berlin') ORDER BY "best" LIMIT 1
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: who had the best time ostrava or berlin ? ### Input: CREATE TABLE table_204_576 (
id number,
"year" number,
"best" text,
"location" text,
"date" text,
"world rank" text
) ### Response: SELECT "location" FROM table_204_576 WHERE "location" IN ('ostrava', 'berlin') ORDER BY "best" LIMIT 1
|
Highest answer rate of popular tags.
|
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
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
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
|
SELECT Tags.TagName, COUNT(*) AS NumQuestions, SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS NumAnswered, (SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) * 100 / COUNT(*)) AS PercentageAnswered FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId AND PostTypeId = 1 GROUP BY Tags.TagName HAVING COUNT(*) > 100000 ORDER BY PercentageAnswered DESC, NumQuestions DESC
|
sede
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Highest answer rate of popular tags. ### Input: CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDate time,
ApprovalModeratorId number,
DeactivationDate time,
DeactivationModeratorId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
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
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
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,
LastEditDate time,
LastActivityDate time,
Title text,
Tags text,
AnswerCount number,
CommentCount number,
FavoriteCount number,
ClosedDate time,
CommunityOwnedDate time,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
) ### Response: SELECT Tags.TagName, COUNT(*) AS NumQuestions, SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS NumAnswered, (SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) * 100 / COUNT(*)) AS PercentageAnswered FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId AND PostTypeId = 1 GROUP BY Tags.TagName HAVING COUNT(*) > 100000 ORDER BY PercentageAnswered DESC, NumQuestions DESC
|
Name the transfer window of realmadrid
|
CREATE TABLE table_name_12 (
transfer_window VARCHAR,
moving_to VARCHAR
)
|
SELECT transfer_window FROM table_name_12 WHERE moving_to = "realmadrid"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the transfer window of realmadrid ### Input: CREATE TABLE table_name_12 (
transfer_window VARCHAR,
moving_to VARCHAR
) ### Response: SELECT transfer_window FROM table_name_12 WHERE moving_to = "realmadrid"
|
Which pick number resulted in a defensive end?
|
CREATE TABLE table_name_34 (
pick VARCHAR,
position VARCHAR
)
|
SELECT pick FROM table_name_34 WHERE position = "defensive end"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which pick number resulted in a defensive end? ### Input: CREATE TABLE table_name_34 (
pick VARCHAR,
position VARCHAR
) ### Response: SELECT pick FROM table_name_34 WHERE position = "defensive end"
|
which country took the least amount of time ?
|
CREATE TABLE table_204_204 (
id number,
"rank" number,
"heat" number,
"country" text,
"cyclists" text,
"result" number,
"notes" text
)
|
SELECT "country" FROM table_204_204 ORDER BY "result" LIMIT 1
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: which country took the least amount of time ? ### Input: CREATE TABLE table_204_204 (
id number,
"rank" number,
"heat" number,
"country" text,
"cyclists" text,
"result" number,
"notes" text
) ### Response: SELECT "country" FROM table_204_204 ORDER BY "result" LIMIT 1
|
What was the mintage when the theme was Santa Claus?
|
CREATE TABLE table_name_15 (
mintage VARCHAR,
theme VARCHAR
)
|
SELECT mintage FROM table_name_15 WHERE theme = "santa claus"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What was the mintage when the theme was Santa Claus? ### Input: CREATE TABLE table_name_15 (
mintage VARCHAR,
theme VARCHAR
) ### Response: SELECT mintage FROM table_name_15 WHERE theme = "santa claus"
|
What is Team 2, when 2nd Leg is 1-0?
|
CREATE TABLE table_47674 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
)
|
SELECT "Team 2" FROM table_47674 WHERE "2nd leg" = '1-0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Team 2, when 2nd Leg is 1-0? ### Input: CREATE TABLE table_47674 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) ### Response: SELECT "Team 2" FROM table_47674 WHERE "2nd leg" = '1-0'
|
What player has a score less than 66, and a Place of t2, in the United States?
|
CREATE TABLE table_13483 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
|
SELECT "Player" FROM table_13483 WHERE "Score" < '66' AND "Place" = 't2' AND "Country" = 'united states'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What player has a score less than 66, and a Place of t2, in the United States? ### Input: CREATE TABLE table_13483 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) ### Response: SELECT "Player" FROM table_13483 WHERE "Score" < '66' AND "Place" = 't2' AND "Country" = 'united states'
|
Which winner has a Challenge Loser of gisel?
|
CREATE TABLE table_9344 (
"Episode" text,
"7 Deadly Sin" text,
"Challenge Winner" text,
"Challenge Loser" text,
"Voted In To 'El Duelo'" text,
"Eliminated" text
)
|
SELECT "Challenge Winner" FROM table_9344 WHERE "Challenge Loser" = 'gisel'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which winner has a Challenge Loser of gisel? ### Input: CREATE TABLE table_9344 (
"Episode" text,
"7 Deadly Sin" text,
"Challenge Winner" text,
"Challenge Loser" text,
"Voted In To 'El Duelo'" text,
"Eliminated" text
) ### Response: SELECT "Challenge Winner" FROM table_9344 WHERE "Challenge Loser" = 'gisel'
|
show me all flights from PITTSBURGH to BOSTON both direct and connecting that depart PITTSBURGH after 1900
|
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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 code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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_miles int,
pressurized varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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 date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
|
atis
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: show me all flights from PITTSBURGH to BOSTON both direct and connecting that depart PITTSBURGH after 1900 ### Input: CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
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 code_description (
code varchar,
description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
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_miles int,
pressurized varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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 date_day (
month_number int,
day_number int,
year int,
day_name varchar
) ### Response: 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code
|
how many times was the qualifying score 60.750?
|
CREATE TABLE table_13114949_3 (
event VARCHAR,
qualifying_score VARCHAR
)
|
SELECT COUNT(event) FROM table_13114949_3 WHERE qualifying_score = "60.750"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many times was the qualifying score 60.750? ### Input: CREATE TABLE table_13114949_3 (
event VARCHAR,
qualifying_score VARCHAR
) ### Response: SELECT COUNT(event) FROM table_13114949_3 WHERE qualifying_score = "60.750"
|
How many points did the driver who won $127,541 driving car #31 get?
|
CREATE TABLE table_name_88 (
points INTEGER,
winnings VARCHAR,
car__number VARCHAR
)
|
SELECT MAX(points) FROM table_name_88 WHERE winnings = "$127,541" AND car__number > 31
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many points did the driver who won $127,541 driving car #31 get? ### Input: CREATE TABLE table_name_88 (
points INTEGER,
winnings VARCHAR,
car__number VARCHAR
) ### Response: SELECT MAX(points) FROM table_name_88 WHERE winnings = "$127,541" AND car__number > 31
|
What is the Turkish word for the Bangla word shombar ?
|
CREATE TABLE table_36500 (
"Arabic" text,
"English" text,
"Maltese" text,
"Turkish" text,
"Somali" text,
"Persian" text,
"Urdu" text,
"Hindi" text,
"Punjabi (India)" text,
"Punjabi (Pakistan)" text,
"Malayalam" text,
"Bangla" text,
"Hebrew" text,
"Indonesian" text,
"Malay" text,
"Filipino" text,
"Pashto" text,
"Tamil" text,
"Telugu" text,
"Kashmiri" text,
"Hausa" text,
"Yor\u00f9b\u00e1" text,
"Kurdish" text
)
|
SELECT "Turkish" FROM table_36500 WHERE "Bangla" = 'shombar সোমবার'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the Turkish word for the Bangla word shombar ? ### Input: CREATE TABLE table_36500 (
"Arabic" text,
"English" text,
"Maltese" text,
"Turkish" text,
"Somali" text,
"Persian" text,
"Urdu" text,
"Hindi" text,
"Punjabi (India)" text,
"Punjabi (Pakistan)" text,
"Malayalam" text,
"Bangla" text,
"Hebrew" text,
"Indonesian" text,
"Malay" text,
"Filipino" text,
"Pashto" text,
"Tamil" text,
"Telugu" text,
"Kashmiri" text,
"Hausa" text,
"Yor\u00f9b\u00e1" text,
"Kurdish" text
) ### Response: SELECT "Turkish" FROM table_36500 WHERE "Bangla" = 'shombar সোমবার'
|
What is the lowest draft pick number for mark doak who had an overall pick smaller than 147?
|
CREATE TABLE table_name_30 (
pick INTEGER,
name VARCHAR,
overall VARCHAR
)
|
SELECT MIN(pick) FROM table_name_30 WHERE name = "mark doak" AND overall < 147
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the lowest draft pick number for mark doak who had an overall pick smaller than 147? ### Input: CREATE TABLE table_name_30 (
pick INTEGER,
name VARCHAR,
overall VARCHAR
) ### Response: SELECT MIN(pick) FROM table_name_30 WHERE name = "mark doak" AND overall < 147
|
what was the last time that patient 32153 received a lab test since 06/2105?
|
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
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 (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
intime time,
outtime 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
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
|
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-06' ORDER BY labevents.charttime DESC LIMIT 1
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the last time that patient 32153 received a lab test since 06/2105? ### Input: CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
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 (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
intime time,
outtime 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
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-06' ORDER BY labevents.charttime DESC LIMIT 1
|
What are the approximate translations when the morphological category is masc. sing. active participle?
|
CREATE TABLE table_30035 (
"Semitological abbreviation" text,
"Hebrew name" text,
"Arabic name" text,
"Morphological category" text,
"Hebrew Form" text,
"Arabic form" text,
"Approximate translation" text
)
|
SELECT "Approximate translation" FROM table_30035 WHERE "Morphological category" = 'masc. sing. active participle'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What are the approximate translations when the morphological category is masc. sing. active participle? ### Input: CREATE TABLE table_30035 (
"Semitological abbreviation" text,
"Hebrew name" text,
"Arabic name" text,
"Morphological category" text,
"Hebrew Form" text,
"Arabic form" text,
"Approximate translation" text
) ### Response: SELECT "Approximate translation" FROM table_30035 WHERE "Morphological category" = 'masc. sing. active participle'
|
what were the three most frequently given procedures for patients who had already had thoracentesis within the same month in 2102?
|
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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,
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
)
|
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracentesis') AND STRFTIME('%y', procedures_icd.charttime) = '2102') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.icd9_code, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', procedures_icd.charttime) = '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what were the three most frequently given procedures for patients who had already had thoracentesis within the same month in 2102? ### Input: CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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,
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
) ### Response: SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracentesis') AND STRFTIME('%y', procedures_icd.charttime) = '2102') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.icd9_code, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', procedures_icd.charttime) = '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 3)
|
how many patients in 2105 have received closed bronchial biopsy in the same hospital visit after receiving hemodialysis?
|
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
|
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hemodialysis') AND STRFTIME('%y', procedures_icd.charttime) = '2105') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'closed bronchial biopsy') AND STRFTIME('%y', procedures_icd.charttime) = '2105') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients in 2105 have received closed bronchial biopsy in the same hospital visit after receiving hemodialysis? ### Input: CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hemodialysis') AND STRFTIME('%y', procedures_icd.charttime) = '2105') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'closed bronchial biopsy') AND STRFTIME('%y', procedures_icd.charttime) = '2105') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id
|
BALTIMORE to PHILADELPHIA
|
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_miles int,
pressurized varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
|
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight 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 AND CITY_1.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
atis
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: BALTIMORE to PHILADELPHIA ### Input: 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_miles int,
pressurized varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,
time_elapsed int,
to_airport varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
) ### Response: 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code
|
give me the number of patients whose admission type is emergency and diagnoses long title is abnormal involuntary movements?
|
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Abnormal involuntary movements"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me the number of patients whose admission type is emergency and diagnoses long title is abnormal involuntary movements? ### Input: CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
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
)
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Abnormal involuntary movements"
|
What is Venue, when Year is 2005, and when Result is 8th?
|
CREATE TABLE table_name_63 (
venue VARCHAR,
year VARCHAR,
result VARCHAR
)
|
SELECT venue FROM table_name_63 WHERE year = 2005 AND result = "8th"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Venue, when Year is 2005, and when Result is 8th? ### Input: CREATE TABLE table_name_63 (
venue VARCHAR,
year VARCHAR,
result VARCHAR
) ### Response: SELECT venue FROM table_name_63 WHERE year = 2005 AND result = "8th"
|
When did the season air where the viewership was 14.71 million?
|
CREATE TABLE table_234 (
"Season" real,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" text
)
|
SELECT "Season premiere" FROM table_234 WHERE "Viewers (in millions)" = '14.71'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: When did the season air where the viewership was 14.71 million? ### Input: CREATE TABLE table_234 (
"Season" real,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" text
) ### Response: SELECT "Season premiere" FROM table_234 WHERE "Viewers (in millions)" = '14.71'
|
What is the 8:00 feature with je at 7:00?
|
CREATE TABLE table_69427 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
)
|
SELECT "8:00" FROM table_69427 WHERE "7:00" = 'je'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the 8:00 feature with je at 7:00? ### Input: CREATE TABLE table_69427 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) ### Response: SELECT "8:00" FROM table_69427 WHERE "7:00" = 'je'
|
What is Second Member, when Election is '1835'?
|
CREATE TABLE table_name_99 (
second_member VARCHAR,
election VARCHAR
)
|
SELECT second_member FROM table_name_99 WHERE election = "1835"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Second Member, when Election is '1835'? ### Input: CREATE TABLE table_name_99 (
second_member VARCHAR,
election VARCHAR
) ### Response: SELECT second_member FROM table_name_99 WHERE election = "1835"
|
Show the average age for male and female students Visualize by bar chart, and could you sort total number in descending order?
|
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
|
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC
|
nvbench
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Show the average age for male and female students Visualize by bar chart, and could you sort total number in descending order? ### Input: CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
) ### Response: SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC
|
have patient 76327's received tests during their first hospital encounter for alanine aminotransferase (alt)?
|
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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 number,
event_type text,
event_id number,
chargetime time,
cost number
)
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,
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_labitems (
row_id number,
itemid number,
label text
)
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
|
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'alanine aminotransferase (alt)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: have patient 76327's received tests during their first hospital encounter for alanine aminotransferase (alt)? ### Input: CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
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 number,
event_type text,
event_id number,
chargetime time,
cost number
)
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,
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_labitems (
row_id number,
itemid number,
label text
)
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
) ### Response: SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'alanine aminotransferase (alt)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)
|
previous to 1965 , when did jones have a number 5 start at the indy 500 ?
|
CREATE TABLE table_203_339 (
id number,
"year" text,
"car" number,
"start" number,
"qual" number,
"rank" number,
"finish" number,
"laps" number,
"led" number,
"retired" text
)
|
SELECT "year" FROM table_203_339 WHERE "year" < 1965 AND "start" = 5
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: previous to 1965 , when did jones have a number 5 start at the indy 500 ? ### Input: CREATE TABLE table_203_339 (
id number,
"year" text,
"car" number,
"start" number,
"qual" number,
"rank" number,
"finish" number,
"laps" number,
"led" number,
"retired" text
) ### Response: SELECT "year" FROM table_203_339 WHERE "year" < 1965 AND "start" = 5
|
Name the opponent when the resultwas w 12-11
|
CREATE TABLE table_name_45 (
opponent VARCHAR,
result VARCHAR
)
|
SELECT opponent FROM table_name_45 WHERE result = "w 12-11"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the opponent when the resultwas w 12-11 ### Input: CREATE TABLE table_name_45 (
opponent VARCHAR,
result VARCHAR
) ### Response: SELECT opponent FROM table_name_45 WHERE result = "w 12-11"
|
Which place is Andy Bean from the United States?
|
CREATE TABLE table_12732 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
|
SELECT "Place" FROM table_12732 WHERE "Country" = 'united states' AND "Player" = 'andy bean'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which place is Andy Bean from the United States? ### Input: CREATE TABLE table_12732 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) ### Response: SELECT "Place" FROM table_12732 WHERE "Country" = 'united states' AND "Player" = 'andy bean'
|
How many episodes were shown on Friday if 210 Kirby's Epic Yarn was shown on Wednesday?
|
CREATE TABLE table_22175 (
"Episodes" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text
)
|
SELECT COUNT("Friday") FROM table_22175 WHERE "Wednesday" = '210 Kirby''s Epic Yarn'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many episodes were shown on Friday if 210 Kirby's Epic Yarn was shown on Wednesday? ### Input: CREATE TABLE table_22175 (
"Episodes" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text
) ### Response: SELECT COUNT("Friday") FROM table_22175 WHERE "Wednesday" = '210 Kirby''s Epic Yarn'
|
What is Cha Bum-Kun's average number of goals per match?
|
CREATE TABLE table_62099 (
"Name" text,
"Confederation" text,
"International goals" real,
"Caps" real,
"Goals per Match" real
)
|
SELECT COUNT("Goals per Match") FROM table_62099 WHERE "Name" = 'cha bum-kun'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is Cha Bum-Kun's average number of goals per match? ### Input: CREATE TABLE table_62099 (
"Name" text,
"Confederation" text,
"International goals" real,
"Caps" real,
"Goals per Match" real
) ### Response: SELECT COUNT("Goals per Match") FROM table_62099 WHERE "Name" = 'cha bum-kun'
|
Which platform has an Actual version of 0.147?
|
CREATE TABLE table_55130 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
)
|
SELECT "Platform" FROM table_55130 WHERE "Actual version" = '0.147'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which platform has an Actual version of 0.147? ### Input: CREATE TABLE table_55130 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
) ### Response: SELECT "Platform" FROM table_55130 WHERE "Actual version" = '0.147'
|
How many games did they play when their record 0-2-0?
|
CREATE TABLE table_24091 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
)
|
SELECT COUNT("Date") FROM table_24091 WHERE "Record" = '0-2-0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many games did they play when their record 0-2-0? ### Input: CREATE TABLE table_24091 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
) ### Response: SELECT COUNT("Date") FROM table_24091 WHERE "Record" = '0-2-0'
|
What is the charity of the celebrity with the background reality star?
|
CREATE TABLE table_491 (
"Celebrity" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Charity" text,
"Result" text,
"Raised" text
)
|
SELECT "Charity" FROM table_491 WHERE "Background" = 'Reality Star'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the charity of the celebrity with the background reality star? ### Input: CREATE TABLE table_491 (
"Celebrity" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Charity" text,
"Result" text,
"Raised" text
) ### Response: SELECT "Charity" FROM table_491 WHERE "Background" = 'Reality Star'
|
count the number of people diagnosed with chronic nephritis nec who did not come to the hospital in the same month.
|
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE 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,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
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,
short_title text,
long_title text
)
|
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 = 'chronic nephritis nec')) AS t1) - (SELECT COUNT(DISTINCT t2.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 = 'chronic nephritis nec')) AS t2 JOIN admissions ON t2.subject_id = admissions.subject_id WHERE t2.charttime < admissions.admittime AND DATETIME(t2.charttime, 'start of month') = DATETIME(admissions.admittime, 'start of month'))
|
mimic_iii
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: count the number of people diagnosed with chronic nephritis nec who did not come to the hospital in the same month. ### Input: CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE 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,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
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,
short_title text,
long_title text
) ### Response: 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 = 'chronic nephritis nec')) AS t1) - (SELECT COUNT(DISTINCT t2.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 = 'chronic nephritis nec')) AS t2 JOIN admissions ON t2.subject_id = admissions.subject_id WHERE t2.charttime < admissions.admittime AND DATETIME(t2.charttime, 'start of month') = DATETIME(admissions.admittime, 'start of month'))
|
Name the title that got 1.54 viewers
|
CREATE TABLE table_24934 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
)
|
SELECT "Title" FROM table_24934 WHERE "U.S. viewers (million)" = '1.54'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Name the title that got 1.54 viewers ### Input: CREATE TABLE table_24934 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) ### Response: SELECT "Title" FROM table_24934 WHERE "U.S. viewers (million)" = '1.54'
|
Which Goals have Games of 51, and a Debut year smaller than 1992?
|
CREATE TABLE table_13444 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
)
|
SELECT MIN("Goals") FROM table_13444 WHERE "Games" = '51' AND "Debut year" < '1992'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which Goals have Games of 51, and a Debut year smaller than 1992? ### Input: CREATE TABLE table_13444 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
) ### Response: SELECT MIN("Goals") FROM table_13444 WHERE "Games" = '51' AND "Debut year" < '1992'
|
What channel has station kdfw ++?
|
CREATE TABLE table_1353096_1 (
channel_tv___dt__ VARCHAR,
station VARCHAR
)
|
SELECT channel_tv___dt__ FROM table_1353096_1 WHERE station = "KDFW ++"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What channel has station kdfw ++? ### Input: CREATE TABLE table_1353096_1 (
channel_tv___dt__ VARCHAR,
station VARCHAR
) ### Response: SELECT channel_tv___dt__ FROM table_1353096_1 WHERE station = "KDFW ++"
|
what is the minimum pos with clubs being 16
|
CREATE TABLE table_14460937_2 (
pos INTEGER,
clubs VARCHAR
)
|
SELECT MIN(pos) FROM table_14460937_2 WHERE clubs = "16"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the minimum pos with clubs being 16 ### Input: CREATE TABLE table_14460937_2 (
pos INTEGER,
clubs VARCHAR
) ### Response: SELECT MIN(pos) FROM table_14460937_2 WHERE clubs = "16"
|
What sport did Miroslav Jambor Richard Csejtey participate in?
|
CREATE TABLE table_name_16 (
sport VARCHAR,
name VARCHAR
)
|
SELECT sport FROM table_name_16 WHERE name = "miroslav jambor richard csejtey"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What sport did Miroslav Jambor Richard Csejtey participate in? ### Input: CREATE TABLE table_name_16 (
sport VARCHAR,
name VARCHAR
) ### Response: SELECT sport FROM table_name_16 WHERE name = "miroslav jambor richard csejtey"
|
The district North Carolina 10 have what candidates?
|
CREATE TABLE table_3608 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
|
SELECT "Candidates" FROM table_3608 WHERE "District" = 'North Carolina 10'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: The district North Carolina 10 have what candidates? ### Input: CREATE TABLE table_3608 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) ### Response: SELECT "Candidates" FROM table_3608 WHERE "District" = 'North Carolina 10'
|
What is the owner of the channel that has a 2012 rating of 5.42?
|
CREATE TABLE table_name_96 (
owner VARCHAR
)
|
SELECT owner FROM table_name_96 WHERE 2012 = "5.42"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the owner of the channel that has a 2012 rating of 5.42? ### Input: CREATE TABLE table_name_96 (
owner VARCHAR
) ### Response: SELECT owner FROM table_name_96 WHERE 2012 = "5.42"
|
what was the yearly maximum value of weight for patient 015-56556 until 2104?
|
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
|
SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) <= '2104' GROUP BY STRFTIME('%y', patient.unitadmittime)
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what was the yearly maximum value of weight for patient 015-56556 until 2104? ### Input: CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
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 (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
) ### Response: SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) <= '2104' GROUP BY STRFTIME('%y', patient.unitadmittime)
|
What is the total of PI GP played by Anton Rodin with a Reg GP less than 0?
|
CREATE TABLE table_54772 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
)
|
SELECT COUNT("Pl GP") FROM table_54772 WHERE "Player" = 'anton rodin' AND "Reg GP" < '0'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What is the total of PI GP played by Anton Rodin with a Reg GP less than 0? ### Input: CREATE TABLE table_54772 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) ### Response: SELECT COUNT("Pl GP") FROM table_54772 WHERE "Player" = 'anton rodin' AND "Reg GP" < '0'
|
give me some restaurants good for french food ?
|
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
|
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
|
restaurants
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: give me some restaurants good for french food ? ### Input: CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
) ### Response: SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
|
how many patients have been prescribed the drug with code hald5i?
|
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 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,
route text,
drug_dose text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "HALD5I"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many patients have been prescribed the drug with code hald5i? ### Input: 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
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 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,
route text,
drug_dose text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "HALD5I"
|
what is the number of patients whose ethnicity is black/cape verdean and age is less than 86?
|
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,
label text,
fluid text
)
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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
)
|
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "86"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what is the number of patients whose ethnicity is black/cape verdean and age is less than 86? ### Input: 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,
label text,
fluid text
)
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 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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.age < "86"
|
What were the highest points before the year 1974?
|
CREATE TABLE table_68607 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
|
SELECT MAX("Points") FROM table_68607 WHERE "Year" < '1974'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What were the highest points before the year 1974? ### Input: CREATE TABLE table_68607 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) ### Response: SELECT MAX("Points") FROM table_68607 WHERE "Year" < '1974'
|
What's the 2012 when 2009 was 205?
|
CREATE TABLE table_62844 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
|
SELECT "2012" FROM table_62844 WHERE "2009" = '205'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: What's the 2012 when 2009 was 205? ### Input: CREATE TABLE table_62844 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) ### Response: SELECT "2012" FROM table_62844 WHERE "2009" = '205'
|
what are the number of times bangalore is listed as the destination ?
|
CREATE TABLE table_204_78 (
id number,
"no." number,
"train no." text,
"origin" text,
"destination" text,
"train name" text
)
|
SELECT COUNT(*) FROM table_204_78 WHERE "destination" = 'bangalore'
|
squall
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: what are the number of times bangalore is listed as the destination ? ### Input: CREATE TABLE table_204_78 (
id number,
"no." number,
"train no." text,
"origin" text,
"destination" text,
"train name" text
) ### Response: SELECT COUNT(*) FROM table_204_78 WHERE "destination" = 'bangalore'
|
Where was the game where the senators scored 80 points?
|
CREATE TABLE table_50508 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
)
|
SELECT "Location" FROM table_50508 WHERE "Points" = '80'
|
wikisql
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Where was the game where the senators scored 80 points? ### Input: CREATE TABLE table_50508 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) ### Response: SELECT "Location" FROM table_50508 WHERE "Points" = '80'
|
Which region had a release format of CD Maxi?
|
CREATE TABLE table_name_20 (
region VARCHAR,
format VARCHAR
)
|
SELECT region FROM table_name_20 WHERE format = "cd maxi"
|
sql_create_context
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: Which region had a release format of CD Maxi? ### Input: CREATE TABLE table_name_20 (
region VARCHAR,
format VARCHAR
) ### Response: SELECT region FROM table_name_20 WHERE format = "cd maxi"
|
until 09/10/2105, what was the daily average dose of enteral formula volume/bolus amt (ml) of patient 004-13672?
|
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
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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 vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
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,
cellvaluenumeric number,
intakeoutputtime time
)
|
SELECT AVG(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 = '004-13672')) AND intakeoutput.celllabel = 'enteral formula volume/bolus amt (ml)' AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2105-09-10' GROUP BY STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime)
|
eicu
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: until 09/10/2105, what was the daily average dose of enteral formula volume/bolus amt (ml) of patient 004-13672? ### Input: 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
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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,
hospitaladmitsource text,
unitadmittime time,
unitdischargetime time,
hospitaldischargetime time,
hospitaldischargestatus text
)
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 vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
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,
cellvaluenumeric number,
intakeoutputtime time
) ### Response: SELECT AVG(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 = '004-13672')) AND intakeoutput.celllabel = 'enteral formula volume/bolus amt (ml)' AND intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) <= '2105-09-10' GROUP BY STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime)
|
how many of the patients with item id 51181 had an unobtainable religious belief?
|
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 (
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "UNOBTAINABLE" AND lab.itemid = "51181"
|
mimicsql_data
|
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: how many of the patients with item id 51181 had an unobtainable religious belief? ### Input: 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 (
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 text,
discharge_location text,
diagnosis text,
dod text,
dob_year text,
dod_year text,
admittime text,
dischtime text,
admityear 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
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "UNOBTAINABLE" AND lab.itemid = "51181"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.