Caris Life Sciences uses molecular and clinical diagnosis data to monitor trends across its patient population. Write a PostgreSQL query that identifies the three most common diagnoses by distinct patient count for each month.
diagnosis_events to patient_registry and include only events for registered patients.| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_code | VARCHAR(20) | Caris patient reference code |
| sex | VARCHAR(20) | Recorded patient sex |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique diagnosis event identifier |
| patient_id | INT | References patient_registry.patient_id |
| diagnosis_name | VARCHAR(100) | Diagnosis or biomarker-associated condition |
| diagnosed_at | DATE | Date of diagnosis event |