Skip to content

Commit 411a1dc

Browse files
committed
task: #181
1 parent 684c9e7 commit 411a1dc

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.sqlfluff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ exclude_rules = LT01, CP02
44

55
[sqlfluff:rules]
66
keywords_capitalisation_policy = upper
7-
max_line_length = 100
7+
max_line_length = 120

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Leetcode (PostgreSQL)
22

33
[![MIT licensed](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
4-
[![CI](https://github.com/ivanbyone/hookify/actions/workflows/ci.yml/badge.svg)](https://github.com/Ivanbyone/leetcode-sql//actions)
4+
[![CI](https://github.com/ivanbyone/leetcode-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/Ivanbyone/leetcode-sql//actions)
55

66
## Description
77

@@ -33,8 +33,9 @@ Have a good contributing!
3333
## Task List
3434

3535
1. [Easy](./leetcode/easy/)
36-
- [182. Duplicate Emails](./leetcode/easy/182.%20Duplicate%20Emails.sql)
3736
- [175. Combine Two Tables](./leetcode//easy/175.%20Combine%20Two%20Tables.sql)
37+
- [181. Employees Earning More Than Their Managers](./leetcode/easy/181.%20Employees%20Earning%20More%20Than%20Their%20Managers.sql)
38+
- [182. Duplicate Emails](./leetcode/easy/182.%20Duplicate%20Emails.sql)
3839
- [183. Customers Who Never Order](./leetcode/easy/183.%20Customers%20Who%20Never%20Order.sql)
3940
- [511. Game Play Analysis 1](./leetcode/easy/511.%20Game%20Play%20Analysis%201.sql)
4041
- [595. Big Countries](./leetcode/easy/595.%20Big%20Countries.sql)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Question 181. Employees Earning More Than Their Managers
3+
Link:
4+
https://leetcode.com/problems/employees-earning-more-than-their-managers/description/
5+
6+
Table: Employee
7+
8+
+-------------+---------+
9+
| Column Name | Type |
10+
+-------------+---------+
11+
| id | int |
12+
| name | varchar |
13+
| salary | int |
14+
| managerId | int |
15+
+-------------+---------+
16+
id is the primary key (column with unique values) for this table.
17+
Each row of this table indicates the ID of an employee,
18+
their name, salary, and the ID of their manager.
19+
20+
21+
Write a solution to find the employees who earn more
22+
than their managers.
23+
24+
Return the result table in any order.
25+
*/
26+
27+
SELECT t1.name AS Employee
28+
FROM Employee t1
29+
JOIN Employee t2
30+
ON t1.managerId = t2.id
31+
WHERE t1.salary > t2.salary

0 commit comments

Comments
 (0)