Lecture 2 Data Models
Learning Objectives Why data models are important About the basic data-modeling building blocks What business rules are and how they affect database design How the major data models evolved, and their advantages and disadvantages How data models can be classified by level of abstraction
Data model: Models abstraction of real-world Events DB Model: Represents data structure and relationship Conceptual "What" is represented Implementation "How" represented
CONCEPTUAL 3 types of associations:..one to many..many to many..one-to-one
Implementation How data is represented in database ?
Types of Data Models Hierarchical (see page 33) Network (see page 34)..Simple..Complex Relational (page 36) Object-Oriented (page 41)
Hierarchical DB Model ex: IMS by IBM basic unit is SEGMENT (similar to a record) root..a child can have at the most one parent..a parent can have many children navigation path.pre order traversing.post order traversing
Advantages/Disadvantages Advtg: allows data sharing data independence data integrity efficient for DISADVTG: need to know some PHYSICAL level details data that do not conform to 1:m complex and less flexible need to provide navigational path ad-hoc capabilities limited
Network DB model SET OWNER and MEMBERS
Advantages/Disadvantages Advantages:.m:n easy to implement.data integrity is maintained.data independence Disadvantages:.Complex.no structural independence.navigation path
Relational Model: (p 36) Linking relational tables (page 37) Typically done through primary and foreign key Read the examples carefully
Object-Oriented Model: (page 41) Objects are defined (similar to entities) Objects contain data and procedures Objects can FIT with other objects Objects are reusable Objects have INHERITANCE property
ER Data Model (page 38) Define Entities Attributes Relationships
Degree of DATA abstraction Conceptual IT (hardware/software independent) Internal (DBMS dependent) External (end user orientation) Physical Model (actual implementation)
Supplemental reading: