Skip to content

Commit 146cc79

Browse files
committed
task: #1757
1 parent 01f317f commit 146cc79

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Useful for preparing for technical interviews and improving your SQL skills.
3434

3535
### Select
3636

37+
- [1757. Recyclable and Low Fat Products](./leetcode/easy/1757.%20Recyclable%20and%20Low%20Fat%20Products.sql)
3738
- [584. Find Customer Referee](./leetcode/easy/584.%20Find%20Customer%20Referee.sql)
3839
- [595. Big Countries](./leetcode/easy/595.%20Big%20Countries.sql)
3940
- [1148. Article Views I](./leetcode/easy/1148.%20Article%20Views%20I.sql)
@@ -148,6 +149,7 @@ Useful for preparing for technical interviews and improving your SQL skills.
148149
- [1729. Find Followers Count](./leetcode/easy/1729.%20Find%20Followers%20Count.sql)
149150
- [1731. The Number of Employees Which Report to Each Employee](./leetcode/easy/1731.%20The%20Number%20of%20Employees%20Which%20Report%20to%20Each%20Employee.sql)
150151
- [1741. Find Total Time Spent by Each Employee](./leetcode/easy/1741.%20Find%20Total%20Time%20Spent%20by%20Each%20Employee.sql)
152+
- [1757. Recyclable and Low Fat Products](./leetcode/easy/1757.%20Recyclable%20and%20Low%20Fat%20Products.sql)
151153
- [1789. Primary Department for Each Employee](./leetcode/easy/1789.%20Primary%20Department%20for%20Each%20Employee.sql)
152154
- [1795. Rearrange Products Table](./leetcode/easy/1795.%20Rearrange%20Products%20Table.sql)
153155
- [1873. Calculate Special Bonus](./leetcode/easy/1873.%20Calculate%20Special%20Bonus.sql)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Question 1757. Recyclable and Low Fat Products
3+
Link: https://leetcode.com/problems/recyclable-and-low-fat-products/description/?envType=problem-list-v2&envId=database
4+
5+
Table: Products
6+
7+
+-------------+---------+
8+
| Column Name | Type |
9+
+-------------+---------+
10+
| product_id | int |
11+
| low_fats | enum |
12+
| recyclable | enum |
13+
+-------------+---------+
14+
product_id is the primary key (column with unique values) for this table.
15+
low_fats is an ENUM (category) of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.
16+
recyclable is an ENUM (category) of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.
17+
18+
19+
Write a solution to find the ids of products that are both low fat and recyclable.
20+
21+
Return the result table in any order.
22+
*/
23+
24+
SELECT product_id
25+
FROM products
26+
WHERE low_fats = 'Y' AND recyclable = 'Y'

0 commit comments

Comments
 (0)