Recyclable and Low Fat Products

2pts
Meta, Amazon

Problem Statement

The warehouse management system needs to generate a report of "Eco-Friendly Healthy Picks" for the upcoming marketing campaign.

Write an SQL query to find the IDs of products that are both low fat and recyclable.

Rules:

  • A product is low fat if the low_fats column has the value 'Y'.
  • A product is recyclable if the recyclable column has the value 'Y'.
  • The result should contain only the product_id column.
Tests your understanding of
Basic SQL, Filtering, WHERE Clause and Boolean Logic

Input Tables

products
product_id(INTEGER)low_fats(ENUM('Y', 'N'))recyclable(ENUM('Y', 'N'))
0YN
1YY
2NY
3YY
4NN
5YY

Expected Output

product_id(INTEGER)
1
3
5

Tags

EasyBasic SQLFilteringWHERE ClauseBoolean Logic
5-10 min
88%

Hints