input
stringlengths
1.31k
1.62k
output
stringlengths
54
483
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. find the number of patients whose insurance is self pay and lab test name is platelet count. Here are the relevant SQL tables: CREATE TABLE p...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Platelet Count"
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. what is the number of patients diagnosed with hamartoses nec who have been prescribed additive type drug? Here are the relevant SQL tables: C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hamartoses NEC" AND prescriptions.drug_type = "ADDITIVE"
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. give me the number of patients whose insurance is medicaid and primary disease is morbid obesity/sda? Here are the relevant SQL tables: CREAT...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "MORBID OBESITY/SDA"
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. provide the number of patients whose admission year is less than 2110 and diagnoses icd9 code is 7885? Here are the relevant SQL tables: CREA...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2110" AND diagnoses.icd9_code = "7885"
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. how many patients are diagnosed with human immuno virus dis and had their lab test show abnormal status? Here are the relevant SQL tables: CR...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Human immuno virus dis" AND lab.flag = "abnormal"
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. what is the number of patients whose drug name is nifedipine cr? Here are the relevant SQL tables: CREATE TABLE lab ( subject_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NIFEdipine CR"
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. how many patients stayed in hospital for more than 17 days and underwent right and left cardiac catheterization? Here are the relevant SQL ta...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "17" AND procedures.long_title = "Combined right and left heart cardiac catheterization"
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. Give the number of patients whose primary disease is cerebral aneurysm/sda and were admitted before the year 2200. Here are the relevant SQL ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" AND demographic.admityear < "2200"
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. Calculate the minimum age of unmarried patients who have pituitary bleed as their primary disease. Here are the relevant SQL tables: CREATE T...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "PITUITARY BLEED"
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. what is the number of patients whose insurance is private and procedure long title is other closed [endoscopic] biopsy of biliary duct or sph...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
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. what is drug name and drug route of drug code epo2i? Here are the relevant SQL tables: CREATE TABLE procedures ( subject_id text, had...
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "EPO2I"
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. what is the average age of female patients diagnosed primarily for celo-vessicle fistula? Here are the relevant SQL tables: CREATE TABLE demo...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CELO-VESSICLE FISTULA"
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. How many patients who had incision of vessel (aorta) have an unspecified death status? Here are the relevant SQL tables: CREATE TABLE diagnos...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Incision of vessel, aorta"
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. how many patients whose discharge location is left against medical advi and diagnoses short title is blood in stool? Here are the relevant SQ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND diagnoses.short_title = "Blood in stool"
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. how many single patients are of hispanic or latino-puertorican ethnicity? Here are the relevant SQL tables: CREATE TABLE demographic ( su...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN"
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. what is the number of patients whose language is engl and lab test name is creatine kinase, mb isoenzyme? Here are the relevant SQL tables: C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "ENGL" AND lab.label = "Creatine Kinase, MB Isoenzyme"
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. how many patients on elective admission had their epithelial cells tested by lab? Here are the relevant SQL tables: CREATE TABLE procedures (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Epithelial Cells"
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. find out the number of patients who have been prescribed neo*iv*ampicillin sodium. Here are the relevant SQL tables: CREATE TABLE diagnoses (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NEO*IV*AMPicillin Sodium"
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. what is minimum age of patients whose marital status is divorced and primary disease is posterior communicating aneurysm/sda? Here are the re...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
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. let me know the long title and icd9 code of diagnoses for patient with patient id 7273. Here are the relevant SQL tables: CREATE TABLE prescr...
SELECT diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "7273"
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. how many patients have a private insurance policy and whose icd9 code is 4610? Here are the relevant SQL tables: CREATE TABLE prescriptions (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "4610"
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. let me know the birth date and preferred language of patient james sloan. Here are the relevant SQL tables: CREATE TABLE prescriptions ( ...
SELECT demographic.dob, demographic.language FROM demographic WHERE demographic.name = "James Sloan"
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. how many patients whose admission year is less than 2146 and procedure long title is repair of fistula involving bladder and intestine? Here ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2146" AND procedures.long_title = "Repair of fistula involving bladder and intestine"
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. what is average days of hospital stay of patients whose primary disease is sternal wound infection? Here are the relevant SQL tables: CREATE ...
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "STERNAL WOUND INFECTION"
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. what is maximum age of patients whose insurance is medicaid and ethnicity is black/cape verdean? Here are the relevant SQL tables: CREATE TAB...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.ethnicity = "BLACK/CAPE VERDEAN"
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. what is admission time of subject name stephanie suchan? Here are the relevant SQL tables: CREATE TABLE prescriptions ( subject_id text, ...
SELECT demographic.admittime FROM demographic WHERE demographic.name = "Stephanie Suchan"
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. what is primary disease and procedure short title of subject id 4342? Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject_...
SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4342"
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. find out if the patient jerry deberry is still alive. Here are the relevant SQL tables: CREATE TABLE lab ( subject_id text, hadm_id t...
SELECT demographic.expire_flag FROM demographic WHERE demographic.name = "Jerry Deberry"
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. provide the number of patients having catheter based invasive electrophysiologic testing and whose admission type is elective. Here are the r...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Catheter based invasive electrophysiologic testing"
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. give me the number of patients whose admission type is emergency and procedure short title is vaccination nec? Here are the relevant SQL tabl...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Vaccination NEC"
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. tell me the age and health insurance of patient with patient id 17595. Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject...
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "17595"
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. provide the number of patients whose procedure short title is percutan liver aspirat? Here are the relevant SQL tables: CREATE TABLE demograp...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Percutan liver aspirat"
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. give the primary disease and procedure icd9 code for subject id 18077. Here are the relevant SQL tables: CREATE TABLE procedures ( subjec...
SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18077"
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. what is diagnoses long title of subject id 3343? Here are the relevant SQL tables: CREATE TABLE prescriptions ( subject_id text, hadm...
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "3343"
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. for icd9 code 29690, specify the diagnosis short title. Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject_id text, h...
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.icd9_code = "29690"
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. how many patients whose drug name is milrinone? Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Milrinone"
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. count the number of patients whose discharge location is dead/expired and age is less than 41? Here are the relevant SQL tables: CREATE TABLE...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41"
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. how many patients are diagnosed with primary disease left colon cancer and are below age 76? Here are the relevant SQL tables: CREATE TABLE p...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.age < "76"
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. Count the number of patients less than 47 years who had a urine fluid lab test. Here are the relevant SQL tables: CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Urine"
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. what is the number of patients whose ethnicity is american indian/alaska native and year of birth is less than 2083? Here are the relevant SQ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.dob_year < "2083"
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. give me the number of patients whose age is less than 70 and procedure short title is arterial catheterization? Here are the relevant SQL tab...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "70" AND procedures.short_title = "Arterial catheterization"
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. Count the number of urgent hospital admission patients who have unspecified myelodysplastic syndrome diagnoses. Here are the relevant SQL tab...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Myelodysplastic synd NOS"
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. tell me the number of elective hospital admission patients who have been prescribed milk of magnesia. Here are the relevant SQL tables: CREAT...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Milk of Magnesia"
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. how many patients whose ethnicity is hispanic or latino and age is less than 48? Here are the relevant SQL tables: CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.age < "48"
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. how many patients with hypertension as the diagnosis short title had the drug route po/ng? Here are the relevant SQL tables: CREATE TABLE lab...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypertension NOS" AND prescriptions.route = "PO/NG"
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. count the number of patients whose year of death is less than or equal to 2126? Here are the relevant SQL tables: CREATE TABLE demographic ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2126.0"
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. what is the number of patients whose admission location is trsf within this facility and primary disease is pneumonia;human immunodefiency vi...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS"
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. how many patients whose days of hospital stay is greater than 3 and lab test fluid is cerebrospinal fluid (csf)? Here are the relevant SQL ta...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
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. let me know the lab test item id of patient stephanie suchan. Here are the relevant SQL tables: CREATE TABLE procedures ( subject_id text...
SELECT lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan"
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. count the number of patients whose admission type is elective and admission location is phys referral/normal deli? Here are the relevant SQL ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
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. what is drug dose of drug name ciprofloxacin hcl? Here are the relevant SQL tables: CREATE TABLE procedures ( subject_id text, hadm_i...
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ciprofloxacin HCl"
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. How many single patients had a diagnosis long title protal hypertension? Here are the relevant SQL tables: CREATE TABLE procedures ( subj...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Portal hypertension"
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. Give me location of admission and primary disease status of the patient with patient id 2560. Here are the relevant SQL tables: CREATE TABLE ...
SELECT demographic.admission_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
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. what is procedure long title of subject name charles deshay? Here are the relevant SQL tables: CREATE TABLE prescriptions ( subject_id te...
SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Charles Deshay"
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. how many patients aged less than 45 years speak the language port? Here are the relevant SQL tables: CREATE TABLE procedures ( subject_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.age < "45"
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. count the number of patients whose year of death is less than or equal to 2115 and procedure icd9 code is 4341? Here are the relevant SQL tab...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.icd9_code = "4341"
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. what number of patients having procedure titled coronar arteriogr-1 cath were born before 2182? Here are the relevant SQL tables: CREATE TABL...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2182" AND procedures.short_title = "Coronar arteriogr-1 cath"
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. give the number of patients whose marital status is widowed and procedure short title is nasal sinus dx proc nec. Here are the relevant SQL t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Nasal sinus dx proc NEC"
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. find the number of patients who died on or before 2174 and had other body fluid lab test. Here are the relevant SQL tables: CREATE TABLE proc...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2174.0" AND lab.fluid = "Other Body Fluid"
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. count the number of patients whose diagnoses short title is hx-rectal & anal malign and lab test category is blood gas? Here are the relevant...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Hx-rectal & anal malign" AND lab."CATEGORY" = "Blood Gas"
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. count the number of patients whose year of death is less than or equal to 2112 and drug code is hesp500i? Here are the relevant SQL tables: C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2112.0" AND prescriptions.formulary_drug_cd = "HESP500I"
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. what is average age of patients whose ethnicity is white and days of hospital stay is 3? Here are the relevant SQL tables: CREATE TABLE demog...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "3"
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. how many patients whose diagnoses short title is compl kidney transplant and drug route is replace? Here are the relevant SQL tables: CREATE ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Compl kidney transplant" AND prescriptions.route = "REPLACE"
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. Specify the drug code of Ferrous Sulfate along with the dose Here are the relevant SQL tables: CREATE TABLE procedures ( subject_id text,...
SELECT prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ferrous Sulfate"
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. how many spanish speaking patients are of jewish religious background? Here are the relevant SQL tables: CREATE TABLE procedures ( subjec...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "JEWISH"
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. provide the number of patients whose days of hospital stay is greater than 13 and procedure icd9 code is 4105? Here are the relevant SQL tabl...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "13" AND procedures.icd9_code = "4105"
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. How many patients were admitted to emergency before the year 2166? Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject_id ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2166"
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. how many patients below 24 years of age followed the procedure endoscopic removal of stone(s) from biliary tract? Here are the relevant SQL t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
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. what is the number of patients whose item id is 50971? Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject_id text, ha...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50971"
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. what is the number of patients whose primary disease is newborn and procedure icd9 code is 4311? Here are the relevant SQL tables: CREATE TAB...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND procedures.icd9_code = "4311"
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. what is the number of patients whose diagnoses long title is 29-30 completed weeks of gestation and lab test category is blood gas? Here are ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "29-30 completed weeks of gestation" AND lab."CATEGORY" = "Blood Gas"
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. provide the number of patients whose diagnoses long title is other preterm infants, 1,250-1,499 grams? Here are the relevant SQL tables: CREA...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other preterm infants, 1,250-1,499 grams"
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. what number of patients have primary disease named sdh and lab test fluid is cerebrospinal fluid (csf)? Here are the relevant SQL tables: CRE...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SDH" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
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. what is the gender and procedure long title of subject id 2560? Here are the relevant SQL tables: CREATE TABLE prescriptions ( subject_id...
SELECT demographic.gender, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
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. calculate the minimum age of female patients who are aged 20 years or more. Here are the relevant SQL tables: CREATE TABLE lab ( subject_...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "20"
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. let me know the type of admission and short title of diagnoses for patient with patient id 74032. Here are the relevant SQL tables: CREATE TA...
SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "74032"
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. how many patients are diagnosed with primary disease atrial fibrillation\thoracoscopic maze procedure bilateral/sda and died before 2115? Her...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.dod_year <= "2115.0"
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. give the number of patients whose primary disease is st-segment elevation myocardial infarction\cardiac cath and drug route is im Here are th...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IM"
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. how many patients whose marital status is divorced and lab test name is cholesterol, hdl? Here are the relevant SQL tables: CREATE TABLE proc...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Cholesterol, HDL"
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. How many patients with morbid obesity/sda primary disease had a csf lab test? Here are the relevant SQL tables: CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
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. what is admission type and admission location of subject name jerry deberry? Here are the relevant SQL tables: CREATE TABLE prescriptions ( ...
SELECT demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
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. how many patients of black/cape verdean ethnicity are born before 2184? Here are the relevant SQL tables: CREATE TABLE prescriptions ( su...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2184"
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. give me the number of patients with procedure icd9 code 966 who were admitted in hospital before 2138. Here are the relevant SQL tables: CREA...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.icd9_code = "966"
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. look for the route of drug administration and primary disease of patient marilyn norvell. Here are the relevant SQL tables: CREATE TABLE diag...
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
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. provide the number of patients whose diagnoses is crn ath atlg vn bps grft and lab test category is hematology. Here are the relevant SQL tab...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Crn ath atlg vn bps grft" AND lab."CATEGORY" = "Hematology"
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. what is the number of male patients who have ng route of drug administration? Here are the relevant SQL tables: CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.route = "NG"
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. what is age and insurance of subject id 42067? Here are the relevant SQL tables: CREATE TABLE lab ( subject_id text, hadm_id text, ...
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "42067"
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. how many office hospital admission patients had open and other sigmoidectomy? Here are the relevant SQL tables: CREATE TABLE demographic ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.short_title = "Open sigmoidectomy NEC"
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. how many patients of asian ethnicity are administered additive drug types? Here are the relevant SQL tables: CREATE TABLE diagnoses ( sub...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug_type = "ADDITIVE"
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. how many patients whose procedure long title is colonoscopy? Here are the relevant SQL tables: CREATE TABLE prescriptions ( subject_id te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Colonoscopy"
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. among patients diagnosed with fever in other diseases, how many of them were female? Here are the relevant SQL tables: CREATE TABLE procedure...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Fever in other diseases"
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. what is maximum age of patients whose gender is m and admission type is emergency? Here are the relevant SQL tables: CREATE TABLE lab ( s...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "EMERGENCY"
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. how many patients were born before the year 2041 and had 3761 as their procedure icd9 code? Here are the relevant SQL tables: CREATE TABLE di...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2041" AND procedures.icd9_code = "3761"
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. provide the number of patients whose drug code is levo500pm? Here are the relevant SQL tables: CREATE TABLE demographic ( subject_id text...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LEVO500PM"
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. let me know the number of patients born before 1882 who had delta abnormal lab test status. Here are the relevant SQL tables: CREATE TABLE la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1882" AND lab.flag = "delta"
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. tell me the number of patients with a diagnoses of full incontinence of feces who were admitted before the year 2154. Here are the relevant S...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Full incontinence-feces"
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. provide the number of patients whose discharge location is home health care and procedure short title is hemodialysis? Here are the relevant ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Hemodialysis"
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. what is the number of patients whose primary disease is s/p fall and lab test abnormal status is delta? Here are the relevant SQL tables: CRE...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.flag = "delta"
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. what is minimum days of hospital stay of patients whose year of birth is greater than 2065? Here are the relevant SQL tables: CREATE TABLE de...
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2065"
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. what is the primary disease and drug dose of subject id 18480? Here are the relevant SQL tables: CREATE TABLE diagnoses ( subject_id text...
SELECT demographic.diagnosis, prescriptions.drug_dose FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "18480"