Tell me about your experience writing nested queries and subqueries in SQL.
For a hands-on response, write a PostgreSQL query that returns providers whose completed appointment count is greater than the average completed appointment count across all providers, including providers with zero completed appointments. Appointments with a NULL status do not count as completed.
provider_id, provider_name, and completed_appointment_count.provider_id ascending.| Column | Type | Description |
|---|---|---|
| provider_idPK | INT | Unique provider identifier |
| provider_name | VARCHAR(100) | Provider display name |
| Column | Type | Description |
|---|---|---|
| appointment_idPK | INT | Unique appointment identifier |
| provider_id | INT | Provider assigned to the appointment |
| status | VARCHAR(30) | Appointment status |