Module 2
Module 2
Data Models
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 1
Chapter Objectives
3. Define what business rules are and how they influence database design
5. List emerging alternative data models and the needs they fulfill
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 2
Data Modeling and Data Models
• Data modeling refers to the process of creating a specific data model for a
determined problem domain
− Data modeling is an iterative, progressive process
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 3
The Importance of Data Models
• Applications are created to manage data and to help transform data into information,
but data is viewed in different ways by different people
• When a good database blueprint is available, it does not matter that an applications
programmer’s view of the data is different from that of the manager or the end user
• You will be unlikely to create a good database without first creating an appropriate
data model
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 4
Data Model Basic Building Blocks (1 of 2)
• An entity is a person, place, thing, concept, or event about which data will be
collected and stored
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 5
Data Model Basic Building Blocks (2 of 2)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 6
Knowledge Check Activity 2-1
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 7
Knowledge Check Activity 2-1: Answer
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 8
Business Rules
• Business rules are used to define entities, attributes, relationships, and constraints
− They must be easy to understand and widely disseminated
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 9
Discovering Business Rules
• The main sources of business rules are company managers, policy makers,
department managers, and written documentation such as company procedures
• Business rules are essential to database design due to the following reasons:
− It helps to standardize the company’s view of data
− It can be a communication tool between users and designers
− It allows the designer to understand the nature, role, and scope of the data
− It allows the designer to understand business processes
− It allows the designer to develop appropriate relationship participation rules and
constraints and to create an accurate data model
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 10
Translating Business Rules into Data Model
Components
• For example, the business rule “a customer may generate many invoices” contains
two nouns and a verb that associates the nouns
• The rule above is complemented by the business rule “an invoice is generated by only
one customer”
− The relationship is one-to-many (1:M)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 11
Naming Conventions
• Entity names should be descriptive of the objects in the business environment and
use technology that is familiar to the users
• It is good practice to prefix the name of an attribute with the name or abbreviation of
the entity in which it occurs
− For example, in the CUSTOMER entity, customer’s credit limit may be called
CUS_CREDIT_LIMIT
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 12
The Evolution of Data Models
• Data models represent schools of thought as to what a database is, what it should
do, the types of structures that it should employ, and the technology that would be
used to implement these structures
• This section gives an overview of the major data models in roughly chronological
order
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 13
Hierarchical and Network Models (1 of 2)
• The hierarchical model was developed in the 1960s to manage large amounts of data
for complex manufacturing projects
− The hierarchical structure contains levels, or segments
• A higher layer is perceived as the parent of the segment directly beneath it, which is
called the child
• The network model was created to represent complex data relationships more
effectively than the hierarchical model, to improve database performance, and to
impose a database standard
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 14
Hierarchical and Network Models (2 of 2)
• The following database concepts that emerged with the network model are still used
by modern data models:
− The schema is the conceptual organization of the entire database as viewed by
the database administrator
− The subschema defines the portion of the database “seen” by the application
programs that produce the desired information from the data within the database
− The data manipulation language (DML) defines the environment in which data can
be managed and is used to work with the data in the database
− A schema data definition language (DDL) enables the database administrator to
define the schema components
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 15
Extra Credit
DDL:
• CREATE TABLE table_name (column1 datatype, ....);
DML:
• INSERT INTO table_name VALUES (value1, value2, value3, ...);
Extra Credit:
• Create a table called student_parents
• Insert the firstname, lastname, month_of_birth, and address of each parent.
• Share a screenshot of the create and insert statements as well as the resulting table.
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 16
The Relational Model (1 of 4)
• The RDBMS manages all of the details, while the users sees a collection of tables in
which the data is stored
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 17
The Relational Model (2 of 4)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 18
The Relational Model (3 of 4)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 19
The Relational Model (4 of 4)
• Any SQL-based relational database application involves the following three parts:
− The end user interface – the interface allows the end user to interact with the
data
− A collection of tables stored in the database – the tables “present” the data to
the end user in a way that is easy to understand
− SQL engine – the SQL engine executes all queries or data requests
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 20
The Entity Relationship Model (1 of 3)
• Database designers prefer to use a graphical tool in which entities and their
relationships are pictured
− The entity relationship (ER) model (ERM) was developed to do just that
• The relational data model and ERM combined to provide the foundation for tightly
structured database design
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 21
The Entity Relationship Model (2 of 3)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 22
The Entity Relationship Model (3 of 3)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 24
The Object-Oriented Model (2 of 3)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 25
The Object-Oriented Model (3 of 3)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 26
Object/Relational and XML
• The extended relational data model (ERDM) adds many of the OO model’s features
within the simpler relational database structure
• The success of the O/R DBMSs can be attributed to the model’s conceptual
simplicity, data integrity, easy-to-use query language, high transaction performance,
high availability, security, scalability, and expandability
• The Extensible Markup Language (XML) has emerged as a standard for the efficient
and effective exchange of structured, semistructured, and unstructured data
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 27
Emerging Data Models: Big Data and NoSQL
(1 of 3)
• Internet of Things (IoT) is a web of Internet-connected devices exchanging and
collecting data
− The IoT has accelerated the rate of data growth so that about 2.5 quintillion bytes
of data are created daily
• Big Data refers to a movement to find new and better ways to manage large amounts
of web- and sensor-generated data and derive business insight from it
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 28
Emerging Data Models: Big Data and NoSQL
(2 of 3)
• Some of the most frequently used Big Data technologies are Hadoop and NoSQL
databases:
− Hadoop is a Java-based, open-source, high-speed, fault-tolerant distributed
storage and computational framework
− Hadoop Distributed File System (HDFS) is a highly distributed, fault-tolerant file
storage system designed to manage large amounts of data at high speeds
− MapReduce is an open-source application programming interface (API) that
provides fast data analytics services
− NoSQL is a large-scale distributed database system that stores structured and
unstructured data in efficient ways
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 29
Emerging Data Models: Big Data and NoSQL
(3 of 3)
• NoSQL databases have the following general characteristics:
− They are not based on the relational model and SQL
− They support highly distributed database architectures
− They provide high scalability, high availability, and fault tolerance
− They support very large amounts of sparse data
− They are geared toward performance rather than transaction consistency
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 30
Data Models: A Summary
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 31
Knowledge Check Activity 2-2
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 32
Knowledge Check Activity 2-2: Answer
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 33
Degrees of Data Abstraction (1 of 2)
• The three levels of data abstraction are external, conceptual, and internal
• In Figure 2.6, on the following slide, the ANSI/SPARC framework has been expanded
with the addition of a physical model to explicitly address physical-level
implementation details of the internal model
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 34
Degrees of Data Abstraction (2 of 2)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 35
The External Model (1 of 3)
• The external model is the end users’ view of the data environment
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 36
The External Model (2 of 3)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 37
The External Model (3 of 3)
• The use of external views that represent subsets of the database has some important
advantages:
− It is easy to identify specific data required to support each business unit
− It makes the designer’s job easy by providing feedback about the model’s
adequacy
− It helps to ensure security constraints in the database design
− It makes application program development much simpler
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 38
The Conceptual Model (1 of 2)
• The conceptual model represents a global view of the entire database by the entire
organization
• Also known as a conceptual schema, it is the basis for the identification and high-
level description of the main data objects
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 39
The Conceptual Model (2 of 2)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 40
The Internal Model (1 of 2)
• The internal model is the representation of the database as “seen” by the DBMS
− The internal model requires a designer to match the conceptual model’s
characteristics and constraints to those of the selected implementation model
• When you change the internal model without affecting the conceptual model, you
have logical independence
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 41
The Internal Model (2 of 2)
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 42
The Physical Model
• The physical model operates at the lowest level of abstraction, describing the way
data is saved on storage media
• The physical model requires the definition of both the physical storage devices and
the (physical) access methods required to reach the data within those storage
devices
− This means the physical model is both software and hardware dependent
• When you can change the physical model without affecting the internal model, you
have physical independence
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 43
Knowledge Check Activity 2-3
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 44
Knowledge Check Activity 2-3: Answer
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 45
Summary
Now that the lesson has ended, you should be able to:
3. Define what business rules are and how they influence database design
5. List emerging alternative data models and the needs they fulfill
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 46