Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab8f703

Browse filesBrowse files
committed
Update README.md
1 parent 8160103 commit ab8f703
Copy full SHA for ab8f703

File tree

1 file changed

+31
-0
lines changed
Filter options

1 file changed

+31
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,35 @@ WHEN product_id NOT IN
426426
FROM products
427427
WHERE change_date <= '2019-08-16'
428428
)
429+
```
430+
431+
432+
[1978. Employees Whose Manager Left the Company](https://leetcode.com/problems/employees-whose-manager-left-the-company)
433+
```sql
434+
SELECT employee_id
435+
FROM Employees
436+
WHERE manager_id NOT IN (
437+
SELECT employee_id
438+
FROM Employees
439+
)
440+
AND salary < 30000
441+
ORDER BY employee_id
442+
```
443+
444+
[185. Department Top Three Salaries](https://leetcode.com/problems/department-top-three-salaries)
445+
```sql
446+
WITH RankedSalaries AS
447+
(SELECT
448+
e.Id AS employee_id,
449+
e.name AS employee,
450+
e.salary,
451+
e.departmentId,
452+
DENSE_RANK() OVER (PARTITION BY e.departmentId ORDER BY e.salary DESC) AS salary_rank
453+
FROM Employee e)
454+
SELECT d.name AS Department,
455+
r.employee,
456+
r.salary
457+
FROM Department d
458+
JOIN RankedSalaries r ON r.departmentId = d.id
459+
WHERE r.salary_rank <=3;
429460
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.