Oracle Database 10g SQL Fundamentals I - Practice 6
개발 및 관리/Oracle 9i, 10g, 11g, 12c, 19c 2012. 11. 12. 22:33
Oracle Database 10g SQL Fundamentals I - Practice 6
1.
SELECT LAST_NAME, HIRE_DATE
FROM EMPLOYEES
WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME IN ('Zlotkey'))
AND LAST_NAME <> 'Zlotkey';
2.
SELECT EMPLOYEE_ID, LAST_NAME, SALARY FROM EMPLOYEES
WHERE SALARY > (SELECT AVG(SALARY) FROM EMPLOYEES)
ORDER BY SALARY ASC;
3.
SELECT EMPLOYEE_ID, LAST_NAME
FROM EMPLOYEES
WHERE DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME LIKE '%u%');
4.
SELECT LAST_NAME, DEPARTMENT_ID, JOB_ID
FROM EMPLOYEES
WHERE DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM DEPARTMENTS WHERE LOCATION_ID = 1700);
5.
SELECT LAST_NAME, SALARY
FROM EMPLOYEES
WHERE MANAGER_ID = (SELECT EMPLOYEE_ID FROM EMPLOYEES WHERE LAST_NAME = 'King');
6.
SELECT DEPARTMENT_ID, LAST_NAME, JOB_ID
FROM EMPLOYEES
WHERE
DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM DEPARTMENTS WHERE DEPARTMENT_NAME = 'Executive')
7.
SELECT EMPLOYEE_ID, LAST_NAME, SALARY FROM EMPLOYEES
WHERE SALARY > (SELECT AVG(SALARY) FROM EMPLOYEES)
AND DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM EMPLOYEES WHERE LAST_NAME LIKE '%u%')
ORDER BY SALARY ASC;
'개발 및 관리 > Oracle 9i, 10g, 11g, 12c, 19c' 카테고리의 다른 글
Set Operators (0) | 2012.11.13 |
---|---|
Oracle Database 10g SQL Fundamentals I - Practice 7 (0) | 2012.11.13 |
오라클 함수, LTRIM, TRANSLATE (0) | 2012.11.12 |
Oracle Database 10g SQL Fundamentals I - Practice 5 (0) | 2012.11.08 |
오라클 함수, SQL Functions (0) | 2012.11.08 |