Given two tables, patients and visits, write a SQL query to calculate the total number of visits per patient and rank them by visit count for Evernorth Health Services. Include patients with no visits, assign tied visit counts the same rank, and use patient ID as the final ordering tie-breaker.
patient_id, patient_name, total_visits, and visit_rank.total_visits descending, then patient_id ascending.| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_name | VARCHAR(120) | Patient full name |
| Column | Type | Description |
|---|---|---|
| visit_idPK | INT | Unique visit identifier |
| patient_id | INT | Patient associated with the visit |
| visit_date | DATE | Date of the visit |