Skip to content

Commit 809b537

Browse files
authored
Create # 66
1 parent 0b9ffd4 commit 809b537

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

w3resource/# 66

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# 66. From the following tables, write a SQL query to find those employees whose salary grade is greater than the grade of MARKER. Return complete information about the employees.
2+
3+
emp_id | emp_name | job_name | manager_id | hire_date | salary | commission | dep_id
4+
--------+----------+-----------+------------+------------+---------+------------+--------
5+
68319 | KAYLING | PRESIDENT | | 1991-11-18 | 6000.00 | | 1001
6+
66928 | BLAZE | MANAGER | 68319 | 1991-05-01 | 2750.00 | | 3001
7+
67832 | CLARE | MANAGER | 68319 | 1991-06-09 | 2550.00 | | 1001
8+
65646 | JONAS | MANAGER | 68319 | 1991-04-02 | 2957.00 | | 2001
9+
67858 | SCARLET | ANALYST | 65646 | 1997-04-19 | 3100.00 | | 2001
10+
69062 | FRANK | ANALYST | 65646 | 1991-12-03 | 3100.00 | | 2001
11+
63679 | SANDRINE | CLERK | 69062 | 1990-12-18 | 900.00 | | 2001
12+
64989 | ADELYN | SALESMAN | 66928 | 1991-02-20 | 1700.00 | 400.00 | 3001
13+
65271 | WADE | SALESMAN | 66928 | 1991-02-22 | 1350.00 | 600.00 | 3001
14+
66564 | MADDEN | SALESMAN | 66928 | 1991-09-28 | 1350.00 | 1500.00 | 3001
15+
68454 | TUCKER | SALESMAN | 66928 | 1991-09-08 | 1600.00 | 0.00 | 3001
16+
68736 | ADNRES | CLERK | 67858 | 1997-05-23 | 1200.00 | | 2001
17+
69000 | JULIUS | CLERK | 66928 | 1991-12-03 | 1050.00 | | 3001
18+
69324 | MARKER | CLERK | 67832 | 1992-01-23 | 1400.00 | | 1001
19+
(14 rows)
20+
21+
SELECT *
22+
FROM employees e,
23+
salary_grade s
24+
WHERE e.salary BETWEEN s.min_sal AND s.max_sal
25+
AND s.grade >
26+
(SELECT s.grade
27+
FROM employees e,
28+
salary_grade s
29+
WHERE e.salary BETWEEN s.min_sal AND s.max_sal
30+
AND e.emp_name = 'MARKER') ;

0 commit comments

Comments
 (0)