Product Inventory by Category
List all products in the Electronics category with their price and current stock quantity.
- Filtering
Challenge brief
Understand the request
Catalog Management needs to audit stock levels for a specific product line before the quarterly review.
List all products in the Electronics category with price and stock levels.
Return
- product_name
- price
- stock_quantity
Constraints
- Category filter must match exactly: Electronics (capital E)
- Only the three specified columns should appear
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
products
product_nameVARCHAR(200)categoryVARCHAR(100)priceREALstock_quantityINTEGER
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All the data you need is in a single table: products. The category column stores the product line as a text string.
Hint 2
Use WHERE category = and match the exact string from the data. Category names are case-sensitive — use Electronics with a capital E.
Hint 3
Scaffold: SELECT the requested catalog fields FROM products and complete an exact category equality predicate.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT product_name, price, stock_quantity FROM products WHERE category = 'Electronics';Why this works
A single-table SELECT with a string equality filter. The category column stores plain text, so the match must be exact — "Electronics" not "electronics". Four products qualify.
Success check
4 products — all Electronics items in the catalog
Expected result
Use this output to verify values, aliases, ordering, and row count.
| product_name | price | stock_quantity |
|---|---|---|
| Wireless Mouse | 29.99 | 500 |
| USB-C Cable | 12.99 | 1000 |
| Laptop Stand | 45.99 | 300 |
| Bluetooth Speaker | 59.99 | 250 |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Airbnb
Independent Airbnb-style marketplace, booking, listing, payment, review, and guest analytics SQL practice.
Uber
Independent Uber-style mobility marketplace SQL practice covering trips, drivers, riders, pricing, payments, and promotions.
Microsoft
Independent Microsoft-style cloud, productivity, subscription, usage, support, and customer analytics SQL practice.
Return to the complete interview preparation experience.