0% found this document useful (0 votes)
2 views

TALLER 7

The document contains a series of SQL queries related to employee data retrieval from a database. Each query focuses on different conditions such as department, salary comparisons, and employee details. The results for each query are indicated but not provided in the document.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

TALLER 7

The document contains a series of SQL queries related to employee data retrieval from a database. Each query focuses on different conditions such as department, salary comparisons, and employee details. The results for each query are indicated but not provided in the document.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 5

TALLER 7

PUNTO 1:

CONSULTA: SELECT last_name, hire_Date FROM employees WHERE department_id = (SELECT


department_id From employees WHERE last_name = '&&Nombre') AND last_name <>
'&Nombre' ;

RESULTADO:

PUNTO 2:

CONSULTA: SELECT employee_id,last_name, salary FROM EMPLOYEES where salary > (SELECT
AVG(salary) from employees);

RESULTADO:
PUNTO 3:

CONSULTA: SELECT employee_id, last_name from employees WHERE department_id IN (select


department_id from employees where last_name like '%u%');

RESULTADO:

PUNTO 4:
CONSULTA: SELECT emp.last_name, emp.department_id, emp.job_id FROM employees emp

INNER JOIN departments dp ON dp.department_id = emp.department_id WHERE dp.location_id =


'1700';

SELECT emp.last_name, emp.department_id, emp.job_id FROM employees emp

INNER JOIN departments dp ON dp.department_id = emp.department_id WHERE dp.location_id =


'&loc_id';

RESULTADO:

PUNTO 5:

CONSULTA: SELECT LAST_NAME, SALARY FROM EMPLOYEES WHERE manager_id = (SELECT


EMPLOYEE_ID FROM EMPLOYEES WHERE last_name = 'King');

RESULTADO:
PUNTO 6:

CONSULTA: SELECT department_id,last_name, job_id from employees WHERE department_id =


(select department_id from departments where department_name = 'Executive')

RESULTADO:

PUNTO 7:

CONSULTA: SELECT employee_id, last_name, salary from employees WHERE department_id IN


(select department_id from employees where last_name like '%u%') and salary > (select
avg(salary) salary from employees);

RESULTADO:

You might also like