60 likes | 171 Vues
This document presents a series of database management tasks focused on employees, their salaries, and borrowing behaviors within banking companies. Key tasks include increasing salaries for employees and managers at First Bank Corporation while applying specific conditions for salary raises. It also addresses data deletion for small corporation employees and complex queries to identify companies based on employee metrics and publication borrowing patterns. These analyses utilize relational algebra to demonstrate database query capabilities effectively.
E N D
Opgaven 2 Geert-Jan Houben DB opgaven 2
Example • employee (person-name, street, city) • works (person-name, company-name, salary) • company (company-name, city) • manages (person-name, manager-name) DB opgaven 2
2.7 • a. Give all employees of First Bank Corporation a 10 percent salary raise. • b. 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. • c. Delete all tuples in the works relation for employees of Small Bank Corporation. DB opgaven 2
2.8 • Using the bank example, write relational-algebra queries to find the accounts held by more than two customers in the following ways: • a. Using an aggregate function. • b. Without using any aggregate functions. DB opgaven 2
2.9 • a. Find the company with the most employees. • b. Find the company with the smallest payroll. • c. Find those companies whose employees earn a higher salary, on average, than the average salary at First Bank Corporation. DB opgaven 2
2.11 • employee(empno, name, office, age) • books(isbn, title, authors, publisher) • loan(empno, isbn, date) • a. Find the names of employees who have borrowed a book published by McGraw-Hill. • b. Find the names of employees who have borrowed all books published by McGraw-Hill. • c. Find the names of employees who have borrowed more than five different books published by McGraw-Hill. • d. For each publisher, find the names of employees who have borrowed more than five books of that publisher. DB opgaven 2