You're a catalog analyst at a major online marketplace. Product categories are organized as a tree: each category can have a parent, while root categories have none. The storefront team is redesigning the "Electronics" category page and needs a list of only its direct subcategories. Grandchildren and deeper levels must not appear because they'll have their own pages.
The categories table has id, name, and parent_id (NULL for root categories). The parent category is named exactly 'Electronics'.
Return these columns:
- subcategory_name — name of a direct subcategory of 'Electronics' (text, exactly as stored in the table).
Sort the result by subcategory_name in ascending alphabetical order. Exclude categories belonging to other parent categories and any categories deeper than the first level of nesting. There are no duplicate names among the direct children.
subcategory_nameShowing the first 3 rows of the sample — the full sample comes with Premium
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in