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 was the first time patient 24894 received calcium, total in a lab test during the first hospital visit? | 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 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
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 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id 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
) | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime 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 first time patient 24894 received calcium, total in a lab test during the first hospital visit? ### Input: 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 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
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 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id 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
) ### Response: SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24894 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) ORDER BY labevents.charttime LIMIT 1 |
tell me the number of stations tv azteca owns . | CREATE TABLE table_204_796 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
) | SELECT COUNT("network name") FROM table_204_796 WHERE "owner" = 'tv azteca' | 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: tell me the number of stations tv azteca owns . ### Input: CREATE TABLE table_204_796 (
id number,
"network name" text,
"flagship" text,
"programming type" text,
"owner" text,
"affiliates" number
) ### Response: SELECT COUNT("network name") FROM table_204_796 WHERE "owner" = 'tv azteca' |
What place has the score of 67-74=141? | CREATE TABLE table_name_2 (
place VARCHAR,
score VARCHAR
) | SELECT place FROM table_name_2 WHERE score = 67 - 74 = 141 | 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 has the score of 67-74=141? ### Input: CREATE TABLE table_name_2 (
place VARCHAR,
score VARCHAR
) ### Response: SELECT place FROM table_name_2 WHERE score = 67 - 74 = 141 |
What is the census ranking for the Perth parish? | CREATE TABLE table_176524_2 (
census_ranking VARCHAR,
official_name VARCHAR
) | SELECT census_ranking FROM table_176524_2 WHERE official_name = "Perth" | 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 census ranking for the Perth parish? ### Input: CREATE TABLE table_176524_2 (
census_ranking VARCHAR,
official_name VARCHAR
) ### Response: SELECT census_ranking FROM table_176524_2 WHERE official_name = "Perth" |
Who was the home team on March 5, 2008? | CREATE TABLE table_10100 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | SELECT "Home" FROM table_10100 WHERE "Date" = 'march 5, 2008' | 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 home team on March 5, 2008? ### Input: CREATE TABLE table_10100 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) ### Response: SELECT "Home" FROM table_10100 WHERE "Date" = 'march 5, 2008' |
how many player with no being 12 | CREATE TABLE table_12962773_5 (
player VARCHAR,
no VARCHAR
) | SELECT COUNT(player) FROM table_12962773_5 WHERE no = 12 | 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 player with no being 12 ### Input: CREATE TABLE table_12962773_5 (
player VARCHAR,
no VARCHAR
) ### Response: SELECT COUNT(player) FROM table_12962773_5 WHERE no = 12 |
Which driver has a # smaller than 40, less than 151 points, and Winnings of $84,400? | CREATE TABLE table_12045 (
"Driver" text,
"Car #" real,
"Make" text,
"Points" real,
"Laps" real,
"Winnings" text
) | SELECT "Make" FROM table_12045 WHERE "Car #" < '40' AND "Points" < '151' AND "Winnings" = '$84,400' | 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 driver has a # smaller than 40, less than 151 points, and Winnings of $84,400? ### Input: CREATE TABLE table_12045 (
"Driver" text,
"Car #" real,
"Make" text,
"Points" real,
"Laps" real,
"Winnings" text
) ### Response: SELECT "Make" FROM table_12045 WHERE "Car #" < '40' AND "Points" < '151' AND "Winnings" = '$84,400' |
How many documents in different starting date? Return a line chart grouping by starting date. | CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
) | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From | 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: How many documents in different starting date? Return a line chart grouping by starting date. ### Input: CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
) ### Response: SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From |
How many places have an Artist of august , and a Draw smaller than 6? | CREATE TABLE table_64729 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) | SELECT COUNT("Place") FROM table_64729 WHERE "Artist" = 'augustė' AND "Draw" < '6' | 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 places have an Artist of august , and a Draw smaller than 6? ### Input: CREATE TABLE table_64729 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" real
) ### Response: SELECT COUNT("Place") FROM table_64729 WHERE "Artist" = 'augustė' AND "Draw" < '6' |
On what date was game 3? | CREATE TABLE table_79596 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | SELECT "Date" FROM table_79596 WHERE "Game" = '3' | 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: On what date was game 3? ### Input: CREATE TABLE table_79596 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location Attendance" text,
"Record" text
) ### Response: SELECT "Date" FROM table_79596 WHERE "Game" = '3' |
What is the region 4 (Aus) date associated with a region 1 (US) date of January 16, 2007? | CREATE TABLE table_240936_2 (
region_4__australia_ VARCHAR,
region_1__us_ VARCHAR
) | SELECT region_4__australia_ FROM table_240936_2 WHERE region_1__us_ = "January 16, 2007" | 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 region 4 (Aus) date associated with a region 1 (US) date of January 16, 2007? ### Input: CREATE TABLE table_240936_2 (
region_4__australia_ VARCHAR,
region_1__us_ VARCHAR
) ### Response: SELECT region_4__australia_ FROM table_240936_2 WHERE region_1__us_ = "January 16, 2007" |
What is the highest React that has a 7.61 Mark and a heat bigger than 1? | CREATE TABLE table_name_84 (
react INTEGER,
mark VARCHAR,
heat VARCHAR
) | SELECT MAX(react) FROM table_name_84 WHERE mark = "7.61" AND heat > 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 highest React that has a 7.61 Mark and a heat bigger than 1? ### Input: CREATE TABLE table_name_84 (
react INTEGER,
mark VARCHAR,
heat VARCHAR
) ### Response: SELECT MAX(react) FROM table_name_84 WHERE mark = "7.61" AND heat > 1 |
What year was USF founded? | CREATE TABLE table_1160660_1 (
date_founded VARCHAR,
acronym VARCHAR
) | SELECT date_founded FROM table_1160660_1 WHERE acronym = "USF" | 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 year was USF founded? ### Input: CREATE TABLE table_1160660_1 (
date_founded VARCHAR,
acronym VARCHAR
) ### Response: SELECT date_founded FROM table_1160660_1 WHERE acronym = "USF" |
what is the position in table when the team is hartlepool united? | CREATE TABLE table_64562 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | SELECT "Position in table" FROM table_64562 WHERE "Team" = 'hartlepool united' | 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 position in table when the team is hartlepool united? ### Input: CREATE TABLE table_64562 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) ### Response: SELECT "Position in table" FROM table_64562 WHERE "Team" = 'hartlepool united' |
What was the position of the player from Butler High School? | CREATE TABLE table_17065 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | SELECT "Position" FROM table_17065 WHERE "School" = 'Butler High School' | 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 position of the player from Butler High School? ### Input: CREATE TABLE table_17065 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) ### Response: SELECT "Position" FROM table_17065 WHERE "School" = 'Butler High School' |
what is age and religion of subject id 84129? | 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 demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "84129" | 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 age and religion of subject id 84129? ### 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 demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "84129" |
how many prescriptions for multivitamins have been ordered? | 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime 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(*) FROM medication WHERE medication.drugname = 'multivitamins' | 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: how many prescriptions for multivitamins have been ordered? ### Input: 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime 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(*) FROM medication WHERE medication.drugname = 'multivitamins' |
Which analog channel is Fox on? | CREATE TABLE table_52794 (
"Analog Channel" text,
"Digital Channel" text,
"Call sign" text,
"Name" text,
"Network" text
) | SELECT "Analog Channel" FROM table_52794 WHERE "Network" = 'fox' | 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 analog channel is Fox on? ### Input: CREATE TABLE table_52794 (
"Analog Channel" text,
"Digital Channel" text,
"Call sign" text,
"Name" text,
"Network" text
) ### Response: SELECT "Analog Channel" FROM table_52794 WHERE "Network" = 'fox' |
first opponent to defeat mocho cota in mexico city | CREATE TABLE table_204_373 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
) | SELECT "winner" FROM table_204_373 WHERE "loser" = 'mocho cota' AND "location" = 'mexico city' ORDER BY "date" 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: first opponent to defeat mocho cota in mexico city ### Input: CREATE TABLE table_204_373 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
) ### Response: SELECT "winner" FROM table_204_373 WHERE "loser" = 'mocho cota' AND "location" = 'mexico city' ORDER BY "date" LIMIT 1 |
what is admission time and drug dose of subject id 74032? | 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 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
) | SELECT demographic.admittime, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032" | 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 admission time and drug dose of subject id 74032? ### 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 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
) ### Response: SELECT demographic.admittime, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032" |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of salary over the job_id , and group by attribute job_id, I want to order in descending by the JOB_ID please. | CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID 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: For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of salary over the job_id , and group by attribute job_id, I want to order in descending by the JOB_ID please. ### Input: CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
) ### Response: SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What is the highest Aug 2013 with a Nov 2011 smaller than 968, and a Jul 2012 with 31, and a Jun 2011 larger than 30? | CREATE TABLE table_51528 (
"Feb 2010" text,
"Mar 2010" text,
"May 2010" real,
"Jun 2010" real,
"Jul 2010" real,
"Aug 2010" real,
"Sep 2010" real,
"Oct 2010" real,
"Nov 2010" real,
"Dec 2010" real,
"Jan 2011" real,
"Feb 2011" real,
"Mar 2011" real,
"Apr 2011" real,
"May 2011" real,
"Jun 2011" real,
"Jul 2011" real,
"Aug 2011" real,
"Sep 2011" real,
"Oct 2011" real,
"Nov 2011" real,
"Dec 2011" real,
"Jan 2012" real,
"Feb 2012" real,
"Mar 2012" real,
"Apr 2012" real,
"May 2012" real,
"Jun 2012" real,
"Jul 2012" real,
"Aug 2012" real,
"Sep 2012" real,
"Oct 2012" real,
"Nov 2012" real,
"Dec 2012" real,
"Jan 2013" real,
"Feb 2013" real,
"Mar 2013" real,
"Apr 2013" real,
"May 2013" real,
"Jun 2013" real,
"Jul 2013" real,
"Aug 2013" real,
"Sep 2013" real,
"Oct 2013" real
) | SELECT MAX("Aug 2013") FROM table_51528 WHERE "Nov 2011" < '968' AND "Jul 2012" = '31' AND "Jun 2011" > '30' | 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 highest Aug 2013 with a Nov 2011 smaller than 968, and a Jul 2012 with 31, and a Jun 2011 larger than 30? ### Input: CREATE TABLE table_51528 (
"Feb 2010" text,
"Mar 2010" text,
"May 2010" real,
"Jun 2010" real,
"Jul 2010" real,
"Aug 2010" real,
"Sep 2010" real,
"Oct 2010" real,
"Nov 2010" real,
"Dec 2010" real,
"Jan 2011" real,
"Feb 2011" real,
"Mar 2011" real,
"Apr 2011" real,
"May 2011" real,
"Jun 2011" real,
"Jul 2011" real,
"Aug 2011" real,
"Sep 2011" real,
"Oct 2011" real,
"Nov 2011" real,
"Dec 2011" real,
"Jan 2012" real,
"Feb 2012" real,
"Mar 2012" real,
"Apr 2012" real,
"May 2012" real,
"Jun 2012" real,
"Jul 2012" real,
"Aug 2012" real,
"Sep 2012" real,
"Oct 2012" real,
"Nov 2012" real,
"Dec 2012" real,
"Jan 2013" real,
"Feb 2013" real,
"Mar 2013" real,
"Apr 2013" real,
"May 2013" real,
"Jun 2013" real,
"Jul 2013" real,
"Aug 2013" real,
"Sep 2013" real,
"Oct 2013" real
) ### Response: SELECT MAX("Aug 2013") FROM table_51528 WHERE "Nov 2011" < '968' AND "Jul 2012" = '31' AND "Jun 2011" > '30' |
How many rounds were on July 10? | CREATE TABLE table_24626 (
"Round" real,
"Date" text,
"City and venue" text,
"Winner" text,
"Runner-up" text,
"3rd placed" text,
"4th placed" text,
"Results" text
) | SELECT COUNT("Round") FROM table_24626 WHERE "Date" = 'July 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: How many rounds were on July 10? ### Input: CREATE TABLE table_24626 (
"Round" real,
"Date" text,
"City and venue" text,
"Winner" text,
"Runner-up" text,
"3rd placed" text,
"4th placed" text,
"Results" text
) ### Response: SELECT COUNT("Round") FROM table_24626 WHERE "Date" = 'July 10' |
what country lost the most ships to u-502 ? | CREATE TABLE table_203_268 (
id number,
"date" text,
"name" text,
"nationality" text,
"tonnage\n(grt)" number,
"fate" text
) | SELECT "nationality" FROM table_203_268 GROUP BY "nationality" ORDER BY COUNT("name") DESC 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: what country lost the most ships to u-502 ? ### Input: CREATE TABLE table_203_268 (
id number,
"date" text,
"name" text,
"nationality" text,
"tonnage\n(grt)" number,
"fate" text
) ### Response: SELECT "nationality" FROM table_203_268 GROUP BY "nationality" ORDER BY COUNT("name") DESC LIMIT 1 |
how many hours have it been since the first time patient 027-140654 received procedures during their current hospital encounter? | 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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
) | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime LIMIT 1 | 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: how many hours have it been since the first time patient 027-140654 received procedures during their current hospital encounter? ### 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 intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime 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 diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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
) ### Response: SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654' AND patient.hospitaldischargetime IS NULL)) ORDER BY treatment.treatmenttime LIMIT 1 |
What district has counties represented by Baltimore county, a committee of health and government operations, and a first elected smaller than 2002? | CREATE TABLE table_15822 (
"District" text,
"Counties Represented" text,
"Party" text,
"First Elected" real,
"Committee" text
) | SELECT "District" FROM table_15822 WHERE "Counties Represented" = 'baltimore county' AND "Committee" = 'health and government operations' AND "First Elected" < '2002' | 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 district has counties represented by Baltimore county, a committee of health and government operations, and a first elected smaller than 2002? ### Input: CREATE TABLE table_15822 (
"District" text,
"Counties Represented" text,
"Party" text,
"First Elected" real,
"Committee" text
) ### Response: SELECT "District" FROM table_15822 WHERE "Counties Represented" = 'baltimore county' AND "Committee" = 'health and government operations' AND "First Elected" < '2002' |
what is the number of routes that intersect highway 91 ? | CREATE TABLE table_203_333 (
id number,
"kilometers" number,
"name" text,
"location" text,
"intersecting routes" text
) | SELECT COUNT("intersecting routes") FROM table_203_333 | 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 is the number of routes that intersect highway 91 ? ### Input: CREATE TABLE table_203_333 (
id number,
"kilometers" number,
"name" text,
"location" text,
"intersecting routes" text
) ### Response: SELECT COUNT("intersecting routes") FROM table_203_333 |
Who is the home side when the away side scores 11.15 (81)? | CREATE TABLE table_33617 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Home team" FROM table_33617 WHERE "Away team score" = '11.15 (81)' | 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 is the home side when the away side scores 11.15 (81)? ### Input: CREATE TABLE table_33617 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Home team" FROM table_33617 WHERE "Away team score" = '11.15 (81)' |
What is the frequency of the dates (bin into weekday interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and could you sort from low to high by the y-axis? | CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
) | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) | 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: What is the frequency of the dates (bin into weekday interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and could you sort from low to high by the y-axis? ### Input: CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pressure_inches NUMERIC,
mean_sea_level_pressure_inches NUMERIC,
min_sea_level_pressure_inches NUMERIC,
max_visibility_miles INTEGER,
mean_visibility_miles INTEGER,
min_visibility_miles INTEGER,
max_wind_Speed_mph INTEGER,
mean_wind_speed_mph INTEGER,
max_gust_speed_mph INTEGER,
precipitation_inches INTEGER,
cloud_cover INTEGER,
events TEXT,
wind_dir_degrees INTEGER,
zip_code INTEGER
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
) ### Response: SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) |
what is the diagnosis icd9 code for patient name kurt buczek? | 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 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kurt Buczek" | 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 diagnosis icd9 code for patient name kurt buczek? ### 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
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
) ### Response: SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kurt Buczek" |
Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart. | CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
) | SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 | 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: Find dates and attendance for exhibitions that happened in 2004, show me the attendance by date with a bar chart. ### Input: CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
) ### Response: SELECT T1.Date, T1.Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004 |
Short Favorited Commented Questions with no Answers. | CREATE TABLE VoteTypes (
Id number,
Name 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId 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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
) | SELECT Id AS "post_link", Tags FROM Posts WHERE LENGTH(Body) < 100 AND PostTypeId = 1 AND ClosedDate IS NULL AND DeletionDate IS NULL AND CommunityOwnedDate IS NULL AND AnswerCount = 0 AND CommentCount > 0 AND FavoriteCount > 0 | 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: Short Favorited Commented Questions with no Answers. ### Input: CREATE TABLE VoteTypes (
Id number,
Name 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId 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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
) ### Response: SELECT Id AS "post_link", Tags FROM Posts WHERE LENGTH(Body) < 100 AND PostTypeId = 1 AND ClosedDate IS NULL AND DeletionDate IS NULL AND CommunityOwnedDate IS NULL AND AnswerCount = 0 AND CommentCount > 0 AND FavoriteCount > 0 |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to show from high to low by the x axis. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name 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: For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of price , and group by attribute name, I want to show from high to low by the x axis. ### Input: CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) ### Response: SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Which club lost exactly 7 matches? | CREATE TABLE table_74082 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
) | SELECT "Club" FROM table_74082 WHERE "Lost" = '7' | 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 club lost exactly 7 matches? ### Input: CREATE TABLE table_74082 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Points" text
) ### Response: SELECT "Club" FROM table_74082 WHERE "Lost" = '7' |
What is Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'? | CREATE TABLE table_name_32 (
tie_no VARCHAR,
date VARCHAR,
home_team VARCHAR
) | SELECT tie_no FROM table_name_32 WHERE date = "18 nov 1989" AND home_team = "doncaster rovers" | 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 Tie no, when Date is '18 Nov 1989', and when Home Team is 'Doncaster Rovers'? ### Input: CREATE TABLE table_name_32 (
tie_no VARCHAR,
date VARCHAR,
home_team VARCHAR
) ### Response: SELECT tie_no FROM table_name_32 WHERE date = "18 nov 1989" AND home_team = "doncaster rovers" |
On August 22, how many people came to the game? | CREATE TABLE table_67152 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | SELECT "Attendance" FROM table_67152 WHERE "Date" = 'august 22' | 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: On August 22, how many people came to the game? ### Input: CREATE TABLE table_67152 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) ### Response: SELECT "Attendance" FROM table_67152 WHERE "Date" = 'august 22' |
What is the latest year any of the incumbents were first elected? | CREATE TABLE table_1342270_42 (
first_elected INTEGER
) | SELECT MAX(first_elected) FROM table_1342270_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 latest year any of the incumbents were first elected? ### Input: CREATE TABLE table_1342270_42 (
first_elected INTEGER
) ### Response: SELECT MAX(first_elected) FROM table_1342270_42 |
count the number of people who were prescribed chlorhexidine gluconate 0.12% oral rinse within 2 months following a diagnosis of oth spf gastrt w hmrhg until 2102. | CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_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 labevents (
row_id number,
subject_id number,
hadm_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 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount 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 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
) | 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 = 'oth spf gastrt w hmrhg') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2102') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorhexidine gluconate 0.12% oral rinse' AND STRFTIME('%y', prescriptions.startdate) <= '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 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 who were prescribed chlorhexidine gluconate 0.12% oral rinse within 2 months following a diagnosis of oth spf gastrt w hmrhg until 2102. ### Input: CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_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 labevents (
row_id number,
subject_id number,
hadm_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 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount 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 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
) ### Response: 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 = 'oth spf gastrt w hmrhg') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2102') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorhexidine gluconate 0.12% oral rinse' AND STRFTIME('%y', prescriptions.startdate) <= '2102') AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.startdate AND DATETIME(t2.startdate) BETWEEN DATETIME(t1.charttime) AND DATETIME(t1.charttime, '+2 month') |
when was the last time since 04/2104 that patient 88659 was prescribed vial and iso-osmotic dextrose at the same 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid 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 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 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 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 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 d_items (
row_id number,
itemid number,
label text,
linksto text
) | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vial' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.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: when was the last time since 04/2104 that patient 88659 was prescribed vial and iso-osmotic dextrose at the same time? ### Input: 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid 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 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 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 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 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 d_items (
row_id number,
itemid number,
label text,
linksto text
) ### Response: SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vial' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t1 JOIN (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'iso-osmotic dextrose' AND admissions.subject_id = 88659 AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-04') AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) ORDER BY t1.startdate DESC LIMIT 1 |
Name the ppv for sky famiglia and dar 16:9 for mtv dance | CREATE TABLE table_20379 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) | SELECT "PPV" FROM table_20379 WHERE "Package/Option" = 'Sky Famiglia' AND "DAR" = '16:9' AND "Television service" = 'MTV Dance' | 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 ppv for sky famiglia and dar 16:9 for mtv dance ### Input: CREATE TABLE table_20379 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) ### Response: SELECT "PPV" FROM table_20379 WHERE "Package/Option" = 'Sky Famiglia' AND "DAR" = '16:9' AND "Television service" = 'MTV Dance' |
Show institution names along with the number of proteins for each institution in a bar chart, and order by the y-axis in desc. | CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
sequence_identity_to_human_protein text,
Institution_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
) | SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY COUNT(*) 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 institution names along with the number of proteins for each institution in a bar chart, and order by the y-axis in desc. ### Input: CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real,
accession_number text,
sequence_length real,
sequence_identity_to_human_protein text,
Institution_id text
)
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
) ### Response: SELECT Institution, COUNT(*) FROM Institution AS T1 JOIN protein AS T2 ON T1.Institution_id = T2.Institution_id GROUP BY T1.Institution_id ORDER BY COUNT(*) DESC |
what is the record when the round is before 3 and the time si 4:59? | CREATE TABLE table_48174 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | SELECT "Record" FROM table_48174 WHERE "Round" < '3' AND "Time" = '4:59' | 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 record when the round is before 3 and the time si 4:59? ### Input: CREATE TABLE table_48174 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) ### Response: SELECT "Record" FROM table_48174 WHERE "Round" < '3' AND "Time" = '4:59' |
A line chart for finding the number of the enrollment date for all the tests that have 'Pass' result. | CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
) | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment | 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: A line chart for finding the number of the enrollment date for all the tests that have 'Pass' result. ### Input: CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Tests_Taken (
registration_id INTEGER,
date_test_taken DATETIME,
test_result VARCHAR(255)
) ### Response: SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" GROUP BY date_of_enrolment |
When was 11-8 the record? | CREATE TABLE table_name_43 (
date VARCHAR,
record VARCHAR
) | SELECT date FROM table_name_43 WHERE record = "11-8" | 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 was 11-8 the record? ### Input: CREATE TABLE table_name_43 (
date VARCHAR,
record VARCHAR
) ### Response: SELECT date FROM table_name_43 WHERE record = "11-8" |
provide the number of patients whose primary disease is left colon cancer and age is less than 67? | 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
)
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.diagnosis = "LEFT COLON CANCER" AND demographic.age < "67" | 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: provide the number of patients whose primary disease is left colon cancer and age is less than 67? ### Input: 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
)
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.diagnosis = "LEFT COLON CANCER" AND demographic.age < "67" |
What is the smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million? | CREATE TABLE table_name_67 (
share INTEGER,
viewers__m_ VARCHAR,
timeslot_rank VARCHAR
) | SELECT MIN(share) FROM table_name_67 WHERE viewers__m_ < 8.78 AND timeslot_rank < 4 | 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 smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million? ### Input: CREATE TABLE table_name_67 (
share INTEGER,
viewers__m_ VARCHAR,
timeslot_rank VARCHAR
) ### Response: SELECT MIN(share) FROM table_name_67 WHERE viewers__m_ < 8.78 AND timeslot_rank < 4 |
What surface was played on with a score of 6 4, 6 3 and on 4 May 1992? | CREATE TABLE table_41299 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent in the final" text,
"Score" text
) | SELECT "Surface" FROM table_41299 WHERE "Score" = '6–4, 6–3' AND "Date" = '4 may 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: What surface was played on with a score of 6 4, 6 3 and on 4 May 1992? ### Input: CREATE TABLE table_41299 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent in the final" text,
"Score" text
) ### Response: SELECT "Surface" FROM table_41299 WHERE "Score" = '6–4, 6–3' AND "Date" = '4 may 1992' |
Average Accepted Answer Score by Question Score for Users Like Me. | CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 VoteTypes (
Id number,
Name 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description 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 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE CloseReasonTypes (
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
) | SELECT Questions.Score AS QuestionScore, AVG(Answers.Score) AS AnswerScore FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS Answers ON Answers.Id = Questions.AcceptedAnswerId WHERE Questions.Score BETWEEN 1 AND 20 AND Tags.TagName IN ('javascript', 'css', 'html', 'css3', 'html5') AND Answers.OwnerUserId = 918414 GROUP BY Questions.Score | 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: Average Accepted Answer Score by Question Score for Users Like Me. ### Input: CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description 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 FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 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 SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId 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 VoteTypes (
Id number,
Name 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 PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description 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 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE CloseReasonTypes (
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 ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
) ### Response: SELECT Questions.Score AS QuestionScore, AVG(Answers.Score) AS AnswerScore FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts AS Answers ON Answers.Id = Questions.AcceptedAnswerId WHERE Questions.Score BETWEEN 1 AND 20 AND Tags.TagName IN ('javascript', 'css', 'html', 'css3', 'html5') AND Answers.OwnerUserId = 918414 GROUP BY Questions.Score |
WHAT IS THE MANUFACTURER WITH 24 LAPS, AND +1.965 TIME/RETIRED? | CREATE TABLE table_47681 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | SELECT "Manufacturer" FROM table_47681 WHERE "Laps" = '24' AND "Time/Retired" = '+1.965' | 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 MANUFACTURER WITH 24 LAPS, AND +1.965 TIME/RETIRED? ### Input: CREATE TABLE table_47681 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) ### Response: SELECT "Manufacturer" FROM table_47681 WHERE "Laps" = '24' AND "Time/Retired" = '+1.965' |
in what year was the last design of passenger baseplates for vehicle registration issued in vermont ? | CREATE TABLE table_203_498 (
id number,
"first issued" text,
"design" text,
"slogan" text,
"serial format" text,
"serials issued" text,
"notes" text
) | SELECT MAX("first issued") FROM table_203_498 | 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: in what year was the last design of passenger baseplates for vehicle registration issued in vermont ? ### Input: CREATE TABLE table_203_498 (
id number,
"first issued" text,
"design" text,
"slogan" text,
"serial format" text,
"serials issued" text,
"notes" text
) ### Response: SELECT MAX("first issued") FROM table_203_498 |
What day was the oppenent the detroit lions? | CREATE TABLE table_19500 (
"Week" real,
"Date" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | SELECT "Date" FROM table_19500 WHERE "Opponent" = 'Detroit Lions' | 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 day was the oppenent the detroit lions? ### Input: CREATE TABLE table_19500 (
"Week" real,
"Date" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) ### Response: SELECT "Date" FROM table_19500 WHERE "Opponent" = 'Detroit Lions' |
What is the market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart. | CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
) | SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion | 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: What is the market value of every comapny in the banking industry ordered by sales and profits? Return a bar chart. ### Input: CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
) ### Response: SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion |
tell me the name of the last specimen test patient 26612 had received in 12/2102? | CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE 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 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 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 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 d_labitems (
row_id number,
itemid number,
label text
)
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_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
) | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2102-12' ORDER BY microbiologyevents.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: tell me the name of the last specimen test patient 26612 had received in 12/2102? ### Input: CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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 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 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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE 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 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 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 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 d_labitems (
row_id number,
itemid number,
label text
)
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_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y-%m', microbiologyevents.charttime) = '2102-12' ORDER BY microbiologyevents.charttime DESC LIMIT 1 |
what are the new prescriptions today of patient 006-47576 compared to the prescriptions yesterday? | 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 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 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day') | 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 are the new prescriptions today of patient 006-47576 compared to the prescriptions yesterday? ### Input: 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 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 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 cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
) ### Response: SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-47576') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day') |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of code , and group by attribute founder, show by the X from high to low please. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder 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: For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of code , and group by attribute founder, show by the X from high to low please. ### Input: CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) ### Response: SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and price , and group by attribute headquarter, and rank y-axis from low to high order please. | CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price | 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: For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and price , and group by attribute headquarter, and rank y-axis from low to high order please. ### Input: CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) ### Response: SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Price |
When was the game that ended with a score of 6-4? | CREATE TABLE table_name_38 (
date VARCHAR,
score VARCHAR
) | SELECT date FROM table_name_38 WHERE score = "6-4" | 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 was the game that ended with a score of 6-4? ### Input: CREATE TABLE table_name_38 (
date VARCHAR,
score VARCHAR
) ### Response: SELECT date FROM table_name_38 WHERE score = "6-4" |
How many goals were scored by Eugene Galekovi ? | CREATE TABLE table_name_54 (
goals VARCHAR,
player VARCHAR
) | SELECT goals FROM table_name_54 WHERE player = "eugene galeković" | 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 goals were scored by Eugene Galekovi ? ### Input: CREATE TABLE table_name_54 (
goals VARCHAR,
player VARCHAR
) ### Response: SELECT goals FROM table_name_54 WHERE player = "eugene galeković" |
Plot total number of memory in g by grouped by carrier as a bar graph, display by the sum memory in g in asc. | CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
) | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) | 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: Plot total number of memory in g by grouped by carrier as a bar graph, display by the sum memory in g in asc. ### Input: CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
) ### Response: SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) |
Which Source has a Remainder of 15%, and a Topinka of 26%? | CREATE TABLE table_75308 (
"Source" text,
"Date" text,
"Blagojevich (D)" text,
"Topinka (R)" text,
"Remainder" text
) | SELECT "Source" FROM table_75308 WHERE "Remainder" = '15%' AND "Topinka (R)" = '26%' | 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 Source has a Remainder of 15%, and a Topinka of 26%? ### Input: CREATE TABLE table_75308 (
"Source" text,
"Date" text,
"Blagojevich (D)" text,
"Topinka (R)" text,
"Remainder" text
) ### Response: SELECT "Source" FROM table_75308 WHERE "Remainder" = '15%' AND "Topinka (R)" = '26%' |
What is the date of the Cubs game when the Cubs had a record of 1-0? | CREATE TABLE table_name_2 (
date VARCHAR,
record VARCHAR
) | SELECT date FROM table_name_2 WHERE record = "1-0" | 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 date of the Cubs game when the Cubs had a record of 1-0? ### Input: CREATE TABLE table_name_2 (
date VARCHAR,
record VARCHAR
) ### Response: SELECT date FROM table_name_2 WHERE record = "1-0" |
give the number of patients whose drug code is phen10i and lab test category is blood gas. | 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 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
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "PHEN10I" AND lab."CATEGORY" = "Blood Gas" | 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 the number of patients whose drug code is phen10i and lab test category is blood gas. ### 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 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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "PHEN10I" AND lab."CATEGORY" = "Blood Gas" |
How many patients were admitted with pure hyperglyceridemia before 2187? | 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
)
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2187" AND diagnoses.long_title = "Pure hyperglyceridemia" | 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 were admitted with pure hyperglyceridemia before 2187? ### Input: 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
)
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2187" AND diagnoses.long_title = "Pure hyperglyceridemia" |
What is the name of the artist that issued the single on 23 February? | CREATE TABLE table_9850 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" text,
"Song" text,
"Artist" text
) | SELECT "Artist" FROM table_9850 WHERE "Issue Date(s)" = '23 february' | 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 name of the artist that issued the single on 23 February? ### Input: CREATE TABLE table_9850 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" text,
"Song" text,
"Artist" text
) ### Response: SELECT "Artist" FROM table_9850 WHERE "Issue Date(s)" = '23 february' |
What is the result of the game on April 17 against Los Angeles? | CREATE TABLE table_8232 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | SELECT "Result" FROM table_8232 WHERE "Road Team" = 'los angeles' AND "Date" = 'april 17' | 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 result of the game on April 17 against Los Angeles? ### Input: CREATE TABLE table_8232 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) ### Response: SELECT "Result" FROM table_8232 WHERE "Road Team" = 'los angeles' AND "Date" = 'april 17' |
List the record from the game where Wildcats had 48 points. | CREATE TABLE table_24561550_1 (
record VARCHAR,
wildcats_points VARCHAR
) | SELECT record FROM table_24561550_1 WHERE wildcats_points = 48 | 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: List the record from the game where Wildcats had 48 points. ### Input: CREATE TABLE table_24561550_1 (
record VARCHAR,
wildcats_points VARCHAR
) ### Response: SELECT record FROM table_24561550_1 WHERE wildcats_points = 48 |
show me the flights from PHILADELPHIA to DALLAS with 1 stop | 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 month (
month_number int,
month_name text
)
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 compartment_class (
compartment varchar,
class_type varchar
)
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 airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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 code_description (
code varchar,
description text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
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 days (
days_code varchar,
day_name 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 dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description 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 = 'DALLAS' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' 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 the flights from PHILADELPHIA to DALLAS with 1 stop ### Input: 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 month (
month_number int,
month_name text
)
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 compartment_class (
compartment varchar,
class_type varchar
)
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 airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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 code_description (
code varchar,
description text
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
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 days (
days_code varchar,
day_name 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 dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description 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 = 'DALLAS' AND flight.stops = 1 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code |
Show all card type codes and the number of cards in each type. | CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
) | SELECT card_type_code, COUNT(*) FROM customers_cards GROUP BY card_type_code | 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: Show all card type codes and the number of cards in each type. ### Input: CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
card_number text,
date_valid_from time,
date_valid_to time,
other_card_details text
)
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
) ### Response: SELECT card_type_code, COUNT(*) FROM customers_cards GROUP BY card_type_code |
Name the song choice for michael jackson | CREATE TABLE table_23048 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | SELECT "Song choice" FROM table_23048 WHERE "Original artist" = 'Michael Jackson' | 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 song choice for michael jackson ### Input: CREATE TABLE table_23048 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) ### Response: SELECT "Song choice" FROM table_23048 WHERE "Original artist" = 'Michael Jackson' |
How many points did the ESC Riverrats Geretsried, who lost more than 3 games, score? | CREATE TABLE table_name_17 (
points INTEGER,
lost VARCHAR,
name VARCHAR
) | SELECT SUM(points) FROM table_name_17 WHERE lost > 3 AND name = "esc riverrats geretsried" | 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 ESC Riverrats Geretsried, who lost more than 3 games, score? ### Input: CREATE TABLE table_name_17 (
points INTEGER,
lost VARCHAR,
name VARCHAR
) ### Response: SELECT SUM(points) FROM table_name_17 WHERE lost > 3 AND name = "esc riverrats geretsried" |
How big was the crowd when the away team was Richmond? | CREATE TABLE table_name_4 (
crowd VARCHAR,
away_team VARCHAR
) | SELECT crowd FROM table_name_4 WHERE away_team = "richmond" | 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 big was the crowd when the away team was Richmond? ### Input: CREATE TABLE table_name_4 (
crowd VARCHAR,
away_team VARCHAR
) ### Response: SELECT crowd FROM table_name_4 WHERE away_team = "richmond" |
Name the cyrillic name for melenci | CREATE TABLE table_3334 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | SELECT "Cyrillic Name Other Names" FROM table_3334 WHERE "Settlement" = 'Melenci' | 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 cyrillic name for melenci ### Input: CREATE TABLE table_3334 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) ### Response: SELECT "Cyrillic Name Other Names" FROM table_3334 WHERE "Settlement" = 'Melenci' |
current alcohol abuse | CREATE TABLE table_train_185 (
"id" int,
"dyscrasia" bool,
"bleeding" int,
"panic_disorder" bool,
"renal_disease" bool,
"anxiety" bool,
"creatinine_clearance_cl" float,
"alcohol_abuse" bool,
"retinopathy" bool,
"NOUSE" float
) | SELECT * FROM table_train_185 WHERE alcohol_abuse = 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: current alcohol abuse ### Input: CREATE TABLE table_train_185 (
"id" int,
"dyscrasia" bool,
"bleeding" int,
"panic_disorder" bool,
"renal_disease" bool,
"anxiety" bool,
"creatinine_clearance_cl" float,
"alcohol_abuse" bool,
"retinopathy" bool,
"NOUSE" float
) ### Response: SELECT * FROM table_train_185 WHERE alcohol_abuse = 1 |
For week number of the top 40, what was the results? | CREATE TABLE table_22736523_1 (
result VARCHAR,
week__number VARCHAR
) | SELECT result FROM table_22736523_1 WHERE week__number = "Top 40" | 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 week number of the top 40, what was the results? ### Input: CREATE TABLE table_22736523_1 (
result VARCHAR,
week__number VARCHAR
) ### Response: SELECT result FROM table_22736523_1 WHERE week__number = "Top 40" |
Number of posts in past 30 days. | CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
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 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 VoteTypes (
Id number,
Name 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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 ReviewTaskTypes (
Id number,
Name text,
Description 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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 PostTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
) | SELECT COUNT(*) FROM Posts WHERE PostTypeId IN (1, 2) AND CreationDate >= DATEADD(DAY, -30, GETDATE()) | 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: Number of posts in past 30 days. ### Input: CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
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 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 VoteTypes (
Id number,
Name 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 Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
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 ReviewTaskTypes (
Id number,
Name text,
Description 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 ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment 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 ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId 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 PostTypes (
Id number,
Name text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress 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 ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
) ### Response: SELECT COUNT(*) FROM Posts WHERE PostTypeId IN (1, 2) AND CreationDate >= DATEADD(DAY, -30, GETDATE()) |
What are the age groups for the Big League World Series? | CREATE TABLE table_name_26 (
age_groups VARCHAR,
competition_name VARCHAR
) | SELECT age_groups FROM table_name_26 WHERE competition_name = "big league world series" | 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 are the age groups for the Big League World Series? ### Input: CREATE TABLE table_name_26 (
age_groups VARCHAR,
competition_name VARCHAR
) ### Response: SELECT age_groups FROM table_name_26 WHERE competition_name = "big league world series" |
What is the money with a Score of 76-70-75-72=293? | CREATE TABLE table_58997 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( \u00a3 )" text
) | SELECT "Money ( \u00a3 )" FROM table_58997 WHERE "Score" = '76-70-75-72=293' | 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 money with a Score of 76-70-75-72=293? ### Input: CREATE TABLE table_58997 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( \u00a3 )" text
) ### Response: SELECT "Money ( \u00a3 )" FROM table_58997 WHERE "Score" = '76-70-75-72=293' |
give me the number of patients whose language is cape and age is less than 67? | 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
)
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
) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.age < "67" | 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 language is cape and age is less than 67? ### Input: 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
)
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
) ### Response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.age < "67" |
Which year has an Organization of new york yankees, and a Team of johnson city yankees? | CREATE TABLE table_name_61 (
year VARCHAR,
organization VARCHAR,
team VARCHAR
) | SELECT year FROM table_name_61 WHERE organization = "new york yankees" AND team = "johnson city yankees" | 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 year has an Organization of new york yankees, and a Team of johnson city yankees? ### Input: CREATE TABLE table_name_61 (
year VARCHAR,
organization VARCHAR,
team VARCHAR
) ### Response: SELECT year FROM table_name_61 WHERE organization = "new york yankees" AND team = "johnson city yankees" |
calculate the minimum age of patients who are 83 years of age or older and were hospitalized for 43 days. | 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 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
) | SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "83" AND demographic.days_stay = "43" | 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: calculate the minimum age of patients who are 83 years of age or older and were hospitalized for 43 days. ### Input: 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 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
) ### Response: SELECT MIN(demographic.age) FROM demographic WHERE demographic.age >= "83" AND demographic.days_stay = "43" |
What are the names of storms that did not affect two or more regions? | CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
) | SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 | 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 are the names of storms that did not affect two or more regions? ### Input: CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
) ### Response: SELECT name FROM storm EXCEPT SELECT T1.name FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id HAVING COUNT(*) >= 2 |
What is the average pick of player paul maclean, who had a draft before 1978? | CREATE TABLE table_12802 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
) | SELECT AVG("Pick") FROM table_12802 WHERE "Player" = 'paul maclean' AND "Draft" < '1978' | 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 average pick of player paul maclean, who had a draft before 1978? ### Input: CREATE TABLE table_12802 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text
) ### Response: SELECT AVG("Pick") FROM table_12802 WHERE "Player" = 'paul maclean' AND "Draft" < '1978' |
Name the class for boten | CREATE TABLE table_1745843_9 (
class VARCHAR,
part_3 VARCHAR
) | SELECT class FROM table_1745843_9 WHERE part_3 = "boten" | 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 class for boten ### Input: CREATE TABLE table_1745843_9 (
class VARCHAR,
part_3 VARCHAR
) ### Response: SELECT class FROM table_1745843_9 WHERE part_3 = "boten" |
Name the segment 1 for episode # 2/225 | CREATE TABLE table_26635 (
"Episode #" text,
"Segment 1" text,
"Segment 2" text,
"Original airdate" text,
"Lessons taught" text
) | SELECT "Segment 1" FROM table_26635 WHERE "Episode #" = '2/225' | 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 segment 1 for episode # 2/225 ### Input: CREATE TABLE table_26635 (
"Episode #" text,
"Segment 1" text,
"Segment 2" text,
"Original airdate" text,
"Lessons taught" text
) ### Response: SELECT "Segment 1" FROM table_26635 WHERE "Episode #" = '2/225' |
Find retaggable AS questions that are open or don't roomba. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
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
)
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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
) | SELECT Id AS "post_link", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000 | 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: Find retaggable AS questions that are open or don't roomba. ### Input: CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId 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 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 Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
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
)
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 PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
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 PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
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 PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
) ### Response: SELECT Id AS "post_link", Body, Tags, Score, AnswerCount, CommentCount FROM Posts WHERE PostTypeId = 1 AND ((Score <= 0 AND AnswerCount > 0 AND (AcceptedAnswerId = NULL OR AcceptedAnswerId > 0)) OR (Score = 0 AND CommentCount > 0) OR (Score > 0)) ORDER BY CreationDate DESC LIMIT 1000 |
what are the four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104? | 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 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 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 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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 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
) | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '29-30 comp wks gestation') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104') 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.spec_type_desc) AS t3 WHERE t3.c1 <= 4 | 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 are the four most frequent specimen tests that patients had within the same month after having been diagnosed with 29-30 comp wks gestation until 2104? ### Input: 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 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 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 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
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 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
) ### Response: SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = '29-30 comp wks gestation') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104') AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2104') 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.spec_type_desc) AS t3 WHERE t3.c1 <= 4 |
Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494? | CREATE TABLE table_name_12 (
director VARCHAR,
release_date VARCHAR,
series VARCHAR,
production_num VARCHAR
) | SELECT director FROM table_name_12 WHERE series = "mm" AND production_num < 6494 AND release_date = "1934-09-15" | 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: Who was the director of the movie having a release date of 1934-09-15, an MM Series and a production number less than 6494? ### Input: CREATE TABLE table_name_12 (
director VARCHAR,
release_date VARCHAR,
series VARCHAR,
production_num VARCHAR
) ### Response: SELECT director FROM table_name_12 WHERE series = "mm" AND production_num < 6494 AND release_date = "1934-09-15" |
Which Pick # is the highest one that has a Name of william middleton, and a Round larger than 5? | CREATE TABLE table_name_32 (
pick__number INTEGER,
name VARCHAR,
round VARCHAR
) | SELECT MAX(pick__number) FROM table_name_32 WHERE name = "william middleton" AND round > 5 | 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 # is the highest one that has a Name of william middleton, and a Round larger than 5? ### Input: CREATE TABLE table_name_32 (
pick__number INTEGER,
name VARCHAR,
round VARCHAR
) ### Response: SELECT MAX(pick__number) FROM table_name_32 WHERE name = "william middleton" AND round > 5 |
count the number of patients who have had a remove fb from periton procedure performed two or more times since 2104. | CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 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_items (
row_id number,
itemid number,
label text,
linksto 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 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 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 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 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
) | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = 'remove fb from periton') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2 | 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 patients who have had a remove fb from periton procedure performed two or more times since 2104. ### Input: CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom 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 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_items (
row_id number,
itemid number,
label text,
linksto 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 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 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 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 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
) ### Response: SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 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 = 'remove fb from periton') AND STRFTIME('%y', procedures_icd.charttime) >= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2 |
Which Fictional narrator has a Published as serial of february july 1912, all-story? | CREATE TABLE table_14163 (
"Order" real,
"Published as serial" text,
"Published as novel" text,
"Fictional narrator" text,
"Year in novel" text
) | SELECT "Fictional narrator" FROM table_14163 WHERE "Published as serial" = 'february–july 1912, all-story' | 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 Fictional narrator has a Published as serial of february july 1912, all-story? ### Input: CREATE TABLE table_14163 (
"Order" real,
"Published as serial" text,
"Published as novel" text,
"Fictional narrator" text,
"Year in novel" text
) ### Response: SELECT "Fictional narrator" FROM table_14163 WHERE "Published as serial" = 'february–july 1912, all-story' |
Would EEB 412 qualify for ULCS ? | CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
) | SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%' | advising | 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: Would EEB 412 qualify for ULCS ? ### Input: CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_project varchar,
has_final_exam varchar,
textbook varchar,
class_address varchar,
allow_audit varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_projects varchar,
has_exams varchar,
num_reviews int,
clarity_score int,
easiness_score int,
helpfulness_score int
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments int,
respected int,
participation int,
heavy_reading int,
tough_grader int,
hilarious int,
would_take_again int,
good_lecture int,
no_skip int
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
) ### Response: SELECT COUNT(*) > 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EEB' AND course.number = 412 AND program_course.category LIKE '%ULCS%' |
Which time/retired has a qual of 144.02? | CREATE TABLE table_name_75 (
time_retired VARCHAR,
qual VARCHAR
) | SELECT time_retired FROM table_name_75 WHERE qual = 144.02 | 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 time/retired has a qual of 144.02? ### Input: CREATE TABLE table_name_75 (
time_retired VARCHAR,
qual VARCHAR
) ### Response: SELECT time_retired FROM table_name_75 WHERE qual = 144.02 |
did patient 030-6441 have a wound care procedure at other hospitals? | 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 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 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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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
) | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'wound care' | 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: did patient 030-6441 have a wound care procedure at other hospitals? ### Input: 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 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 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 lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
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
) ### Response: SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '030-6441' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentname = 'wound care' |
count the number of patients who until 4 years ago have been prescribed acd-a for crrt. | 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value 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
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
) | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')) | 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 patients who until 4 years ago have been prescribed acd-a for crrt. ### Input: 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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost 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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value 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
)
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 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_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'acd-a for crrt' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')) |
In season is 2008 09, how many wins did they have? | CREATE TABLE table_23959 (
"Season" text,
"GP" real,
"W (OT/SO)" text,
"L (OT/SO)" text,
"Pts" real,
"Pts/GP" text,
"GF \u2013 GA" text,
"Rank (league/conference)" text,
"Top Scorer" text
) | SELECT "W (OT/SO)" FROM table_23959 WHERE "Season" = '2008–09' | 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: In season is 2008 09, how many wins did they have? ### Input: CREATE TABLE table_23959 (
"Season" text,
"GP" real,
"W (OT/SO)" text,
"L (OT/SO)" text,
"Pts" real,
"Pts/GP" text,
"GF \u2013 GA" text,
"Rank (league/conference)" text,
"Top Scorer" text
) ### Response: SELECT "W (OT/SO)" FROM table_23959 WHERE "Season" = '2008–09' |
How many people scored the most points during the game on December 10? | CREATE TABLE table_27756014_6 (
high_points VARCHAR,
date VARCHAR
) | SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = "December 10" | 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 people scored the most points during the game on December 10? ### Input: CREATE TABLE table_27756014_6 (
high_points VARCHAR,
date VARCHAR
) ### Response: SELECT COUNT(high_points) FROM table_27756014_6 WHERE date = "December 10" |
For the match with a home team score of 11.14 (80), what was the venue? | CREATE TABLE table_33317 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (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: For the match with a home team score of 11.14 (80), what was the venue? ### Input: CREATE TABLE table_33317 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) ### Response: SELECT "Venue" FROM table_33317 WHERE "Home team score" = '11.14 (80)' |
How many positions are there for RB1 Motorsports? | CREATE TABLE table_3588 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | SELECT COUNT("Position") FROM table_3588 WHERE "Team(s)" = 'RB1 Motorsports' | 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 positions are there for RB1 Motorsports? ### Input: CREATE TABLE table_3588 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) ### Response: SELECT COUNT("Position") FROM table_3588 WHERE "Team(s)" = 'RB1 Motorsports' |
what is minimum days of hospital stay of patients whose age is greater than or equal to 41? | 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 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41" | 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 minimum days of hospital stay of patients whose age is greater than or equal to 41? ### 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 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
) ### Response: SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "41" |
Who is every high points for the Pistons team? | CREATE TABLE table_23248910_9 (
high_points VARCHAR,
team VARCHAR
) | SELECT high_points FROM table_23248910_9 WHERE team = "Pistons" | 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: Who is every high points for the Pistons team? ### Input: CREATE TABLE table_23248910_9 (
high_points VARCHAR,
team VARCHAR
) ### Response: SELECT high_points FROM table_23248910_9 WHERE team = "Pistons" |