목록Tool (62)
홍동이의 성장일기
Rank Scores - LeetCode Can you solve this real interview question? Rank Scores - Table: Scores +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | score | decimal | +-------------+---------+ id is the primary key (column with unique values) leetcode.com 점수의 순위를 찾기 위한 해결책을 작성합니다. 순위는 다음 규칙에 따라 계산되어야 합니다: 두 점수 사이에 동점이 있으면 두 점수 모두 같은 순위를 가져야 합니다. ➡️ RANK / DENS..
Department Top Three Salaries - LeetCode Can you solve this real interview question? Department Top Three Salaries - Table: Employee +--------------+---------+ | Column Name | Type | +--------------+---------+ | id | int | | name | varchar | | salary | int | | departmentId | int | +-------------- leetcode.com SELECT Department , Employee , Salary FROM( SELECT d.name as Department , e.name as Emp..
Game Play Analysis I - LeetCode Can you solve this real interview question? Game Play Analysis I - Table: Activity +--------------+---------+ | Column Name | Type | +--------------+---------+ | player_id | int | | device_id | int | | event_date | date | | games_played | int | +---------- leetcode.com [풀이 1] SELECT player_id , MIN(event_date) AS first_login FROM activity GROUP BY player_id [풀이 2]..
Consecutive Numbers - LeetCode Can you solve this real interview question? Consecutive Numbers - Table: Logs +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | num | varchar | +-------------+---------+ In SQL, id is the primary key for this table. leetcode.com WITH cte_lead AS( SELECT num , LEAD(num, 1) OVER () AS next_1 , LEAD(num, 2) OVER () AS next_2 FRO..
안녕하세요👋 오늘은 정규표현식에 대해 이야기해 보겠습니다. 이번에 데이터리안 강의를 들으며 정규표현식을 배우게 되었는데요, 정규표현식을 학습할 수 있는 사이트가 영어로 되어있기도 하고 원하는 예시를 바로바로 찾아보기 힘들어서 복습 겸 정리하기 위해 글을 작성하게 되었습니다. 현직자 분들도 정규표현식을 외우기보다는 그때그때 찾아서 사용한다고 하시더라고요! 한 번만 잘 익혀놓으면 유용하게 사용할 수 있다고 하니 이번 기회에 잘 공부해 놓으면 좋겠죠? 정규표현식(Regular Expression) 이란? 정규표현식은 문자열에서 특정한 문자를 찾아내는 도구입니다. 정규표현식을 이용하면 복잡한 작업을 간단하게 해결할 수 있습니다. RegexOne - Learn Regular Expressions - Lesson ..
Sales Analysis III - LeetCode Can you solve this real interview question? Sales Analysis III - Table: Product +--------------+---------+ | Column Name | Type | +--------------+---------+ | product_id | int | | product_name | varchar | | unit_price | int | +--------------+---------+ pro leetcode.com SELECT s.product_id , p.product_name FROM sales s LEFT JOIN product p ON s.product_id = p.product_..
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 | +-------------+---------+ There is no pri leetcode.com SELECT customer_id FROM customer GROUP BY customer_id HAVING COUNT(DISTINCT product..
Managers with at Least 5 Direct Reports - LeetCode Can you solve this real interview question? Managers with at Least 5 Direct Reports - Table: Employee +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | | department | varchar | | managerId | int | +- leetcode.com SELECT m.name as name FROM employee e INNER JOIN employee m ON e.managerId = ..
Game Play Analysis IV - LeetCode Can you solve this real interview question? Game Play Analysis IV - Table: Activity +--------------+---------+ | Column Name | Type | +--------------+---------+ | player_id | int | | device_id | int | | event_date | date | | games_played | int | +--------- leetcode.com WITH cte_login AS( SELECT player_id , DATEDIFF(event_date, MIN(event_date) OVER(PARTITION BY pl..
Trips and Users - LeetCode Can you solve this real interview question? Trips and Users - Table: Trips +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | client_id | int | | driver_id | int | | city_id | int | | status | enum | | request_at | leetcode.com 취소율은 금지되지 않은 사용자가 있는 취소된(클라이언트별 또는 드라이버별) 요청의 수를 해당일의 금지되지 않은 사용자가 있는 요청의 총 수로 나누어 계산됩니다. "2013-10-01"..