Chapter 1: Databases and Database Users
1
CHAPTER 1: DATABASES AND DATABASE USERS
Answers to Selected Exercises
1.8 – Identify some informal queries and update operations that you would expect to apply to
the database shown in Figure 1.2.
Answer:
(a) (Query) List the names of all students majoring in Computer Science.
(b) (Query) What are the prerequisites of the Database course?
1.9 – What is the difference between controlled and uncontrolled redundancy?
Answer:
Redundancy is when the same fact is stored multiple times in several places in a database.
For example, in Figure 1.5(a) the fact that the name of the student with StudentNumber=8 is
1.10 – Specify all the relationships among the records of the database shown in Figure 1.2.
Answer:
(a) Each SECTION record is related to a COURSE record.
1.11 Give some additional views that may be needed by other user groups for the database
shown in Figure 1.2.
Copyright © 2016 Pearson Education, Inc., Hoboken NJ
1.12 Cite some examples of integrity constraints that you think can apply to the database
shown in Figure 1.2.
Answer:
We give a few constraints expressed in English. Following each constraint, we give its type
in the relational database terminology that will be covered in Chapter 6, for reference
purposes.
(a) The StudentNumber should be unique for each STUDENT record (key constraint).
(b) The CourseNumber should be unique for each COURSE record (key constraint).
1.13 – Give examples of systems in which it may make sense to use traditional file
processing instead of a database approach.
Answer:
2. Small single user application that does not require security (such as a customized
calculator or a personal address and phone book)
4. The students may think of others.
1.14 – Consider Figure 1.2.
a. If the name of the ‘CS’ (Computer Science) Department changes to ‘CSSE’ (Computer
Science and Software Engineering) Department and the corresponding prefix for the
course number also changes, identify the columns in the database that would need
to be updated.
b. Can you restructure the columns in COURSE, SECTION, and PREREQUISITE tables so
that only one column will need to be updated?
Answer:
Chapter 1: Databases and Database Users
3
a. The following columns will need to be updated.
Table
Column(s)
STUDENT
Major
COURSE
CourseNumber and Department
SECTION
CourseNumber
PREREQUISITE
CourseNumber and PrerequisiteNumber
b. You should split the following columns into two columns:
Table
Column
Split Columns
COURSE
CourseNumber
CourseDept and CourseNum
SECTION
CourseNumber
CourseDept and CourseNum
PREREQUISITE
CourseNumber
CourseDept and CourseNum
PREREQUISITE
PrerequisiteNumber
PreReqDept and PreReqNum