Product Catalog with Category
What products does Microsoft offer and what category does each belong to?
- Sorting
Challenge brief
Understand the request
Product Management needs a full product catalog view including category classification for an internal product overview slide.
List all products with product_id, product_name, and category.
Return
- product_id
- product_name
- category
Constraints
- Return every catalog product
- Order by category and product ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
products
product_idINTEGERproduct_nameTEXTcategoryTEXT
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All data is in products. SELECT three columns and ORDER BY category alphabetically. No JOIN, no filter.
Hint 2
SELECT product_id, product_name, category FROM products ORDER BY category.
Hint 3
Build question 26 from the required result grain: choose the driving table, add only the joins and filters needed for that grain, then apply aggregation and deterministic ordering.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT product_id, product_name, category FROM products ORDER BY category, product_id;Why this works
Single-table SELECT with ORDER BY. Dynamics (Business) sorts before Azure (Cloud) alphabetically. Note: Dynamics has no subscriptions in the dataset so it appears only in this catalog question.
Success check
4 products — Business (Dynamics), Cloud (Azure), Collaboration (Teams), Productivity (Office)
Expected result
Use this output to verify values, aliases, ordering, and row count.
| product_id | product_name | category |
|---|---|---|
| 4 | Dynamics | Business |
| 2 | Azure | Cloud |
| 3 | Teams | Collaboration |
| 1 | Microsoft Office | Productivity |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Apple
Independent Apple-style product, retail, services, support, workforce, and device-usage SQL practice.
Google
Independent Google-style search, advertising, user-engagement, and video-product SQL practice.
Amazon
Independent Amazon-style e-commerce, warehouse, inventory, and customer analytics SQL practice.
Return to the complete interview preparation experience.