Repo Report rtar ar en qué qué paí país s se se enc encue uent ntra ra loca locali liza zado do el depa depart rtam amen ento to de vent ventas as (Sal (Sale e SELECT department_name "Departamento" ,city "Ciudad" ,country_name "Pais" FROM locations,countries,departments WHERE locations.country_id=countries.country_id AND departments.location_id = locations.location_id AND department_name = 'Sales';
Departamento Ciudad ------------------------------ -----------------------------Pais ---------------------------------------Sales Oxford United Kingdom 3) SQL> 2 3 4 5
Repo Report rtar ar los los per perío íodo dos s lab labor oral ales es que que ha ha ten tenid ido o el el emp emple lead ado o Jon Jonat atho hon n Tay Taylo lor. r. SELECT last_name||' '||first_name Nombre, start_date Inicio, end_date Fin FROM employees, job_history WHERE employees.employee_id = job_history.employee_id AND first_name='Jonathon' AND last_name = 'Taylor';
NOMBRE ---------------------------------------------Taylor Jonathon Taylor Jonathon
INICIO -------24/03/98 01/01/99
FIN -------31/12/98 31/12/99
4) Repo Report rtar ar los los nomb nombre res s de los los empl emplea eado dos s que que se encu encuen entr tran an trab trabaj ajan ando do en lo s departamentos ubicados en Seattle. SQL> 2 3 4 5 6
SELECT last_name||' '||first_name Nombre, department_name Departamento, city Ciudad FROM employees, departments, locations WHERE employees.department_id = departments.department_id AND departments.location_id = locations.location_id AND city = 'Seattle';
NOMBRE DEPARTAMENTO ---------------------------------------------- -----------------------------CIUDAD
-----------------------------Whalen Jennifer Seattle
Administration
Raphaely Den Seattle
Purchasing
Khoo Alexander Seattle
Purchasing
NOMBRE DEPARTAMENTO ---------------------------------------------- -----------------------------CIUDAD -----------------------------Baida Shelli Purchasing Seattle Tobias Sigal Seattle
Purchasing
Himuro Guy Seattle
Purchasing
NOMBRE DEPARTAMENTO ---------------------------------------------- -----------------------------CIUDAD -----------------------------Colmenares Karen Purchasing Seattle King Steven Seattle
Executive
Kochhar Neena Seattle
Executive
NOMBRE DEPARTAMENTO ---------------------------------------------- -----------------------------CIUDAD -----------------------------De Haan Lex Executive Seattle Greenberg Nancy Seattle
Finance
Faviet Daniel Seattle
Finance
NOMBRE DEPARTAMENTO ---------------------------------------------- -----------------------------CIUDAD -----------------------------Chen John Finance Seattle Sciarra Ismael Seattle
Finance
Urman Jose Manuel
Finance
Seattle NOMBRE DEPARTAMENTO ---------------------------------------------- -----------------------------CIUDAD -----------------------------Popp Luis Finance Seattle Higgins Shelley Seattle
Accounting
Gietz William Seattle
Accounting
5) Reportar la clave y el nombre de la región a la que e Seattle. SQL> 2 3 4 5
pertenece la ciudad d
SELECT city Ciudad, regions.region_id Clave, region_name Region FROM locations, regions, countries WHERE locations.country_id = countries.country_id AND countries.region_id = regions.region_id AND city = 'Seattle';
CIUDAD CLAVE REGION ------------------------------ ---------- ------------------------Seattle 2 Americas 6)
Reportar cuántos períodos laboral(es) ha tenido el empleado Neena Koochar .
SQL> SELECT COUNT(start_date) "Periodos Laborales" 2 FROM job_history 3 WHERE employee_id = 4 (SELECT employee_id FROM employees 5 WHERE first_name = 'Neena' AND last_name = 'Kochhar'); Periodos Laborales -----------------2