38 0 21KB
1. Gasiti numele angajatului si numele functiei pe care o ocupa, pentru acei angajati care nu au manageri. select first_name, j.job_title,last_name,manager_id from employees e, jobs j where e.job_id=j.job_id and manager_id is null 2. Gasiti numele si salariul lunar al angajatilor care primesc intre 5000 si 12000 si care lucreaza in departamentul 50 sau 20. Etichetati coloanele astfel: “Angajat” si “Salariu lunar”si afisati inregistrarile in ordinea specificata pentryu departamente (intai 50 si apoi 20). select first_name||' '||last_name as Angajat, salary as "Salariu lunar", department_id from employees where salary>5000 and salary (select avg(salary) from employees); 6. Scrieti o interogare care afiseaza numele si salariul angajatilor subordonati lui King select e.last_name, e.salary from employees e, employees e1 where e.manager_id=e1.employee_id and e1.last_name='King'; 7. Scrieti o interogare care afiseaza toti angajatii care castiga mai multdecat oricare din
angajatii departamentului cu identificatorul 60. select last_name, first_name from employees where salary > any (select salary from employees where department_id=60 ) 8. Scrieti o interogare care afiseaza toti angajatii care castiga mai multdecat toti angajatii departamentului cu identificatorul 60. select last_name, first_name from employees where salary > all (select salary from employees where department_id=60 ) 9. Creati o lista cu angajatii care ocupa, cel putin pentru a doua oara, aceeasi functie. (utilizati operatorul intersectie) SELECT e.employee_id, last_name, e.job_id FROM employees e WHERE 1