Databas – Part III
7.25 Create a view consisting of the Employee and Department tables without the address, DOB,
and sex attributes.
7.26 Create a view consisting of the attributes empNo, fName, lName, projName, and hoursWorked
attributes.
7.27 Consider the following view defined on the Projects schema:
CREATE VIEW EmpProject(empNo, projNo, totalHours)
AS SELECT w.empNo, w.projNo, SUM(hoursWorked)
FROM Employee e, Project p, WorksOn w
WHERE e.empNo _ w.empNo AND p.projNo _ w.projNo
GROUP BY w.empNo, w.projNo;
(a) SELECT *
General
7.28 Consider the following table:
which represents the cost negotiated under each contract for a part (a part may have a different
price under each contract). Now consider the following view ExpensiveParts, which
contains the distinct part numbers for parts that cost more than £1000: