Products with no brand

null handling

Products 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 NameType
product_idBIGINT
product_nameVARCHAR
categoryVARCHAR
brandVARCHAR
priceDOUBLE
discount_pctBIGINT
stock_quantityBIGINT
launch_dateDATE
is_activeBOOLEAN

productsExample Input

product_idproduct_namecategorybrandpricediscount_pctstock_quantitylaunch_dateis_active
5Ergonomic Chair ProFurnitureSteelcase1299552021-06-30true
6Desk LampFurnitureNULL39.5NULL802024-01-15true
7USB-C HubElectronicsAnker45202002023-03-22true
8Notebook SetStationeryMoleskine18NULL02022-09-01false
9Gel Pen PackStationeryNULL6.99NULL5002024-02-10true
12Monitor ArmAccessoriesNULL892502022-12-12false
13Cable OrganizerAccessoriesNULL12.5NULL3002024-04-01true

Example Output

product_idproduct_name
12Monitor Arm
13Cable Organizer
6Desk Lamp
9Gel 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.