You are on page 1of 4

Student ID: N0032836167

Name: Shanjida Ali


Course Code: MIS 560
Course Name: Database Management Systems
Week: 03

The Crow foot notation ERD to represent the given business operations can be depicted as given below:

Answer for Figure P3.17 is given below:


17.
TABLE PRIMARY KEY FOREIGN KEY(S)

TRUCK TRUCK_NUM BASE_CODE, TYPE_CODE


BASE BASE_CODE NONE
TYPE TYPE_CODE NONE

Note: The TRUCK_SERIAL_NUM could also be designated as the primary key. Because the
TRUCK_NUM was designated to be the primary key, TRUCK_SERIAL_NUM is an example of a
candidate key.
18.
Yes. The tables exhibit entity integrity. The explanation is given below:
TABLE PRIMARY KEY ENTITY INTEGRITY EXPLANATION
TRUCK TRUCK_NUM YES The TRUCK_NUM values in the
TRUCK table are all unique and
there are no nulls.
BASE BASE_CODE YES The BASE_CODE values in the BASE
table are all unique and there are no
nulls.
TYPE TYPE_CODE YES The TYPE_CODE values in the TYPE
table are all unique and there are no
nulls.

19.
No. The tables do not exhibit referential integrity.
The table TRUCK exhibits referential integrity. The referential integrity ensures that the foreign key must
always reference an existing primary key or contain a null value. The foreign key of the TRUCK table
points to the existing primary key of the TYPE table. The table BASE and TYPE doesn’t have the foreign
key.

TABLE FOREIGN REFERENTIAL EXPLANATION


KEY(S) INTEGRITY
TRUCK BASE_CODE, YES The BASE_CODE values in the
TYPE_CODE TRUCK table reference existing
BASE_CODE values in the BASE
table or they are null. (The TRUCK
table's BASE_CODE is null for
TRUCK_NUM = 1004.) Also, the
TYPE_CODE values in the TRUCK
table reference existing TYPE_CODE
values in the TYPE table

BASE NONE NA
TYPE NONE NA

Here, the tables BASE and TYPE do not have foreign key values. Therefore, the tables do not exhibit
referential integrity.
20.
The candidate key of the TRUCK table is TRUCK_SERIAL_NUM.
Explanation:
The candidate key refers to a column, or a set of columns uniquely identifies a record without referring to
other data. A table can have more than one candidate key. The candidate key is unique and refers to the
primary key. As the TRUCK_NUM is the primary key of the TRUCK table, the TRUCK_SERIAL_NUM
can be a primary key. So, it can be candidate key. Therefore, the candidate key of the TRUCK table is
TRUCK_SERIAL_NUM.
21.
TABLE SUPER KEY SECONDARY KEY
TRUCK TRUCK_NUM + TRUCK_MILES BASE_CODE + TYPE_CODE
(This secondary key is likely to produce
TRUCK_NUM + TRUCK_MILES +
multiple matches, but it is not likely that
TRUCK_BUY_DATE
end-users will know attribute values
such as TRUCK_MILES or
TRUCK_NUM + TRUCK_MILES +
TRUCK_BUY_DATE. Therefore, the
TRUCK_BUY_DATE + TYPE_CODE
selected attributes create a reasonable
secondary key.)
BASE BASE_CODE + BASE_CITY BASE_CITY + BASE_STATE
(This is a very effective secondary key
BASE_CODE + BASE_CITY + BASE_CITY
since it is not likely that a state contains
two cities with the same name.)
TYPE TYPE_CODE + TYPE_DESCRIPTION TYPE_DESCRIPTION

22.
ERD for this database is shown in below:

Figure 1. The Ch03_TransCo Crow's Foot ERD

23.

The relational diagram for this database is given below:

Figure 2. The Ch03_TransCo Relational Diagram

You might also like