Second-level shelves

Second-level shelves

You are a catalog analyst at a large marketplace. Product categories form a tree: every category may have a parent, root sections have none. The storefront team is redesigning the 'Electronics' section page and needs the list of its DIRECT subcategories only — grandchildren and deeper levels must not appear, they get their own pages. Table categories: id, name, parent_id (NULL for root sections). The section is named exactly 'Electronics'. Return columns: - subcategory_name — name of a direct subcategory of 'Electronics' (text, as stored). Sort by subcategory_name ascending. Categories of other sections and anything deeper than one level below 'Electronics' are excluded. Direct children have unique names.

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.

subcategory_name
Audio
Cameras
Laptops
PostgreSQLv16
Entre para enviar

O resultado da sua consulta aparecerá aqui

Focus radio
Paused · SomaFM · Fluid