본문 바로가기

전체 글40

[취준 3월] - " 가혹한 3월 이었다....." 나에게 3월은 조금 아니 많이 아픈 탈락을 경험한 달이었다. (해탈했다..) 일단 현황 먼저 알아보자... 3월에는 총 14개의 서류를 작성했다. 그 중 9개는 서류 불합격, 1개는 면접 불합격을 받았다. 사실 그렇게 공들여서 서류를 작성한 건 없었던 것 같다. 왜냐하면.... 3월 3주 내내 일주일에 한번씩 면접이 있었다. 그것도 두개의 회사에서.. (1) A사 채용 절차 : 1월 ~ 3월 전형 : 서류 - 과제 전형 - 1차 면접 - 2차 면접 - 최종 면접 결과 : 2차 면접 탈락 (2) B사 채용 절차 : 2월 ~ 3월 전형 : 서류 - 코딩테스트 - 1차면접 - 최종면접 결과 : 최종 면접 탈락 두 회사 정말 가고 싶은 회사였다. 특히 A사의 경우, 1차 면접이었던 실무진 면접에서 좋은 인상을 .. 2024. 3. 29.
[LeetCode] - 1251. Average Selling Price 문제 Write a solution to find the average selling price for each product. average_price should be rounded to 2 decimal places. Return the result table in any order. The result format is in the following example. 문제 풀이 SELECT p.product_id , IFNULL(ROUND(SUM(units*price) / SUM(units),2),0) AS average_price FROM Prices p LEFT JOIN UnitsSold u ON p.product_id = u.product_id AND u.purchase_date BETWEEN.. 2024. 3. 28.
[LeetCode] - 180. Consecutive Numbers 문제 Find all numbers that appear at least three times consecutively. Return the result table in any order. The result format is in the following example. 문제풀이 SELECT DISTINCT num AS ConsecutiveNums FROM ( SELECT num , LEAD(num,1) OVER (ORDER BY id) AS num_1_after , LEAD(num,2) OVER (ORDER BY id) AS num_2_after FROM Logs ) nums WHERE num = num_1_after AND num = num_2_after 1. LEAD() 윈도우 함수를 이용해서 다.. 2024. 3. 27.
[LeetCode] - 1527. Patients With a Condition 문제 Write a solution to find the patient_id, patient_name, and conditions of the patients who have Type I Diabetes. Type I Diabetes always starts with DIAB1 prefix. Return the result table in any order. The result format is in the following example. 1-1 문제풀이 SELECT * FROM Patients WHERE conditions REGEXP '\\bDIAB1' 1-2 문제 풀이 SELECT patient_id, patient_name, conditions FROM Patients WHERE conditio.. 2024. 3. 26.
[LeetCode] - 586. Customer Placing the Largest Number of Orders 문제 Write a solution to find the customer_number for the customer who has placed the largest number of orders. The test cases are generated so that exactly one customer will have placed more orders than any other customer. 문제 풀이 SELECT customer_number FROM Orders GROUP BY customer_number ORDER BY COUNT(*) DESC LIMIT 1 오답 이유 1. Having으로 풀려고 했음. 2. Order By 뒤에는 변수명만 들어간다고 착각함. 3. DESC, LIMIT 1 하는 거.. 2024. 3. 25.
[LeetCode] - 577.Employee Bonus 문제 Write a solution to report the name and bonus amount of each employee with a bonus less than 1000. Return the result table in any order. The result format is in the following example. 문제 해결 SELECT e.name, b.bonus FROM Employee AS e LEFT JOIN Bonus AS b ON e.empId = b.empId WHERE b.bonus IS NULL 쓰면 됩니당.... 2024. 3. 18.