A menu without shouting or whispering
A menu without shouting or whispering
You are a data analyst at a chain of city cafes. Menu items were entered over the years by different managers: some typed dish names in ALL CAPS, some in lowercase, and categories are just as inconsistent. Marketing is launching a unified digital menu and wants the storefront brought to one style: dish names with each word capitalized, categories in lowercase, and the internal item code in uppercase to match the accounting system.
Return columns:
- item_id — menu item id (integer);
- dish_display — dish name where every word starts with a capital letter and the rest are lowercase;
- category_norm — category in lowercase; if the category is missing (NULL), keep NULL;
- code_norm — item code in uppercase.
Sorting: by item_id ascending. Return every row of the table, including items with no category.
Exemplo de resposta esperada
É assim que se parece uma resposta correta: ela tem seu próprio número de linhas e não precisa coincidir com as tabelas do esquema. Sua resposta precisa retornar os mesmos nomes de colunas do exemplo: use AS para renomeá-las se for preciso.
| item_id | dish_display | category_norm | code_norm |
|---|---|---|---|
| 1 | Caesar Salad | starters | HRC-001 |
| 2 | Margherita Pizza | mains | HRC-002 |
| 3 | Tiramisu | desserts | HRC-003 |
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
Entrar