1 / 6

Opgaven 2

Opgaven 2. Geert-Jan Houben. Example. employee ( person-name , street , city ) works ( person-name , company-name , salary ) company ( company-name , city ) manages ( person-name , manager-name ). 2.7. a. Give all employees of First Bank Corporation a 10 percent salary raise.

Download Presentation

Opgaven 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Opgaven 2 Geert-Jan Houben DB opgaven 2

  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

  3. 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

  4. 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

  5. 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

  6. 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

More Related