Chapter Three – Structured Query Language
© 2018 Pearson Education, Inc. Page 57 of 154
L. How many projects are being run by each department? Be sure to display each
DepartmentName and to assign an appropriate column name to the computed
results.
/***** Question L – SQL-Query-AWE-3-1-L.sql **************/
SELECT Department, COUNT(*) AS NumberOfDeptProjects
FROM PROJECT
3.60 Using the SQL DBMS of your choice, complete steps A through E in exercise AW.3.3,
but exclude step F.
WP has decided to keep track of computers used by the employees. In order to do this,
two new tables will be added to the database. The schema for these tables, as related
to the existing EMPLOYEE table, is (note that we are purposely excluding the recursive
relationship in EMPLOYEE at this time):
EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor,
OfficePhone, EmailAddress)
The referential integrity constraints are:
EmployeeNumber is a surrogate key and never changes. Employee records are never
deleted from the database. SerialNumber is not a surrogate key because it is not
generated by the database. However, a computer’s SerialNumber never changes, and,
therefore, there is no need to cascade updates. When a computer is at its end of life,