Skip to content

Commit 518ae2c

Browse files
authored
Added tasks 183-185.
1 parent 0de581a commit 518ae2c

File tree

3 files changed

+35
-0
lines changed
  • src/main/java/g0101_0200

3 files changed

+35
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Write your MySQL query statement below
2+
SELECT c.Name as Customers
3+
FROM Customers as c
4+
LEFT JOIN Orders as o
5+
ON c.Id = o.CustomerId
6+
WHERE o.CustomerId is null
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Write your MySQL query statement below
2+
SELECT
3+
d.Name AS Department,
4+
Sel.Name AS Employee,
5+
Sel.Salary AS Salary
6+
FROM
7+
(
8+
SELECT
9+
Name,
10+
Salary,
11+
DepartmentId,
12+
DENSE_RANK() OVER (PARTITION BY DepartmentId ORDER BY Salary DESC) AS dr
13+
FROM Employee
14+
) AS Sel
15+
INNER JOIN Department d ON d.Id = Sel.DepartmentId
16+
WHERE Sel.dr = 1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Write your MySQL query statement below
2+
SELECT d.Name AS Department, e.Name AS Employee, e.Salary
3+
FROM Employee e
4+
JOIN Department d
5+
ON e.DepartmentId = d.Id
6+
WHERE e.Salary IN (
7+
SELECT e2.Salary FROM (
8+
SELECT DISTINCT e3.Salary FROM Employee e3
9+
WHERE e3.DepartmentID = d.Id
10+
ORDER BY e3.Salary DESC
11+
LIMIT 3
12+
) AS e2
13+
);

0 commit comments

Comments
 (0)