Download presentation
Presentation is loading. Please wait.
1
Revised: 2 April 2004 Fred Swartz
Database - Design Revised: 2 April 2004 Fred Swartz
2
DB - Tables = Entities = Nouns
Problem "nouns" are represented as tables. Each row in a distinct instance. row = record = instance Each column is an attribute. column = attribute = property = field There are relationships between tables. Relationships are implemented with foreign-primary keys.
3
DB - Relationships 1:N One-to-many relationships.
This is the standard type of relationship implemented with a foreign key on the many side pointing to a primary key on the one side. M:N Many-to-many relationship. These are common, but must be implemented in a relational database with a "bridging" or connection table that contains pairs of keys. 1:1 One-to-one relationship Not common, but used in superset/subsets.
4
DB - Entity-Relationship Approach
Represent each entity as a table. Each row is one entity instance. Represent each attribute as a column. Repeating attributes must be in sep. table. Each row must have a primary key. Relationships implemented with keys. Multiplicity determined by business rules. M:N relationships need bridging table. Normalize to at least 3rd Normal Form.
5
DB - Normalization Normalization "forms" are guidelines to building effective relational databases. Normalizing often requires creating new tables and foreign keys. Areas normalization addresses Repeating values (make separate table) Computed fields (compute dynamically) Correct key and attribute identification. Eliminate redundant data Each level includes all previous levels.
6
DB - First Normal Form Each value must be "atomic".
Different values should be separated. Eg, City and state. No repeating values in an attribute. Don't store a list of values in a column Don't use multiple columns for repeating values. Put repeating values in separate table with a foreign key to identify what they belong to.
7
DB - Second Normal Form Only applies to tables with composite primary keys (more than one column). Every non-key attribute must depend on the entire primary key. It can not be a fact about only some of the primary key columns.
8
DB - Third Normal Form Each non-key column must be a fact about the key column(s). "The key, the whole key, and nothing but the key".
9
DB - More Normal Forms Fourth Normal Form Fifth Normal From
See pets and cars example. Fifth Normal From Boyce-Codd Normal Form
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.