Guests at the End
Operators need a list of all orders: orders with higher user_id first, while guest orders without user_id must appear at the very end. For the same user_id, sort by ascending id. Return id and user_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 | user_id |
|---|---|
| 14 | 4 |
| 13 | 3 |
| 12 | 2 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in