Categories Without Their Own Products
MediumDescription
Find the categories that no product belongs to directly. Show category_id,
category_name and has_subcategories: true when another category has it as its parent,
otherwise false.
End your query with ORDER BY category_id.
Tables
| categories |
|---|
| category_id (PK) |
| category_name |
| parent_category_id (FK) |
| products |
|---|
| product_id (PK) |
| category_id (FK) |