Your question is No Recorded Discharge Date. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Providence data analysts need to identify patients who remain open in an encounter extract because no discharge date has been recorded. Write a PostgreSQL query using the patient_encounters table.
discharge_date, including the patient ID, name, admission date, and care unit.A missing discharge date is represented by SQL NULL. Do not treat an empty string or a future discharge date as missing.
| Column | Type | Description |
|---|---|---|
| encounter_idPK | INTEGER | Unique encounter identifier |
| patient_id | INTEGER | Unique patient identifier |
| patient_name | VARCHAR(100) | Patient's display name |
| admission_date | DATE | Date the encounter began |
| discharge_date | DATE | Date of discharge, or NULL when not recorded |
| care_unit | VARCHAR(80) | Providence care unit for the encounter |