Can you provide a code snippet that demonstrates your proficiency in SQL?
Provide a PostgreSQL query using the encounters table to summarize completed encounters by department. Include a count and the average length of stay.
department, encounter_count, and avg_length_of_stay_days.| Column | Type | Description |
|---|---|---|
| encounter_idPK | INTEGER | Unique encounter identifier |
| department | VARCHAR(50) | Department associated with the encounter |
| encounter_status | VARCHAR(20) | Current status of the encounter |
| length_of_stay_days | INTEGER | Length of stay measured in days |