Professional Documents
Culture Documents
Data Models
©2017 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part, except for use as permitted in a license distributed with a
certain product or service or otherwise on a password-protected website or school-approved learning management system for classroom use.
Learning Objectives
• About data modeling and why data models are
important
• About the basic data-modeling building blocks
• What business rules are and how they influence
database design
• How the major data models evolved
• How data models can be classified by their level of
abstraction
2
Data Modeling & Data
Models (cont…)
3
Data Modeling & Data
Models
Data model
• Represent data structures and their
characteristics, relations, constraints,
transformations, and other constructs with the
purpose of supporting a specific problem domain
• Blueprint with all the instructions to develop a
4
database that meets all end-user requirements.
Importance of Data Models
5
Data Model Basic Building
Blocks
6
Business Rules
Examples:
Describe main and • A customer may
distinguishing generate many
characteristics of the invoices
data • An invoice is
generated by only
one customer
7
Business Rules (cont…)
Reminder:
Business rules establish the basic building blocks of the data
model (e.g. entities, attributes, relationships, and constraints)
More examples:
• Relationships:
• A customer may rent many bicycles.
• One bicycle is rented by only one customer.
• Constraints:
• A student may register for a maximum of four subjects.
• A training session cannot be scheduled for fewer than
10 employees or for more than 20 employees.
8
Business Rules (cont…)
Discovering Business Rules (Sources and Business
Rules)
9
Business Rules (cont…)
Importance of Identifying Business Rules
• Help standardize company’s view of data
• Communications tool between users and
designers
• Allow designer to:
• Understand the nature, role, scope of data, and
business processes
• Develop appropriate relationship participation
rules and constraints
• Create an accurate data model
10
Business Rules (cont…)
Translating Business Rules into Data Model
Components
• Nouns translate into entities
• Verbs translate into relationships among entities
• Example: A customer may generate many
invoices
• “Customer” and “invoice” are objects of
interest, hence, they can form entities
• The relationship between the customer and
invoice is “generate”
11
Business Rules (cont…)
Translating Business Rules into Data Model
Components
• Relationship is bi-directional.
• Examples:
• A customer may generate many invoices
• An invoice is generated by only one customer
• 1:M relationship, customer is the “1” side, and
invoice is the “many” side
12
Business Rules (cont…)
Translating Business Rules into Data Model
Components
• Rule of thumb:
• How many instances of B are related to one instance of
A?
• How many instances of A are related to one instance of
B?
• Example:
• How many books can one author write?
• How many authors can one book be written by?
• M:N relationship
13
Business Rules (cont…)
Naming Conventions
• Entity names - Required to:
• Be descriptive of the objects in the business
environment
• Use terminology that is familiar to the users
• Attribute name - Required to be descriptive of the
data represented by the attribute
• Proper naming:
• Facilitates communication between parties
• Promotes self-documentation
14
Exercise!!
Entity vs. attributes
Car_price Painter Painter_name Employee_na Employee_ID
me
Painting Student_nam Birth_date Subject_nam Matric_num
e e
Painting_ID Plat_number Subject_ID Car Subject_unit
15
Exercise!!
Write business rules from basic data
model as shown in the figures.
Answer:
An agent can serve many customers.
Each customer is served by one agent.
(i) The relational diagram
16
The Evolutions of Data Models
Emerging
Hierarchic
File XML hybrid model (Big
al& Relational OO & O/R
system DBMS data,
network
NoSQL)
17
The Evolutions of Data Models (cont…)
Hierarchical Model
• Represented by an upside-down tree which
contains segments
• Depicts a set of one-to-many (1:M) relationships
20
The Evolutions of Data Models (cont…)
Network Model
22
The Evolutions of Data Models (cont…)
Network Model
Schema Subschema
• Conceptual • Portion of the
organization of database seen
the entire by the
database as application
viewed by the programs that
database produce the
administrator desired
information
from the data
within the
database
23
The Evolutions of Data Models (cont…)
Network Model
Advantages Disadvantages
26
The Evolutions of Data Models (cont…)
Relational Model
• RDBMS = relational database management
system
• Performs basic functions provided by the
hierarchical and network DBMS systems
• Makes the relational data model easier to
understand and implement
• Hides the complexities of the relational model
from the user
• Examples: Oracle, DB2, Microsoft SQL Server,
and MySQL 27
The Evolutions of Data Models (cont…)
Relational Model
Advantages Disadvantages
31
The Evolutions of Data Models (cont…)
The Entity Relationship Model
• With a fast development of the relational database, a more
effective database design tool is required.
• Graphical representation of entities and their relationships
in a database structure
• Entity relationship diagram (ERD)
• Uses graphic representations to model database
components
• Entity instance or entity occurrence
• Rows in the relational table
• Connectivity: Term used to label the relationship types
32
The Evolutions of Data Models (cont…)
The Entity Relationship Model
Advantages Disadvantages
35
The Evolutions of Data Models (cont…)
The Object-Oriented Data Model (OODM)
• Class: Collection of similar objects with shared
structure and behavior organized in a class
hierarchy
• Class hierarchy: Resembles an upside-down
tree in which each class has only one parent
• Inheritance: Object inherits methods and
attributes of parent class
• Unified Modeling Language (UML)
• Describes sets of diagrams and symbols to
graphically model a system 36
The Evolutions of Data Models (cont…)
The Object-Oriented Data Model (OODM)
37
The Evolutions of Data Models (cont…)
The Object-Oriented Data Model (OODM)
Advantages Disadvantages
41
The Evolutions of Data Models (cont…)
Big Data New Technologies
Hadoop
MapReduc
e
42
The Evolutions of Data Models (cont…)
NoSQL Databases
• Not based on the relational model
• Support distributed database architectures
• Provide high scalability, high availability, and fault
tolerance
• Support large amounts of sparse data
• Geared toward performance rather than
transaction consistency
• Store data in key-value stores
43
The Evolutions of Data Models (cont…)
NoSQL Databases
Advantages Disadvantages
46
Figure 2.6 - The Evolution of Data Models
The Evolutions of Data Models (cont…)
Summary
47
Degrees of Data Abstraction
48
Degrees of Data Abstraction (cont…)
50
Degrees of Data Abstraction (cont…)
The External Model
Business
Unit 2
Business
Unit 1
51
Figure 2.8 - External Models for Tiny College
Degrees of Data Abstraction (cont…)
The Conceptual Model
• Represents a global view of the entire database
by the entire organization
• Conceptual schema: Basis for the identification
and high-level description of the main data objects
• Has a macro-level view of data environment
• Is software and hardware independent
• Logical design: Task of creating a conceptual data
model
52
Degrees of Data Abstraction (cont…)
The Conceptual Model (Bird eye level, macro view)
53
Figure 2.9 - Conceptual Model for Tiny College
Degrees of Data Abstraction (cont…)
The Internal Model
• Representing database as seen by the DBMS
mapping conceptual model to the DBMS
• Internal schema: Specific representation of an
internal model
• Uses the database constructs supported by the
chosen database
• Is software dependent and hardware independent
• Logical independence: Changing internal model
without affecting the conceptual model
54
Degrees of Data Abstraction (cont…)
The Internal Model (depends on a DBMS)
55
Figure 2.10 - Internal Model for Tiny College
Degrees of Data Abstraction (cont…)
The Physical Model
• Operates at lowest level of abstraction
• Describes the way data are saved on storage media such
as disks or tapes
• Requires the definition of physical storage and data
access methods
• Relational model aims at logical level
• Does not require physical-level details
• However, understanding of physical model is good for
physical-level fine tuning.
• Physical independence: Changes in physical model do not
affect internal model 56
Degrees of Data Abstraction (cont…)
Summary
57