TOPIC 2
Database Systems: Design, Implementation, and Management, 14e Notes
Chapter 2: Data Models
This chapter outlines the essential concepts in data modeling, the components of data models, and how data models have evolved over time.
Chapter Objectives
- By the end of this chapter, students should be able to:
- Discuss data modeling and its importance.
- Describe the basic building blocks of data modeling.
- Define business rules and their role in database design.
- Understand the evolution of major data models.
- List emerging alternative data models and their applications.
- Explain the classification of data models by their level of abstraction.
1. Data Modeling and Data Models
- Definition of Data Modeling: The process of creating a specific data model for a determined problem domain.
- It is an iterative and progressive process.
- Definition of Data Model: A relatively simple representation of more complex real-world data structures; essentially a blueprint for the database.
1.1. Importance of Data Models
- Data models serve as a communication tool among stakeholders, facilitating a shared understanding of how data should be structured and used.
- Applications are created to manage data and transform it into information, but different stakeholders may view data differently.
- A robust data environment relies on a comprehensive database blueprint guided by an appropriate data model.
- A good database blueprint mitigates differences in data perspectives among programmers, managers, and end users.
- Effective database design is contingent upon developing a suitable data model first.
2. Basic Building Blocks of Data Models (1 of 2)
- Entity: A person, place, thing, concept, or event about which data will be collected and stored.
- Attribute: A characteristic or property of an entity.
- Relationship: An association among entities, which can be categorized into different types:
- One-to-Many (1:M or 1..*): One entity leads to multiple instances of another.
- Many-to-Many (M:N or M:M or ..): Multiple instances of one entity relate to multiple instances of another.
- One-to-One (1:1 or 1..1): One instance of an entity relates to one instance of another.
3. Data Model Basic Building Blocks (2 of 2)
- Constraint: A restriction placed on the data to ensure integrity.
- Constraints are usually expressed in the form of rules:
- An employee's salary must be between 6,000 and 350,000.
- A student's GPA must be between 0.00 and 4.00.
- Each class must have one and only one teacher.
- Constraints are usually expressed in the form of rules:
4. Business Rules
- Definition of Business Rules: These are brief and precise descriptions of policies, procedures, or principles within an organization, applicable to any data-storing institution.
- Business rules help define:
- Entities
- Attributes
- Relationships
- Constraints
- Business rules should be clear and disseminated widely.
- Example Business Rules:
- A customer may generate many invoices.
- An invoice is generated by only one customer.
4.1 Discovering Business Rules
- Sources of business rules include managers, policymakers, department heads, and written documentation like procedures.
- Importance of business rules in database design:
- Standardizes the organization's data perspective.
- Serves as a communication bridge between users and designers.
- Helps designers understand the nature and scope of the data.
- Informs the designer about necessary relationship participation rules and constraints.
4. The Evolution of Data Models
- Data models depict various philosophies regarding databases and their operations, structure, and technology used for implementation.
4.1 Hierarchical and Network Models (1 of 2)
- The Hierarchical Model:
- Developed in the 1960s for managing data in complex manufacturing projects.
- Comprises a structure with multiple levels (segments), where each segment links parent and child records.
- The Network Model:
- Emerged to more effectively depict complex relationships and improve database performance.
4.1 Hierarchical and Network Models (2 of 2)
- Key concepts from the Network Model:
- Schema: Conceptual organization of the entire database from the admin's viewpoint.
- Subschema: A portion of the database perceived by application programs.
- Data Manipulation Language (DML): Environment for managing data within the database.
- Schema Definition Language (DDL): Enables defining schema components.
4.2 The Relational Model (1 of 4)
- Foundation: Based on a mathematical concept called a relation, which is a two-dimensional structure of intersecting rows and columns.
- Each row is termed a tuple, and each column represents an attribute.
- Relational Database Management System (RDBMS):
- Provides the implementation for relational data models, managing the intricacies while presenting data as tables.
4.2 The Relational Model (2 of 4)
Figure 2.1: Linking Relational Tables
(Diagram of relational table linking, usually included in the original materials)
4.2 The Relational Model (3 of 4)
Figure 2.2: A Relational Diagram
(Diagram demonstrating a relational model, usually included in the original materials)
4.2 The Relational Model (4 of 4)
- Components of any SQL-based relational database application:
- End User Interface: Allows user interaction with data.
- Collection of Tables: Presents the data in an understandable manner.
- SQL Engine: Executes all queries or data requests.
4.3 The Entity-Relationship Model (1 of 3)
- The Entity Relationship Model (ERM) is a graphical tool to visualize entities and relationships.
- It integrates with the relational data model to facilitate structured database design.
- Entity Relationship Diagram (ERD): Graphically models these database components.
4.3 The Entity-Relationship Model (2 of 3)
- Key components of the ER model include:
- Entity: Represented by a rectangle in ERDs.
- Attributes: Characteristics describing an entity.
- Relationships: Associations between data elements.
4.3 The Entity-Relationship Model (3 of 3)
Figure 2.3: The ER Model Notations
(Diagram showcasing various ER model notations)
- Types of ER notations:
- Chen notation
- Crow's Foot notation
- Class diagram notation (part of UML)
4.4 The Object-Oriented Model (1 of 3)
- The Object-Oriented Data Model (OODM) combines data and its relationships into a single structure, called an object.
- Basis for Object-Oriented Database Management System (OODBMS).
- OODM is a semantic data model reflecting meaning.
4.4 The Object-Oriented Model (2 of 3)
- OODM Components:
- Object: Abstraction of a real-world entity.
- Attributes: Describe properties of an object.
- Class: Collection of similar objects sharing structure and behavior.
- Methods: Actions performed by the class (e.g., find or change an entity's name).
- Class Hierarchy: Represents parent-child relationships among classes—akin to an upside-down tree.
- Inheritance: Allows objects to inherit attributes/methods from parent classes.
- Typically represented using UML class diagrams.
4.4 The Object-Oriented Model (3 of 3)
Figure 2.4: A Comparison of the OO, UML, and ER Models
(Diagram comparing models; typically included)
4.5 Object/Relational and XML
- The Extended Relational Data Model (ERDM) incorporates features from the object-oriented model into relational structures.
- Object/Relational Database Management System (O/R DBMS): Combines the best of both models for various operational advantages.
- Benefits of O/R DBMSs: Conceptual simplicity, data integrity, user-friendly query language, high performance, and scalability.
- XML: Standard for exchanging structured, semi-structured, and unstructured data efficiently.
4.6 Emerging Data Models: Big Data and NoSQL (1 of 3)
- Internet of Things (IoT): Network of internet-connected devices enabling data exchange/collection.
- IoT catalyzes data growth, generating over 2.5 quintillion bytes daily.
- Big Data: Refers to initiatives aimed at managing vast quantities of sensor and web-generated data to gain insights.
- Big Data characteristics, known as the 3 Vs:
- Volume: The sheer quantity of data generated.
- Velocity: The speed at which data is generated and processed.
- Variety: The different forms of data (structured, unstructured).
4.6 Emerging Data Models: Big Data and NoSQL (2 of 3)
- Prominent Big Data technologies include:
- Hadoop: Java-based, open-source framework for high-speed and fault-tolerant distributed storage and computation.
- Hadoop Distributed File System (HDFS): Designed for managing extensive data at high speeds.
- MapReduce: Open-source API for conducting rapid data analytics.
- NoSQL: Distributed database that efficiently manages structured and unstructured data.
4.6 Emerging Data Models: Big Data and NoSQL (3 of 3)
- Characteristics of NoSQL databases:
- Not rooted in the relational model or SQL.
- Support distributed architectures.
- High scalability, availability, and fault tolerance.
- Handle vast amounts of sparse data.
- Focus on performance over strict transaction consistency.
5. Degrees of Data Abstraction (1 of 2)
- The ANSI SPARC Committee established a framework for data modeling based on abstraction levels:
- External Level: User-facing data views.
- Conceptual Level: Organization-wide data representation.
- Internal Level: DBMS's view of data, incorporating next-level details.
5. Degrees of Data Abstraction (2 of 2)
Figure 2.6: Data Abstraction Levels
(Graphic illustrating levels; typically included)
- A physical model might also be added to explicitly address physical-level implementation details for the internal model.
6. The External Model (1 of 3)
- External Model: Represents the end-users’ perspectives on the data environment, typically customized per business unit.
- ER diagrams illustrate external views, identified by external schemas.
6. The External Model (2 of 3)
Figure 2.7: External Models for Tiny College
(Diagram example; typically included)
6. The External Model (3 of 3)
- Advantages of using external views include:
- Clear identification of specific data required for business units.
- Simplifies the designer's feedback on model adequacy.
- Ensures security constraints in database design.
- Facilitates application program development.
6. The Conceptual Model (1 of 2)
- Conceptual Model: Global overview of the entire database from the organization’s standpoint, often referred to as the conceptual schema.
- Most common conceptual model is the ER model.
- Advantages of the conceptual model:
- Offers a straightforward overview of the data.
- Independent of any hardware/software constraints.
- Logical Design: Process of developing a conceptual data model.
6. The Conceptual Model (2 of 2)
Figure 2.8: Conceptual Model for Tiny College
(Diagram; usually included)
6. The Internal Model (1 of 2)
- Internal Model: Represents how the database is perceived by the DBMS, requiring alignment with the conceptual model’s attributes and constraints.
- Internal Schema: Depicts an internal model representation using database constructs from the selected database management system.
- This model is software dependent, providing logical independence if changed without altering the conceptual model.
6. The Internal Model (2 of 2)
Figure 2.9: Internal Model for Tiny College
(Diagram; usually included)
6. The Physical Model
- Physical Model: Operates at the lowest abstraction level, detailing data storage methods on physical media.
- Requires definitions of storage devices and access methods, making it both software and hardware dependent.
- Physical independence occurs when the physical model changes without impacting the internal representation.
Knowledge Check Activity 2-2
- Question: What does the term "3 Vs" refer to?
- Answer: The 3 Vs refer to the three fundamental characteristics of Big Data databases: volume, velocity, and variety.
Knowledge Check Activity 2-1
- Question: What is a relationship, and what are the three types of relationships?
- Answer: A relationship is an association among (two or more) entities. The three types are:
- One-to-One (1:1)
- One-to-Many (1:M)
- Many-to-Many (M:N or M:M)
Knowledge Check Activity 2-3
- Question: What is logical independence?
- Answer: Logical independence exists when changes can be made to the internal model without affecting the conceptual model.