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_iddish_displaycategory_normcode_norm
1Caesar SaladstartersHRC-001
2Margherita PizzamainsHRC-002
3TiramisudessertsHRC-003
PostgreSQLv16
Entre para enviar

O resultado da sua consulta aparecerá aqui

Focus radio
Paused · SomaFM · Fluid