๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
SQL/LeetCode

[LeetCode][SQL50] #1. Recyclable and Low Fat Products

by ์ด๋ฎด 2023. 11. 3.
728x90

๐Ÿ’ป ๋ฌธ์ œ ์ฃผ์†Œ : Recyclable and Low Fat Products - LeetCode

 

Recyclable and Low Fat Products - LeetCode

Can you solve this real interview question? Recyclable and Low Fat Products - Table: Products +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | low_fats | enum | | recyclable | enum | +-------------+---------

leetcode.com

 

๐Ÿ’ป ๋ฌธ์ œ

Write a solution to find the ids of products that are both low fat and recyclable. Return the result table in any order. The result format is in the following example.

- ์ €์ง€๋ฐฉ์ด๋ฉด์„œ ์žฌํ™œ์šฉ ๊ฐ€๋Šฅํ•œ ์ƒํ’ˆ ID๋ฅผ ์ฐพ์œผ์‹œ์˜ค. ๊ฒฐ๊ณผ ํ…Œ์ด๋ธ” ์ˆœ์„œ๋Š” ์ƒ๊ด€ ์—†์œผ๋ฉฐ, ํฌ๋งท์€ ์•„๋ž˜ ์˜ˆ์‹œ์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Input๊ณผ Output ์˜ˆ์‹œ

 

๐Ÿ’ป ์ฝ”๋“œ ๋ฐ ํ’€์ด

select product_id
from products
where low_fats = 'Y' and recyclable = 'Y'

 

728x90
๋ฐ˜์‘ํ˜•

'SQL > LeetCode' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[LeetCode][SQL50] #6. Replace Employee ID With The Unique Identifier  (0) 2023.11.07
[LeetCode][SQL50] #5. Invalid Tweets  (0) 2023.11.06
[LeetCode][SQL50] #4. Article Views I  (0) 2023.11.06
[LeetCode][SQL50] #3. Big Countries  (0) 2023.11.06
[LeetCode][SQL50] #2. Find Customer Referee  (0) 2023.11.03