-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJoins.sql
52 lines (42 loc) · 1.23 KB
/
Joins.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
SELECT FIRST_NAME,LAST_NAME,DEPARTMENT_NAME
FROM EMPLOYEES E
JOIN DEPARTMENTS D
ON E.DEPARTMENT_ID=D.DEPARTMENT_ID;
SELECT FIRST_NAME,LAST_NAME,DEPARTMENT_NAME
FROM EMPLOYEES E
JOIN DEPARTMENTS D
ON E.DEPARTMENT_ID=D.DEPARTMENT_ID
WHERE DEPARTMENT_NAME='IT';
SELECT FIRST_NAME,LAST_NAME,DEPARTMENT_NAME
FROM EMPLOYEES E
JOIN DEPARTMENTS D
ON E.DEPARTMENT_ID=D.DEPARTMENT_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,D.LOCATION_ID
FROM EMPLOYEES E
JOIN DEPARTMENTS D
ON E.DEPARTMENT_ID=D.DEPARTMENT_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,D.MANAGER_ID
FROM EMPLOYEES E
JOIN DEPARTMENTS D
ON E.DEPARTMENT_ID=D.DEPARTMENT_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,J.JOB_TITLE
FROM EMPLOYEES E
JOIN JOBS J
ON E.JOB_ID=J.JOB_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,J.JOB_TITLE,J.MAX_SALARY
FROM EMPLOYEES E
JOIN JOBS J
ON E.JOB_ID=J.JOB_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,J.JOB_TITLE,J.MIN_SALARY
FROM EMPLOYEES E
JOIN JOBS J
ON E.JOB_ID=J.JOB_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,J.JOB_TITLE,J.MAX_SALARY,J.MIN_SALARY
FROM EMPLOYEES E
JOIN JOBS J
ON E.JOB_ID=J.JOB_ID;
SELECT E.FIRST_NAME,E.LAST_NAME,E.SALARY,PHONE_NUMBER,HIRE_DATE,MANAGER_ID,COMMISSION_PCT,
J.JOB_TITLE,J.MAX_SALARY-J.MIN_SALARY AS DIFF
FROM EMPLOYEES E
JOIN JOBS J
ON E.JOB_ID=J.JOB_ID;