반응형

Today I Learned/SQL 문제풀이 5

leetcode 1907. Count Salary Categories (열 -> 행으로 변환)

https://leetcode.com/problems/count-salary-categories/description/?envType=study-plan-v2&envId=top-sql-50 Count Salary Categories - LeetCode Can you solve this real interview question? Count Salary Categories - Table: Accounts +-------------+------+ | Column Name | Type | +-------------+------+ | account_id | int | | income | int | +-------------+------+ account_id is the primary key (column wi ..

leetcode 1280. Students and Examinations (cross join)

문제 링크 https://leetcode.com/problems/students-and-examinations/description/?envType=study-plan-v2&envId=top-sql-50 Students and Examinations - LeetCode Can you solve this real interview question? Students and Examinations - Table: Students +---------------+---------+ | Column Name | Type | +---------------+---------+ | student_id | int | | student_name | varchar | +---------------+---------+ stud..

[해커랭크] Top Competitors

문제링크: www.hackerrank.com/challenges/full-score/problem?isFullScreen=true Top Competitors | HackerRank Query a list of top-scoring hackers. www.hackerrank.com Table 설명 * Hackers: 전체 hackers 정보 * Difficulty: 문제의 난이도 별 Full score 정보 * Challenges: 문제와, 문제를 제작한 Hacker 정보, 문제의 난이도 정보 * Submissions: 문제를 제출한 사람의 정보와, 제출 시 score 정보 문제 설명 코딩테스트 제출자 중 full score 맞은 문제가 한개보다 많은 (2개 이상) 인 참가자의 hacker_id와, na..

[leetcode] Department Highest Salary (윈도우함수)

문제 출처: leetcode.com/problems/department-highest-salary/ Department Highest Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제. 각 부서에서 salary 가장 높은 사람 뽑기 출력 형태 Solution1. FROM 절에서 Subquery + MAX() 윈도우함수 1) subquery에서 max() 윈도우함수를 써서 부서 별 가장 높은 salary를 구해준다 (M_Salary) subque..

반응형