전체 글
-
586. Customer Placing the Largest Number of Orders mysqlLeetCode_Study_Plan/SQL 2022. 10. 2. 14:44
https://leetcode.com/problems/customer-placing-the-largest-number-of-orders/?envType=study-plan&id=sql-i Customer Placing the Largest Number of Orders - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select customer_number from (select customer_number, count(order_number) as cnt f..
-
1729. Find Followers Count mysqlLeetCode_Study_Plan/SQL 2022. 10. 2. 14:39
https://leetcode.com/problems/find-followers-count/ Find Followers Count - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select user_id, count(distinct follower_id) as followers_count from followers group by user_id order by user_id;
-
1693. Daily Leads and Partners mysqlLeetCode_Study_Plan/SQL 2022. 10. 2. 14:35
https://leetcode.com/problems/daily-leads-and-partners/?envType=study-plan&id=sql-i Daily Leads and Partners - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com SELECT date_id, make_name, COUNT(DISTINCT lead_id) AS unique_leads, COUNT(DISTINCT partner_id) AS unique_partners FROM Dail..
-
1141. User Activity for the Past 30 Days I mysqlLeetCode_Study_Plan/SQL 2022. 10. 2. 14:14
https://leetcode.com/problems/user-activity-for-the-past-30-days-i/?envType=study-plan&id=sql-i User Activity for the Past 30 Days I - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select activity_date as day, count(distinct user_id) as active_users from activity where datediff('..
-
176. Second Highest Salary mysqlLeetCode_Study_Plan/SQL 2022. 10. 2. 14:00
https://leetcode.com/problems/second-highest-salary/?envType=study-plan&id=sql-i Second Highest Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com SELECT IFNULL( (SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT 1 OFFSET 1), NULL) AS SecondHighestSalary; offset..
-
608. Tree Node mysqlLeetCode_Study_Plan/SQL 2022. 10. 2. 13:45
https://leetcode.com/problems/tree-node/?envType=study-plan&id=sql-i Tree Node - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 처음에는 삼항연산자를 동원해서 풀어보고 그랬는데 case when then else end를 이용하면 훨씬 깔끔하게 풀 수 있다. 게다가 당연히 inner join을 한다고 생각했는데 그렇게 풀지 않아도 되었다. SELECT id, CASE WHEN p_id IS NULL ..
-
607. Sales Person mysqlLeetCode_Study_Plan/SQL 2022. 9. 30. 16:28
https://leetcode.com/problems/sales-person/?envType=study-plan&id=sql-i Sales Person - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com select name from salesPerson where name not in (select s.name from salesperson s left join (select c.com_id, c.name, o.sales_id from company c left..
-
197. Rising Temperature mysqlLeetCode_Study_Plan/SQL 2022. 9. 30. 16:12
https://leetcode.com/problems/rising-temperature/?envType=study-plan&id=sql-i Rising Temperature - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com lag, lead 이런거 찾아보고 있었는데 self join의 on으로 처리해서 풀 수 있었다.. 어렵네.. select A.id as id from weather a inner join weather b on datediff(a.record..