You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|183|[Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/)|[Solution](../master/database/_183.sql)| O(n^2)|O(n) | Easy|
-- The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.
3
+
--
4
+
--+----+-------+--------+--------------+
5
+
--| Id | Name | Salary | DepartmentId |
6
+
--+----+-------+--------+--------------+
7
+
--| 1 | Joe | 70000 | 1 |
8
+
--| 2 | Henry | 80000 | 2 |
9
+
--| 3 | Sam | 60000 | 2 |
10
+
--| 4 | Max | 90000 | 1 |
11
+
--| 5 | Janet | 69000 | 1 |
12
+
--| 6 | Randy | 85000 | 1 |
13
+
--+----+-------+--------+--------------+
14
+
--
15
+
--The Department table holds all departments of the company.
16
+
--
17
+
--+----+----------+
18
+
--| Id | Name |
19
+
--+----+----------+
20
+
--| 1 | IT |
21
+
--| 2 | Sales |
22
+
--+----+----------+
23
+
--
24
+
--Write a SQL query to find employees who earn the top three salaries in each of the department. For the above tables, your SQL query should return the following rows.
0 commit comments