Homework2Sol

# 1 findthenamesofallemployeeswhoworkforverizonwireless

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: id, 2 → pid, 3 → cost)( sR3.cost<R2.cost(R3 × R2)) p pid (R2− p pid,costR4) Exercise 3 (Relational Calculi) [20pts] Consider the following database schema: EMPLOYEE (emp_name, address_street, address_city, phone_no) DEPARTMENT (dept_name, mgr_name, mgr_start_date) WORKS_ON (emp_name, industry_name, salary) INDUSTRY (industry_name, location_city) MANAGES (emp_name, mgr_name) Write both the Tuple Relational Calculus expression and Domain Relational Calculus for the following queries. 1. Find the names of all employees who work for ‘Verizon Wireless’ TRC: {t | s WORKS_ON(t[emp_name] s[emp_name] s[industry_name] ' Verizon Wireless' )} DRC: { p | c, s( p, c, s WORKS_ON c ' Verizon Wi reless' )} 2. Find the names, street address, cities, and phone number of residence of all employees who work for Intel and earn more than \$80,000.00 per year TRC: {t | t EMPLOYEE ( s WORKS_ON(s[emp_name] t[emp_name] s[industry_name] ' Intel' s[salary] 80000))} DRC: { p, s, ind | p, ind, s EMPLOYEE indu, sal ( p, indu, sal WORKS_ON indu ' Intel' sal 80000))} 3. Find the names of all employees who live in the same city and on the same street as their managers {t | p EMPLOYEE, q MANAGES, r EMPLOYEE (p[emp_name] q[emp_name] q[mgr_name] r[emp_name] TRC: p[address_street]...
View Full Document

## This note was uploaded on 01/27/2014 for the course COP 5725 taught by Professor Staff during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online