1sf/bird-sql-train-with-schema huggingface dataset:
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: List the procedures received by Emmy Waelchi.
Evidence: procedures refer to DESCRIPTION from procedures;
SQL: SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Emmy' AND T1.last = 'Waelchi'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Provide the patients' full names who received the extraction of wisdom tooth.
Evidence: patient's full name refers to first, last; extraction of wisdom tooth refers to DESCRIPTION = 'Extraction of wisdom tooth' from procedures;
SQL: SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Extraction of wisdom tooth'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Provide the body weight of Elly Koss in every observation.
Evidence: body weight VALUE and UNITS where DESCRIPTION = 'Body Weight' from observations;
SQL: SELECT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.DESCRIPTION = 'Body Weight'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Name the patients who had an allergy to soy.
Evidence: allergy to soy refers to allergies where DESCRIPTION = 'Allergy to soya';
SQL: SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Allergy to soya'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: How many times did Keven Kuhn receive DTaP immunization?
Evidence: DTaP immunization refers to immunizations where DESCRIPTION = 'DTaP';
SQL: SELECT COUNT(T2.CODE) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.DESCRIPTION = 'DTaP'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Who had to take Clopidogrel 75 MG Oral Tablet for over 10 years?
Evidence: Who implies the full name of the patient which refers to first, last; Clopidogrel 75 MG Oral Tablet refers to medications where DESCRIPTION = 'Clopidogrel 75 MG Oral Tablet'; for over 10 years refers to SUBTRACT(strftime('%Y', STOP), strftime('%Y', START)) > 10;
SQL: SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Clopidogrel 75 MG Oral Tablet' AND strftime('%Y', T2.STOP) - strftime('%Y', T2.START) > 10
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Which procedures and medications were received by the patient with the third-degree burn?
Evidence: procedures refer to DESCRIPTION from procedures; medications refers to DESCRIPTION from medications; third-degree burn refers to conditions where DESCRIPTION = 'Third degree burn';
SQL: SELECT DISTINCT T1.DESCRIPTION, T3.DESCRIPTION FROM procedures AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT INNER JOIN medications AS T3 ON T2.patient = T3.PATIENT WHERE T2.DESCRIPTION = 'Third degree burn'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Provide medications received by patients with an allergy to mould on 6th June 2016.
Evidence: medications refers to DESCRIPTION from medications; allergy to mould refers to allergies where DESCRIPTION = 'Allergy to mould'; on 6th June 2016 refers to START = '6/6/16';
SQL: SELECT T2.DESCRIPTION FROM allergies AS T1 INNER JOIN medications AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.START = '6/6/16' AND T1.DESCRIPTION = 'Allergy to mould'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Describe the care plans received by the patient with secondary malignant neoplasm of the colon.
Evidence: care plans refer to DESCRIPTION from careplans; secondary malignant neoplasm of the colon refers to conditions where DESCRIPTION = 'Secondary malignant neoplasm of colon';
SQL: SELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Secondary malignant neoplasm of colon'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: What is the prevalence rate of the patients' diseases started on 9th May 2014?
Evidence: diseases started on 9th May 2014 refer to DESCRIPTION from conditions where START = '5/9/2014';
SQL: SELECT T2."PREVALENCE RATE" FROM conditions AS T1 INNER JOIN all_prevalences AS T2 ON lower(T1.DESCRIPTION) = lower(T2.ITEM) WHERE T1.START = '2014-05-09'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Among observations in 2011, provide the names and ages of patients whose Systolic Blood Pressures are 200mmHg.
Evidence: name implies the patient's full name which refers to first, last; age refers to deathdate is null then SUBTRACT(strftime('%Y', DATE), strftime('%Y', birthdate)); Systolic Blood Pressures are 200mmHg refers to DESCRIPTION = 'Systolic Blood Pressure' and VALUE = 200 and UNITS = 'mmHg' from observations; in 2011 refers to DATE like '2011%';
SQL: SELECT T2.first, T2.last , CASE WHEN T2.deathdate IS NULL THEN strftime('%Y', T1.DATE) - strftime('%Y', T2.birthdate) ELSE strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) END AS age FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Systolic Blood Pressure' AND T1.VALUE = 200 AND T1.UNITS = 'mmHg' AND strftime('%Y', T1.DATE) = '2011'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: Among the immunizations in 2017, calculate the percentage of patients who received the Influenza seasonal injectable preservative free. Among them, how many patients are English?
Evidence: DIVIDE(COUNT(PATIENT when DESCRIPTION = 'Influenza seasonal injectable preservative free'), COUNT(PATIENT)) as percentage where strftime('%Y', 2017); English refers ethnicity = 'english';
SQL: SELECT CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient), SUM(CASE WHEN T1.ethnicity = 'english' THEN 1 ELSE 0 END) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE strftime('%Y', T2.DATE) = '2017'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: List down the first name of patients who encountered normal pregnancy.
Evidence: encountered normal pregnancy refers to encounters where REASONDESCRIPTION = 'Normal pregnancy';
SQL: SELECT DISTINCT T1.first FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Normal pregnancy'
Database: synthea
Tables: all_prevalences, patients, encounters, allergies, careplans, conditions, immunizations, medications, observations, procedures, claims
Columns (table index, column name): -1, *, 0, ITEM, 0, POPULATION TYPE, 0, OCCURRENCES, 0, POPULATION COUNT, 0, PREVALENCE RATE, 0, PREVALENCE PERCENTAGE, 1, patient, 1, birthdate, 1, deathdate, 1, ssn, 1, drivers, 1, passport, 1, prefix, 1, first, 1, last, 1, suffix, 1, maiden, 1, marital, 1, race, 1, ethnicity, 1, gender, 1, birthplace, 1, address, 2, ID, 2, DATE, 2, PATIENT, 2, CODE, 2, DESCRIPTION, 2, REASONCODE, 2, REASONDESCRIPTION, 3, START, 3, STOP, 3, PATIENT, 3, ENCOUNTER, 3, CODE, 3, DESCRIPTION, 4, ID, 4, START, 4, STOP, 4, PATIENT, 4, ENCOUNTER, 4, CODE, 4, DESCRIPTION, 4, REASONCODE, 4, REASONDESCRIPTION, 5, START, 5, STOP, 5, PATIENT, 5, ENCOUNTER, 5, CODE, 5, DESCRIPTION, 6, DATE, 6, PATIENT, 6, ENCOUNTER, 6, CODE, 6, DESCRIPTION, 7, START, 7, STOP, 7, PATIENT, 7, ENCOUNTER, 7, CODE, 7, DESCRIPTION, 7, REASONCODE, 7, REASONDESCRIPTION, 8, DATE, 8, PATIENT, 8, ENCOUNTER, 8, CODE, 8, DESCRIPTION, 8, VALUE, 8, UNITS, 9, DATE, 9, PATIENT, 9, ENCOUNTER, 9, CODE, 9, DESCRIPTION, 9, REASONCODE, 9, REASONDESCRIPTION, 10, ID, 10, PATIENT, 10, BILLABLEPERIOD, 10, ORGANIZATION, 10, ENCOUNTER, 10, DIAGNOSIS, 10, TOTAL
Question: What are the birth date of patients who took outpatient encounter care plan?
Evidence: outpatient encounter care plan refers to careplans where DESCRIPTION = 'Outpatient Encounter';
SQL: SELECT DISTINCT T1.birthdate FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Outpatient Encounter'