490 likes | 1.04k Views
System Analysis and Design. Logical Database Design. Logical and Physical View of Data. Users see the data in different ways (different users have different views of data) These view are examined by the systems analyst, and an overall logical model of the database needs to be developed.
E N D
System Analysis and Design Logical Database Design
Logical and Physical View of Data • Users see the data in different ways (different users have different views of data) • These view are examined by the systems analyst, and an overall logical model of the database needs to be developed. • The logical model of the database must be transformed into a corresponding physical design.
Logical Database Design • Logical database design must be done before physical design. • ER Diagram is enhanced and adjusted to become more effective by normalization.
Normalization • Normalization is the transformation of complex user views and data stores to a set of smaller, stable data structures. • Normalized data structures are more easily maintained than other data structures.
Types of Normalization • First Normal Form (1NF) • Second Normal Form (2NF) • Third Normal Form (3NF) • Boyce-Codd Normal Form (BCNF) • Fourth Normal Form (4NF) • Fifth Normal Form (5NF)
Functional Dependency • Determinant Attribute Dependency Attribute • Determinant attribute usually refers to primary key or identifier • For instance, Emp_ID Enp_Name
An determinant attribute and a dependency attribute Functional Dependency
Functional Dependency • One determinant attribute and many dependency attributes
Functional Dependency • Determinant Attribute Dependency Attribute • A 2-Way Relationship
Functional Dependency • More than one determinant attribute indicate a dependency attribute
Partial Dependency • More than one determinant attribute indicate a dependency attribute • One of the determinant attributes also indicates another dependency attribute that is not an identifier
Transitive Dependency • One determinant attribute and many dependency attributes • One of the dependency attributes indicates a dependency attribute
First Normal Form (1NF) • Attribute with repeating groups
First Normal Form (1NF) • Remove repeating groups
Second Normal Form (2NF) • Prime Attribute VS Non-Prime Attribute • 2NF Rules • The entity must be 1NF • Remove partial dependency
Second Normal Form (2NF) • 1NF with Partial Dependency
Third Normal Form (3NF) • 3NF Rules • The entity must be 2NF • Remove transitive dependency
Relational Database Model • Relations (Tables) • Record of a row “Tuple” • Column
Characteristics of Relations • Atomic data or “single valued” • Same attribute, same domain • No repeated record or tuple • No need to sort attribute • No need to sort record or tuple
Logical Schema Development • Eliminating Composite Attribute • Eliminating Multivalued Attribute • Eliminating External Attribute
Eliminating Composite Attribute • First Method
Eliminating Composite Attribute • Second Method
Relational Schema • Last step of logical database design before building physical database • Relation name refers to the relation’s name • A1, A2, ……, An refer to attributes in that relation
Relational Schema Transforming Relationship into Relation • One-to-One Relationship – Total Participation
Relational Schema Transforming Relationship into Relation • One-to-One Relationship – Partial Participation (A)
Relational Schema Transforming Relationship into Relation • One-to-One Relationship – Partial Participation (B)
Relational Schema Transforming Relationship into Relation • One-to-Many Relationship – Total Participation
Relational Schema Transforming Relationship into Relation • One-to-Many Relationship – Partial Participation
Relational Schema Transforming Relationship into Relation • Many-to-Many Relationship
Relational Schema Transforming Relationship into Relation • N-ary Relationship