코딩테스트 SQL 코드카타 (Movie Rating)
·
Daily 코드카타/SQL
문제 Movie Rating - LeetCode Write a solution to:Find the name of the user who has rated the greatest number of movies. In case of a tie, return the lexicographically smaller user name.Find the movie name with the highest average rating in February 2020.In case of a tie, return the lexicographically smaller movie name.The result format is in the following example. Example 1:Input: Movies table:+--..
코딩테스트 SQL 코드카타 (Exchange Seats)
·
Daily 코드카타/SQL
문제 Exchange Seats - LeetCode Write a solution to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.Return the result table ordered by id in ascending order.The result format is in the following example. Example 1:Input: Seat table:+----+---------+| id | student |+----+---------+| 1 | Abbot || 2 | Doris || 3 | Em..
코딩테스트 SQL 코드카타 (Last person)
·
Daily 코드카타/SQL
문제Last Person to Fit in the Bus - LeetCode There is a queue of people waiting to board a bus. However, the bus has a weight limit of 1000 kilograms, so there may be some people who cannot board.Write a solution to find the person_name of the last person that can fit on the bus without exceeding the weight limit. The test cases are generated such that the first person does not exceed the weight l..
코딩테스트 SQL 코드카타 (Consecutive Numbers)
·
Daily 코드카타/SQL
문제Consecutive Numbers - LeetCodeFind all numbers that appear at least three times consecutively.Return the result table in any order.The result format is in the following example. Example 1:Input: Logs table:+----+-----+| id | num |+----+-----+| 1 | 1 || 2 | 1 || 3 | 1 || 4 | 2 || 5 | 1 || 6 | 2 || 7 | 2 |+----+-----+Output: +-----------------+| ConsecutiveNums |+-----------..
코딩테스트 SQL 코드카타 (Primary Department)
·
Daily 코드카타/SQL
문제Primary Department for Each Employee - LeetCode Employees can belong to multiple departments. When the employee joins other departments, they need to decide which department is their primary department.Note that when an employee belongs to only one department, their primary column is 'N'.Write a solution to report all the employees with their primary department. For employees who belong to one..
코딩테스트 SQL 코드카타 (Number of Employees)
·
Daily 코드카타/SQL
문제The Number of Employees Which Report to Each Employee - LeetCode For this problem, we will consider a manager an employee who has at least 1 other employee reporting to them.Write a solution to report the ids and the names of all managers, the number of employees who report directly to them, and the average age of the reports rounded to the nearest integer.Return the result table ordered by em..