Presentation is loading. Please wait.

Presentation is loading. Please wait.

27-2-20061DB opgaven 2 Opgaven 2 Geert-Jan Houben.

Similar presentations


Presentation on theme: "27-2-20061DB opgaven 2 Opgaven 2 Geert-Jan Houben."— Presentation transcript:

1 27-2-20061DB opgaven 2 Opgaven 2 Geert-Jan Houben

2 Pag. 27-2-20062 DB opgaven 2 Example employee (person-name, street, city) works (person-name, company-name, salary) company (company-name, city) manages (person-name, manager-name)

3 Pag. 27-2-20063 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.

4 Pag. 27-2-20064 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.

5 Pag. 27-2-20065 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.

6 Pag. 27-2-20066 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.


Download ppt "27-2-20061DB opgaven 2 Opgaven 2 Geert-Jan Houben."

Similar presentations


Ads by Google