취준/코팅 테스트20 [LeetCode] - 601. Human Traffic Of Stadium 문제 Write a solution to display the records with three or more rows with consecutive id's, and the number of people is greater than or equal to 100 for each. Return the result table ordered by visit_date in ascending order. 문제풀이 WITH df AS( SELECT * , LEAD(people,1) OVER (ORDER BY id) AS nxt_1 , LEAD(people,2) OVER (ORDER BY id) AS nxt_2 , LAG (people,1) OVER (ORDER BY id) AS pre_1 , LAG (people,.. 2024. 4. 5. [LeetCode] - 1661. Average Time Of Process per Machine 문제 There is a factory website that has several machines each running the same number of processes. Write a solution to find the average time each machine takes to complete a process. The time to complete a process is the 'end' timestamp minus the 'start' timestamp. The average time is calculated by the total time to complete every process on the machine divided by the number of processes that we.. 2024. 4. 4. [LeetCode] - 1321. Restaurant Growth 문제 You are the restaurant owner and you want to analyze a possible expansion (there will be at least one customer every day). Compute the moving average of how much the customer paid in a seven days window (i.e., current day + 6 days before). average_amount should be rounded to two decimal places. Return the result table ordered by visited_on in ascending order. 문제 풀이 WITH df AS( SELECT DISTINCT.. 2024. 4. 3. [LeetCode] 1978. Employees Whose Manager Left the Company 문제 Find the IDs of the employees whose salary is strictly less than $30000 and whose manager left the company. When a manager leaves the company, their information is deleted from the Employees table, but the reports still have their manager_id set to the manager that left. Return the result table ordered by employee_id. 문제 풀이 SELECT employee_id FROM Employees WHERE salary < 30000 AND manager_id.. 2024. 4. 1. 이전 1 2 3 4 5 다음