| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- machine learning
- generic
- webpack
- TypeScript
- loop
- security
- 앙상블
- Python
- vuetify
- type
- vue.js
- C#
- scss
- AI
- BOJ
- JavaScript
- C++
- property
- nginx
- docker
- condition
- leetcode
- bash
- git
- npm
- VUE
- dotenv
- 보안
- Clone
- var
Archives
- Today
- Total
ice rabbit programming
[LeetCode] Employees Earning More Than Their Manager 본문
728x90
https://leetcode.com/problems/employees-earning-more-than-their-managers/
Employees Earning More Than Their Managers - 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
아마 관계형 DB를 배울 때 가장 유명한 예제가 아닐까? Employee의 Manager가 Employee에 속하는 것.
그 중에서 Salary를 비교하여 출력하는 예제였다.
# Write your MySQL query statement below
SELECT e1.Name as Employee
FROM Employee as e1
JOIN Employee as e2
ON e1.ManagerId=e2.Id and e2.Salary < e1.Salary;
JOIN을 사용했는데, 풀고 나서 Discussion을 보니 JOIN을 꼭 사용하지는 않아도 되었다.
FROM Employee as e1, Employee as e2
로 처리했어도 되더라!
728x90
'PS > LeetCode' 카테고리의 다른 글
| [LeetCode] Second Highest Salary (0) | 2020.05.01 |
|---|---|
| [LeetCode] May Challenge 1 - First Bad Version (0) | 2020.05.01 |
| [LeetCode] Symmetric Tree (0) | 2020.05.01 |
| [LeetCode] Invert Binary Tree (0) | 2020.04.27 |
| [LeetCode] Reverse Linked List (0) | 2020.04.27 |