-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsqlquery7.sql
29 lines (25 loc) · 1.5 KB
/
sqlquery7.sql
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
Problem Statement:
List down all the Employees whose salary is greater than that of Monica Geller.
Information about the table:
Table Employee:+---------+-------------------+-------------------+---------+------------+--------+----------+
| EmpCode | EmpName | Job | Manager | HireDate | Salary | DeptCode |
+---------+-------------------+-------------------+---------+------------+--------+----------+
| 9369 | Ted Mosby | SOFTWARE ENGINEER | 7902 | 1980-12-17 | 2800 | 20 |
| 9499 | Robin Scherbatsky | SALESMAN | 7698 | 1981-02-20 | 1600 | 30 |
| 9566 | Lily Aldrin | MANAGER | 7839 | 1981-04-02 | 3570 | 20 |
| 9654 | Phoebe Buffay | SALESMAN | 7698 | 1981-09-28 | 1250 | 30 |
| 9782 | Monica Geller | MANAGER | 7839 | 1981-06-09 | 2940 | 10 |
| 9788 | Chandler Bing | ANALYST | 7566 | 1982-12-09 | 3000 | 20 |
| 9839 | Marshall Eriksen | PRESIDENT | 7566 | 1981-11-17 | 5000 | 10 |
+---------+-------------------+-------------------+---------+------------+--------+----------+
Note : You are not authorized to view the salaries of the employees.
Solution:
select empname from employee where salary > (select salary from employee where empname = 'Monica Geller');
Output:
+------------------+
| empname |
+------------------+
| Lily Aldrin |
| Chandler Bing |
| Marshall Eriksen |
+------------------+