Show every customer's order count
Support wants an order count next to every customer — to instantly tell regulars from those who just signed up. For each customer return id, name and the total number of their orders of any status (new customer — zero). Name the count column orders_count, sort by customer id.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| id | name | orders_count |
|---|---|---|
| 1 | Аня | 3 |
| 2 | Боб | 1 |
| 3 | Вера | 2 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid