본문 바로가기

리트코드7

[LeetCode][MySQL] Customers Who Bought All Products https://leetcode.com/problems/customers-who-bought-all-products/ Customers Who Bought All Products - LeetCode Can you solve this real interview question? Customers Who Bought All Products - Table: Customer +-------------+---------+ | Column Name | Type | +-------------+---------+ | customer_id | int | | product_key | int | +-------------+---------+ This table may leetcode.com select customer_id .. 2024. 1. 5.
[LeetCode][MySQL] Tree Node https://leetcode.com/problems/tree-node Tree Node - LeetCode Can you solve this real interview question? Tree Node - Table: Tree +-------------+------+ | Column Name | Type | +-------------+------+ | id | int | | p_id | int | +-------------+------+ id is the column with unique values for this table. Each row of this leetcode.com select distinct a.id, ( case when a.p_id is null then 'Root' when b.. 2024. 1. 3.
[LeetCode][MySQL] Friend Requests II: Who Has the Most Friends https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends/ Friend Requests II: Who Has the Most Friends - LeetCode Can you solve this real interview question? Friend Requests II: Who Has the Most Friends - Table: RequestAccepted +----------------+---------+ | Column Name | Type | +----------------+---------+ | requester_id | int | | accepter_id | int | | accept_date | leetcode.co.. 2024. 1. 3.
[LeetCode][MySQL] Rearrange Products Table https://leetcode.com/problems/rearrange-products-table Rearrange Products Table - LeetCode Can you solve this real interview question? Rearrange Products Table - Table: Products +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | store1 | int | | store2 | int | | store3 | int | +-------------+------- leetcode.com select product_id, 'store1' as store,.. 2023. 12. 29.
[LeetCode][MySQL] Group Sold Products By The Date https://leetcode.com/problems/group-sold-products-by-the-date/ Group Sold Products By The Date - LeetCode Can you solve this real interview question? Group Sold Products By The Date - Table Activities: +-------------+---------+ | Column Name | Type | +-------------+---------+ | sell_date | date | | product | varchar | +-------------+---------+ There is no prim leetcode.com select sell_date, coun.. 2023. 12. 20.
[LeetCode][MySQL] Triangle Judgement https://leetcode.com/problems/triangle-judgement/ Triangle Judgement - LeetCode Can you solve this real interview question? Triangle Judgement - Table: Triangle +-------------+------+ | Column Name | Type | +-------------+------+ | x | int | | y | int | | z | int | +-------------+------+ In SQL, (x, y, z) is the primary key column for leetcode.com select x, y, z, (case when x+y>z and y+z>x and x.. 2023. 12. 13.