IT131-8:
Information Management
Data Models
Learning Objectives
After completing this chapter, you will be able to:
Discuss data modeling and why data models are
important
Describe the basic data-modeling building blocks
Define what business rules are and how they
influence database design
Understand how the major data models evolved
List emerging alternative data models and the
needs they fulfill
Explain how data models can be classified by
their level of abstraction
Data Modeling Data Modeling
Creating a specific data model for a determined
and Data Models problem domain
Data Model Model
Simple representation Abstraction of a more
of complex real-world complex real-world
data structures object or event
Useful for supporting a
specific problem domain
The Importance of Data Models
Facilitates Organizes data
communication for various users
Provides an
Gives various
abstraction for the
views of the
creation of a good
database
database
Data Model Basic Building Block
Entity Attribute
person, place, thing, or event characteristic of an entity
about which data will be
collected and stored
Relationship Constraint
association among entities restriction placed on data
One-to-many (1:M OR 1..*) Ensures data integrity
Many-to-many (M:N or *..*)
One-to-one (1:1 OR 1..1)
Business Rules
Brief, precise, and unambiguous description of a policy,
procedure, or principle
Create and enforce actions within that organization’s
environment
Establish entities, relationships, and constraints
Sources of Business Rules
Department managers Written documentation
Company managers Policy makers
Direct interviews with
end users
Reasons for identifying and documenting
business rules
Facilitate
•Facilitate communications tool between users and designers
Standardize
•Standardize company’s view of data
Assist
•Assist designers in understanding the nature, role, scope of data, and business processes
•Assist designers in developing appropriate relationship participation rules and constraints
•Assist designers in creating an accurate data model
Translating Business Rules into Data
Model Components
Business rules set the stage for the proper identification
of entities, attributes, relationships, and constraints
•Nouns translate into entities
•Verbs translate into relationships among entities
Relationships are bidirectional
•How many instances of B are related to one instance of A?
•How many instances of A are related to one instance of B?
Entity name requirements
Naming
•Be descriptive of the objects in the business
Conventions environment
•Use terminology that is familiar to the users
Attribute Name
•Required to be descriptive of the data
represented by the attribute
Importance of proper naming
•Facilitates communication between parties
•Promotes self-documentation
Hierarchical
Models B004 | ... | Bristol B002 | ... | London
B005 | ... | London B003 | ... | Glasgow B007 | ... | Aberdeen
SL41 | Julie | Lee | ... | Assistant | 9000
SL21 | John | White | ... | Manager | 30000
SG37 | Ann | Beech | ... | Assistant | 12000
SG14 | David | Ford | ... | Supervisor | 18000
SG5 | Susan | Brand | ... | Manager | 24000
SA9 | Mary | Howe | ... | Assistant | 9000
Hierarchical Developed to manage large amounts of
Models data for complex manufacturing projects
Represented by an upside-down tree
which contains segments
Segments are the equivalent of a file
system’s record type
Depicts a set of one-to-many (1:M)
relationships
Hierarchical Model
Advantages Disadvantages
•Promotes data sharing & •Requires knowledge of physical
easy to understand data storage characteristics
•Parent/child relationship •Navigational system requires
promotes conceptual knowledge of hierarchical path
simplicity and data integrity •Changes in structure require
•Database security is changes in all application programs
provided and enforced by •Implementation limitations
DBMS (expensive)
•Efficient with 1:M •No data definition
relationships •Lack of standards
Network
Models B005 | 22 Deer Rd | London SL41 | Julie | Lee | ... | Assistant | 9000
B007 | 16 Argyl St | Aberdeen
SL21 | John | White | ... | Manager | 30000
B003 | 163 Main St. | Glasgow
SA9 | Mary | Howe | ... | Assistant | 9000
B004 | 32 Manse Rd. | Bristol
SG37 | Ann | Beech | ... | Assistant | 12000
B002 | 56 Clover Dr. | London
SG14 | David | Ford | ... | Supervisor | 18000
SG5 | Susan | Brand | ... | Manager | 24000
Created to represent complex data
Network relationships effectively
Models Improved database performance and
imposed a database standard
Allows a record to have more than one
parent
Standard database concepts that emerged
with the network model are still used by
modern data models
Schema and subschema
Data manipulation language (DML)
Data definition language (DDL)
Network Model
Advantages Disadvantages
•Conceptual simplicity •System complexity limits
•Handles more relationship types efficiency
•Data access is flexible •Navigational system yields
•Data owner/member complex implementation,
relationship promotes data application development, and
integrity management
•Conformance to standards •Structural changes require
•Includes data definition changes in all application programs
language (DDL) and data
manipulation language (DML)
The
Relational Key = 24
Model
The Produced an automatic transmission
Relational database that replaced standard
Model transmission databases
Based on a relation (i.e., table): matrix
composed of intersecting tuples (rows) and
attributes (columns)
Describes a precise set of data
manipulation constructs
Relational database management system
(RDBMS)
Performs basic
functions provided by Hides the complexities
the hierarchical and of the relational model
network DBMS from the user
systems
Makes the relational
data model easier to
understand and
implement
SQL-based relational database
application
End-user Interface
Allows end user to interact with the data
Collection of tables stored in the database
Each table is independent from another
Rows in different tables are related based on common values in common
attributes
SQL Engine
Executes all queries
Relational Model
Advantages Disadvantages
•Structural independence is •Requires substantial hardware and
promoted using independent system software overhead
tables •Conceptual simplicity gives
•Tabular view improves untrained people the tools to use a
conceptual simplicity good system poorly
•Ad hoc query capability is based •May promote information
on SQL problems
•Isolates the end user from
physical-level details
•Improves implementation and
management simplicity
The Entity
Entity Relationship Diagram
Relationship
uses graphic representations to model database
Model components
Graphical
representation of
entities and their Entity instance or
relationships in a Attributes Connectivity
entity occurrence
database structure
term used to label
rows in the describe particular
the relationship
relational table characteristics
types
The Entity Relationship Model
The ER Model Notations: One-to-Many
A One-to-Many
Chen Notation (1:M)
Relationship:
a PAINTER can
Crow's Foot paint many
Notation PAINTINGs; each
PAINTING is
UML Class painted by one
Diagram Notation PAINTER
The Entity Relationship Model
The ER Model Notations: Many-to-Many
A Many-to-Many
Chen Notation (M:N)
Relationship:
an EMPLOYEE
Crow's Foot
can learn many
Notation
SKILLs; each
SKILL can be
UML Class learned by many
Diagram Notation EMPLOYEEs
The Entity Relationship Model
The ER Model Notations: One-to-One
Chen Notation A One-to-One
(1:1) Relationship:
An EMPLOYEE
Crow's Foot manages one
Notation STORE; each
STORE is
managed by one
UML Class
EMPLOYEE
Diagram Notation
Entity Relationship Model
Advantages Disadvantages
•Visual modeling yields •Limited constraint
conceptual simplicity representation
•Visual representation makes it •Limited relationship
an effective communication representation
tool •No data manipulation language
•Is integrated with the •Loss of information content
dominant relational model occurs when attributes are
removed from entities to avoid
crowded displays
The Object-Oriented Data Model
Both data and its relationships are contained in a single structure
known as an object
Object-oriented
database
Attribute
management
system(OODBMS)
describes the properties of an object
based on OODM
Object
•contains data and their relationships
with operations that are performed on it
•Basic building block for autonomous
structures
•Abstraction of real-world entity
The Object-Oriented Data Model
Both data and its relationships are contained in a single structure
known as an object
Class Inheritance
collection of similar objects with
object inherits methods and
shared structure and behavior
attributes of classes above it
organized in a class hierarchy
Unified Modeling
Class Hierarchy
Language (UML)
resembles an upside-down tree describes sets of diagrams and
in which each class has only one symbols to graphically model a
parent system
THE OBJECT-ORIENTED DATA MODEL
A comparison of the OO, UML, and ER Models
Object
Representation Object Representation ER Model
INVOICE
INV_DATE
INV_NUMBER
INV_SHIP_DATE
INV_TOTAL
1
CUSTOMER
M
LINE
Object-Oriented Model
Advantages Disadvantages
•Semantic content is added •Slow development of standards
•Visual representation includes caused vendors to supply their
semantic content own enhancements
•Inheritance promotes data •Complex navigational system
integrity •Learning curve is steep
•High system overhead slows
transactions
Object/Relational and XML
Extended relational data model (ERDM)
Supports OO features, extensible data types based on classes, and
inheritance
Object/relational database management system
(O/R DBMS)
based on ERDM
Extensible Markup Language (XML)
Manages unstructured data for efficient and effective exchange of
structured, semistructured, and unstructured data
Emerging
Data Goals of Big Data
Models: Big Find new and better ways to manage large
amounts of web and sensor-generated data
Data and Provide high performance at a reasonable
cost
NoSQL
Characteristics of Big Data
Volume – amount of data being stored
Velocity – speed by which data grows and
need to process data quickly in order to
generate information and insight
Variety – data being collected comes in
multiple different data format
Video: NoSQL vs SQL
Link: https://www.youtube.com/watch?v=MfF750YVDxM
Emerging
Challenges of Big Data
Data Volume doesn’t allow usage of conventional
Models: Big structures
Expensive
Data and OLAP tools proved inconsistent dealing with
unstructured data
NoSQL
New technologies of Big Data
Hadoop – Java-based, open source, high speed,
fault-tolerant distributed storage and
computational framework
Hadoop Distributed File System (HDFS) – highly-
distributed, fault-tolerant file storage system
designed to manage the large amounts of data
MapReduce – opens source application
programming interface that provides fast data
analytics
NoSQL
Emerging
Data NoSQL Databases
Models: Big Not based on the relational model
Data and Support distributed database architectures
NoSQL Provide high scalability, high availability, and
fault tolerance
Support large amounts of sparse data
Geared toward performance rather than
transaction consistency
Provides a broad umbrella for data storage
and manipulation
NoSQL
Advantages Disadvantages
•High scalability, availability, •Complex programming is
and fault tolerance are required
provided •There is no relationship support
•Uses low-cost commodity •There is no transaction integrity
hardware support
•Supports Big Data •In terms of data consistency, it
•Key-value model improves provides an eventually consistent
storage efficiency model
The Evolution of Data Models: A Summary
Difficult to represent M:N relationships Hierarchical (1960)
(hierarchical only)
Structural level dependency
No ad hoc queries (record-at-a-time access) Network (1969)
Access path predefined (navigational access)
Conceptual simplicity (structural independence)
provides ad hoc queries (sql) Relational (1970)
set oriented access
The Evolution of Data Models: A Summary
Easy to understand (more semantics)
Entity Relationship
Limited to conceptual modeling (no
(1976)
implementation component)
More semantics in data model Semantic (1978)
Support for complex objects
Inheritance (class hierarchy)
Behavior
Unstructured Data (XML) Object Extended
Oriented Relational
XML data exchanges (1985) (1990)
The Evolution of Data Models: A Summary
*In 1983, the internet is born
Addresses Big Data problem
Less semantics in data model NoSQL (2009)
Based on schema-less key-value data model Big Data
Best suited for large sparse data stores
Degrees of Data Abstraction
End-User View End-User View
Degree of Abstraction Characteristics
External External
Model Model
High ER Hardware-independent
Software-independent
Conceptual
Designer's View
Model
Object-Oriented
Logical Independence
Hardware-independent
Medium Relational
Software-dependent
Conceptual
DBMS View
Model
Hardware-dependent
Physical Independence Network
Software-dependent
Low Hierarchical
Physical
Model
The External Model
External Models for Tiny College
Student Registration Class Scheduling
The
End users’ view of the data environment
External People who use the application programs to
manipulate the data and generate information
Model
ER diagrams are used to represent the
external views
External schema: specific representation of an
external view
The Conceptual Model
Conceptual Model for Tiny College
The Represents a global view of the entire
database by the entire organization
Conceptual
Conceptual schema: basis for the identification
Model and high-level description of the main data
objects
Logical design: task of creating a conceptual
data model
Conceptual model advantages
Macro-level view of data environment
Software and hardware independent
The Internal Model
Internal Model for Tiny College
CONCEPTUAL MODEL INTERNAL MODEL
Create Table PROFESSOR(
PROF_ID NUMBER PRIMARY KEY,
PROF_LNAME CHAR(15),
PROF_INITIAL CHAR(1),
PROF_FNAME CHAR(15),
.............);
Create Table CLASS(
CLASS_ID NUMBER PRIMARY KEY,
CRS_ID CHAR(8) REFERENCES COURSE,
PROF_ID NUMBER REFERENCES PROFESSOR,
ROOM_ID CHAR(8) REFERENCES ROOM,
.............);
Create Table CLASS(
ROOM_ID CHAR(8) PRIMARY KEY,
ROOM_TYPE CHAR(3),
.............);
Create Table COURSE(
CRS_ID CHAR(8) PRIMARY KEY,
CRS_NAME CHAR(25),
CRS_CREDIT NUMBER,
.............);
The Representing database as seen by the
DBMS mapping conceptual model to the
Internal DBMS
Model Internal schema: specific representation of an
internal model, using the database constructs
supported by the chosen database
Logical independence: changing internal model
without affecting the conceptual model
Hardware independent: unaffected by the type of
computer on which the software is installed
The Operates at lowest level of abstraction
Describes the way data are saved on storage media
Physical such as magnetic, solid state, or optical media
Requires the definition of physical storage
Model and data access methods
Software and hardware dependent
Relational model aimed at logical level
Does not require physical-level details
Physical independence
changes in physical model do not affect internal
model
Preparing for Your Database Professional Carrer
Database Career Opportunities
Model Degree of Abstraction Focus Independent of
Hardware and
External High End-user views
Software
Global view of
Hardware and
Conceptual Medium-High data(database model
Software
independent)
Internal Medium-Low Specific database model Hardware
Storage and access Neither Hardware
Physical Low
method or Software
Exercise
Given the Following:
1. Write the business rule(s) that
governs the relationship between
AGENT and CUSTOMER.
2. Given the business rule(s) you
wrote in Problem 1, create the basic
Crow’s Foot & Chen’s ERD
3. Using the ERD you drew in Problem
2, create the UML class diagram.
Answers Write the business rule(s) that governs
the relationship between AGENT and
CUSTOMER.
Given the data in the two tables, you can see that an
AGENT – through AGENT_CODE -- can occur many
times in the CUSTOMER table. But each customer
has only one agent. Therefore, the business rules
may be written as follows:
One agent can have many customers.
Each customer has only one agent.
Given these business rules, you can conclude that
there is a 1:M relationship between AGENT and
CUSTOMER.
Answers Given the business rule(s) you wrote in
Problem 1, create the basic Crow’s Foot
and Chen ERD
Answers Using the ERD you drew in Problem 2,
create the UML class diagram.
Seatwork
1. Write all the business rule(s) that are reflected in the ERD
shown on the right.
2. Create a Crow’s Foot ERD for each of the following
descriptions:
a. Each of the SM Malls divisions is composed of many
departments. Each department has many employees
assigned to it, but each employee works for only one
department. Each department is managed by one
employee, and each of those managers can manage only
one department at a time.
b. During some period of time, a customer can download
many ebooks from NBS Online. Each of the ebooks can
be downloaded by many customers during that period of
time.
c. The KwikTite Corporation operates many factories. Each
factory is located in a region, and each region can be
“home” to many of KwikTite’s factories. Each factory has
many employees, but each employee is employed by
only one factory.