Tarea 4
 

Fecha de Entrega: Lunes 22 de Marzo (en clase)
Tipo de Entrega: papel

Crear en álgebra relacional las siguientes consultas, (Ejercicios 3.5, 3.8 y 3.10 libro Silberschatz) en base al siguiente esquema:

employee (person-name, street,city)
works (person-name, company-name, salary)
company (company-name, city)
manages (person-name, manager-name)

  1. Find the names of all employees who work for First Bank Corporation
  2. Find the names and cities of residence of all employees who work for First Bank Corporation
  3. Find the names, street addresses, and cities of residence of all employees who work for First Bank Corporation and earn more than $10,000 per annum.
  4. Find the names of all employees in this database who live in the same city as the company for which they work.
  5. Find the names of all employees who live in the same city and on the same street as do their managers.
  6. Find the names of all employees in this database who do not work for First Bank Corporation.
  7. Find the names of all employees who earn more than every employee of Small Bank Corporation.
  8. Assume the companies may be located in several cities. Find all companies located in every city in which Small Bank Corporation is located.
  9. Modify the database so that Jones now lives in Newtown
  10. Give all employees of First Bank Corporation a 10 percent salary raise.
  11. Give all managers in this database a 10 percent salary raise, unless the salary would be greater than $100,000. In such cases, give only a 3 percent raise.
  12. Delete all tuples in the works relation for employees of Small Bank Corporation.
  13. Find the company with the most employees.
  14. Find the company with the smallest payroll.
  15. Find those companies whose employees earn a higher salary, on average, than the average salary at First Bank Corporation.

Detalles de la entrega