
Products with no brand
easyProducts with no brand
Amazon SQL Interview Question
Amazon's catalog quality team wants to fix product listings that were added without a brand.
Identify every product with no brand, showing its product_id and product_name.
Asked of
- Data Analyst
- Business Analyst
- BI Analyst
- Product Analyst
- Analytics Engineer
- Data Engineer
- Data Scientist
- ML Engineer
- AI Engineer
productsTable15 rows
| Column Name | Type |
|---|---|
| product_id | BIGINT |
| product_name | VARCHAR |
| category | VARCHAR |
| brand | VARCHAR |
| price | DOUBLE |
| discount_pct | BIGINT |
| stock_quantity | BIGINT |
| launch_date | DATE |
| is_active | BOOLEAN |
productsExample Input
| product_id | product_name | category | brand | price | discount_pct | stock_quantity | launch_date | is_active |
|---|---|---|---|---|---|---|---|---|
| 5 | Ergonomic Chair Pro | Furniture | Steelcase | 1299 | 5 | 5 | 2021-06-30 | true |
| 6 | Desk Lamp | Furniture | NULL | 39.5 | NULL | 80 | 2024-01-15 | true |
| 7 | USB-C Hub | Electronics | Anker | 45 | 20 | 200 | 2023-03-22 | true |
| 8 | Notebook Set | Stationery | Moleskine | 18 | NULL | 0 | 2022-09-01 | false |
| 9 | Gel Pen Pack | Stationery | NULL | 6.99 | NULL | 500 | 2024-02-10 | true |
| 12 | Monitor Arm | Accessories | NULL | 89 | 25 | 0 | 2022-12-12 | false |
| 13 | Cable Organizer | Accessories | NULL | 12.5 | NULL | 300 | 2024-04-01 | true |
Example Output
| product_id | product_name |
|---|---|
| 12 | Monitor Arm |
| 13 | Cable Organizer |
| 6 | Desk Lamp |
| 9 | Gel Pen Pack |
Explanation
The Desk Lamp, Gel Pen Pack, Monitor Arm and Cable Organizer have no brand recorded. The other products in the example, such as the USB-C Hub from Anker, have a brand, so they are left out.
The example above is a small slice of the data. Your query runs against the full tables.
Company
Amazon
Difficulty
easy
Topic
null handling
Your query
Starting the SQL engine...