3
DB211 – Database Design () Instructor: Unit 3, Assignment A Student: Assignment Instructions: Solve Chapter 3 Problems 17-23 / Pages 101-102. Please use Microsoft Visio for the ERD. For more on how to use Visio for the assignment, see Unit 3 Instructional Videos! Submit your assignment file using the link above (due Sunday of this unit, 40 points) Assignment (Completed work and answers in RED text): 17. For each table, identify the primary key and the foreign key(s). If a table does not have a foreign key, write None in the space provided. TABLE PRIMARY KEY FOREIGN KEY(S) TRUCK TRUCK_NUM BASE_CODE, TYPE_CODE BASE BASE_CODE NONE TYPE TYPE_CODE NONE

DB211 - Unit 3 Assignment A

Embed Size (px)

Citation preview

Page 1: DB211 - Unit 3 Assignment A

DB211 – Database Design () Instructor: Unit 3, Assignment A Student: Assignment Instructions: Solve Chapter 3 Problems 17-23 / Pages 101-102. Please use Microsoft Visio for the ERD. For more on how to use Visio for the assignment, see Unit 3 Instructional Videos! Submit your assignment file using the link above (due Sunday of this unit, 40 points) Assignment (Completed work and answers in RED text):

17. For each table, identify the primary key and the foreign key(s). If a table does not have a foreign key,

write None in the space provided. TABLE PRIMARY KEY FOREIGN KEY(S)

TRUCK TRUCK_NUM BASE_CODE, TYPE_CODE

BASE BASE_CODE NONE

TYPE TYPE_CODE NONE

Page 2: DB211 - Unit 3 Assignment A

18. Do the tables exhibit entity integrity? Answer yes or no, and then explain your answer. TABLE ENTITY INTEGRITY EXPLANATION

TRUCK YES Each TRUCK_NUM value is a unique value and there aren’t any NULL values. However, reference to the BASE_CODE may produce a null value that may throw an error. Additional NULL value checks will need to be included.

BASE YES Each BASE_CODE value is a unique value and there aren’t any NULL values.

TYPE YES Each TYPE_CODE value is a unique value and there aren’t any NULL values.

19. Do the tables exhibit referential integrity? Answer yes or no, and then explain your answer. Write NA (Not

Applicable) if the table does not have a foreign key. TABLE REFERENTIAL INTEGRITY EXPLANATION

TRUCK YES Even though BASE_CODE has null values in it which produces a NULL value, the values contained in it are valid. Additional coding will be needed to pass over any NULL values encountered. TYPE_CODE is valid.

BASE NA NONE

TYPE NA NONE

20. Identify the TRUCK table’s candidate key(s).

• TRUCK_SERIAL_NUM and TRUCK_NUM, although TRUCK_NUM is really the Primary Key as

well.

21. For each table, identify a superkey and a secondary key. TABLE SUPERKEY SECONDARY KEY

TRUCK TRUCK_NUM, TRUCK_SERIAL_NUM BASE_CODE, TYPE_CODE, TRUCK_BUY_DATE

BASE BASE_CODE BASE_CITY, BASE_STATE, BASE_AREA_CODE, BASE_PHONE, BASE_MANAGER

TYPE TYPE_CODE TYPE_DESCRIPTION

Page 3: DB211 - Unit 3 Assignment A

22. Create the ERD for this database.

23. Create the relational diagram for this database.