전체 글40 [LeetCode] 1084. Sales Analysis 3 문제 Write a solution to report the products that were only sold in the first quarter of 2019. That is, between 2019-01-01 and 2019-03-31 inclusive. Return the result table in any order. "2019년 1분기에만 판매된 제품을 알 수 있는 쿼리를 작성해라 즉, 2019-01-01 부터 2019-03-01 사이에 포함된다." 문제 풀이 product_id 별로 날짜를 확인 해야 한다. 이때 중요하건 product_id 모두가 1분기 날짜에 팔려야 한다. 즉, 1개라도 1분기 날자 이후에 판매된 경우는 제외되어야 한다. SELECT s.product_id , p.pro.. 2024. 4. 10. [LeetCode] - 608. Tree Node 문제 Each node in the tree can be one of three types: "Leaf": if the node is a leaf node."Root": if the node is the root of the tree."Inner": If the node is neither a leaf node nor a root node. Write a solution to report the type of each node in the tree. Return the result table in any order. " Leef, Root, Inner로 분류하여라" 문제 풀이 1) Root의 경우는 p_id가 Null 인 경우이다. 2) Inner의 경우는 P-id가 id에 속해 있어야 하고, id도 역.. 2024. 4. 10. [LeetCode] - 1965. Employees With Missing Information 문제 Write a solution to report the IDs of all the employees with missing information. The information of an employee is missing if: The employee's name is missing, orThe employee's salary is missing. Return the result table ordered by employee_id in ascending order. " 누락된 정보가 있는 모든 직원의 ID를 보고하는 솔루션을 작성합니다. 다음과 같은 경우에는 직원의 정보가 누락됩니다 1. 직원의 이름이 누락되었거나, 2. 직원의 급여가 누락되었습니다. employee_id에서 주문한 결과표를 오름차.. 2024. 4. 9. 585. Investments in 2016 문제 Write a solution to report the sum of all total investment values in 2016 tiv_2016, for all policyholders who: have the same tiv_2015 value as one or more other policyholders, and are not located in the same city as any other policyholder (i.e., the (lat, lon) attribute pairs must be unique). Round tiv_2016 to two decimal places. " tiv_2015의 값이 다른 policyholder와 하나 혹은 그 이상의 값이 같거나, 고유한 (lat, l.. 2024. 4. 9. [LeetCode] - 1204. Last Person to Fit in the Bus 문제 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 limi Table " 순서대로 버스를 탔을 때, 몸무게가 1000kg .. 2024. 4. 6. [LeetCode] 1484. Group Sold Products By The Date 문제 Write a solution to find for each date the number of different products sold and their names. The sold products names for each date should be sorted lexicographically. Return the result table ordered by sell_date. " 각 날짜별로 판매된 제품의 수, 종류를 작성하세요." Table 풀이 과정 SELECT sell_date , COUNT(DISTINCT product) AS num_sold , GROUP_CONCAT(DISTINCT product ORDER BY product) AS products FROM Activities GROU.. 2024. 4. 6. 이전 1 2 3 4 5 ··· 7 다음