Telkom University Student Blog site

Author: Bayu Ihsanudin

Task Hierarchical Retrieval Solutions

NAMA : BAYU IHSANUDIN

NIM : 6301124021

KELAS : DBD-12-01

Silakan lihat soal…( KLIK DISINI )

1.
SELECT last_name FROM employees
WHERE last_name != ‘Lorentz’
START WITH last_name = ‘Lorentz’
CONNECT BY PRIOR manager_id=employee_id;

2.
SELECT e.last_name, e.salary, d.department_name
FROM employees e JOIN departments d ON (e.department_id=d.department_id)
START WITH e.last_name = ‘Mourgos’
CONNECT BY PRIOR e.employee_id=e.manager_id;

3.
SELECT e.last_name, e.employee_id, e.manager_id, d.department_name
FROM employees e JOIN departments d ON (e.department_id=d.department_id)
WHERE e.job_id !=’IT_PROG’
START WITH e.manager_id IS NULL
CONNECT BY PRIOR e.employee_id=e.manager_id AND e.last_name != ‘De Haan’;

4.
SELECT e.last_name, e.employee_id, e.manager_id, d.department_name
FROM employees e JOIN departments d ON (e.department_id=d.department_Id)
WHERE last_name != ‘Chen’
START WITH e.manager_id = (SELECT manager_id FROM employees WHERE last_name=’Chen’)
CONNECT BY PRIOR e.employee_id=e.manager_id;

5.
SELECT e.last_name, e.employee_id, e.manager_id, d.department_name, j.job_title
FROM employees e JOIN departments d ON (d.department_id=e.department_id)
JOIN jobs j ON (j.job_id=e.job_id)
WHERE e.department_id = (SELECT department_id FROM employees WHERE last_name=’Zlotkey’)
START WITH e.manager_id = (SELECT manager_id FROM employees WHERE last_name=’Zlotkey’)
CONNECT BY PRIOR e.employee_id=e.manager_id;

6.
SELECT e.last_name, e.employee_id, e.manager_id, d.department_name, j.job_title
FROM employees e JOIN departments d ON (d.department_id=e.department_id)
JOIN jobs j ON (j.job_id=e.job_id)
WHERE (d.department_id,j.job_id) = (SELECT department_id, job_id FROM employees WHERE last_name=’Vargas’)
START WITH e.manager_id = (SELECT manager_id FROM employees WHERE last_name=’Vargas’) CONNECT BY PRIOR e.employee_id=e.manager_id;