DESIGNING RELATIONAL DATABASES
Database Design
-
is a component of a much larger system development process that involves
extensive analysis of user needs
6 Phases of Database Design (collectively known as view modeling):
1. Identify entities.
2. Construct a data model showing entity associations.
3. Add primary keys and attributes to the model.
4. Normalize the data model and add foreign keys.
5. Construct the physical database.
6. Prepare the user views.
1. Identify Entities
Entities
- are things which about which the organization wishes to capture
data
- are represented as nouns in a system description
2 Conditions need to be met to be valid entities:
a. An entity must consist of two or more occurrences.
b. An entity must contribute at least one attribute that is not provided
through other entities.
2. Construct a Data Model Showing Entity Associations.
Associations
- represent business rules that impact the structure of the database
tables
Designers need to understand the organizations business rules and the
specific needs of individual users.
Document with an ER Diagram
3. Add Primary Keys and Attributes to the Model.
Add Primary Keys
- Select a primary key that logically defines the nonkey attributes
and uniquely identifies each occurrence in the entity
- Sequential codes, block codes, group codes, alphabetic codes and
mnemonic codes
Add Attributes
- Every attribute should appear directly or indirectly in one or more
user views
4. Normalize the Data Model and Add Foreign Keys.
Normalization Issues
Repeating Group Data
- The existence of multiple values for a particular attribute in a
specific record
Partial Dependencies
Occurs when one or more nonkey attributes are dependent on
(defined by) only part of the primary key, rather than the whole
key
Transitive Dependencies
- Occurs in a table where nonkey attributes are dependent on
another nonkey attribute and independent of the tables primary
key