Sort by a status priority, not alphabetically

SQLMedium12 min

Your task

List orders with paid first, then pending, then refunded, and within each group by id. Return id and status.

Tables

customer
idINTEGERnameTEXTcountryTEXTsigned_upTEXT
1AnkaDE2025-12-20
2BoUS2025-12-14
3CyUS2026-01-05
4DaraJP2026-02-01
orders
idINTEGERcustomer_idINTEGERplaced_onTEXTtotal_centsINTEGERstatusTEXT
112026-01-0412000paid
212026-01-193500refunded
322026-01-2189000paid
422026-02-0215000paid
532026-02-144200pending
622026-02-2822000paid
More rows not shown