You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Problem Statement: Write a solution to find the ids of products that are both low fat and recyclable.
-- Given Table: Products
--
-- +-------------+---------+
-- | Column Name | Type |
-- +-------------+---------+
-- | product_id | int |
-- | low_fats | enum |
-- | recyclable | enum |
-- +-------------+---------+
-- product_id is the primary key (column with unique values) for this table.
-- low_fats is an ENUM (category) of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.
-- recyclable is an ENUM (category) of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.
--
-- Approach: To find the ids of products that are both low fat and recyclable, we can simply query the product_id from the Products table where low_fats='Y' and recyclable='Y'.