#1063

Guest-Safe Order Label

Each order needs a Russian text label in the form Заказ N пользователя U. If user_id is missing, the user part of the label must be гость. Return id and label, sorted by 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.

idlabel
10Заказ 10 пользователя 1
11Заказ 11 пользователя 1
12Заказ 12 пользователя 2

Your query result will appear here