Chapter 2 Data Model
Chapter 2 Data Model
DATA MODEL
Objectives
2
design
How the major data models evolved
Data models
Relatively
simple representations, usually graphical, of
more complex real-world data structures
Entity
Attribute
Relationship
Constraint
Data Model Basic Building Blocks
5
Entity :
anything about which data are to be collected and stored
◼ person
◼ CUSTOMER, STUDENT, PATIENT
◼ place
◼ BLOCK, ROOM
◼ thing
◼ BOOK, CD, FURNITURE
◼ event
◼ WEDDING, MUSICAL CONCERT
Attribute :
a characteristic of an entity
◼ CUST_ID, CUST_ADDRESS
Relationship :
describes an association among entities
◼ One-to-many (1:M) relationship
◼ Many-to-many (M:N or M:M) relationship
◼ One-to-one (1:1) relationship
Bidirectional
Questions to identify the relationship type
◼ How many instances of B are related to one instance of A?
◼ How many instances of A are related to one instance of B?
Data Model Basic Building Blocks
7
Relationship : (cont.)
One-to-many (1:M) relationship
PAINTER paints PAINTING
◼ Each painter may paints one or more painting
◼ Each painting must be painted by one and only one painter
Constraint :
a restriction placed on the data
Company managers
Policy makers
Department managers
Written documentation
◼ Procedures
◼ Standards
◼ Operations manuals
Direct interviews with end users
Business Rules
12
❑ Developed in 1960s
Advantage Disadvantages
Many of the hierarchical Complex to implement
data model’s features Difficult to manage
formed the foundation
Lacks structural
for current data models
independence
Implementation
limitations
Lack of standards
The Network Model
21
Table
Matrix consisting of a series of row/column intersections
Related to each other through sharing of a common
attribute
Row = Tuple
Relational diagram
Representation of relational database’s entities,
attributes within those entities, and relationships
between those entities
The Relational Model
Relational Table
Stores a collection of related entities
◼ Resembles a file
◼ Different with file systems: structural independence
◼ Relational table is purely logical structure
The Relational Model
31
Entity
Represented in ERD by rectangle
Capital letter
Singular
STUDENT
STUDENT
Entity
Entity is mapped to a relational table
Entity instance (or occurrence) = row in table
Entity set is collection of like entities = table
Each entity is described by a set of attributes
Relationship
Relationship Types (1:1, 1:M, M:N) = Connectivity
Name → Verb
The Entity Relationship Model
connectivity
relationship name
Big Data
New and better ways to manage large amounts of
Web-generated data and derive business insight from
it
Provides high performance and scalability at a
reasonable cost
Big data characteristic :
◼ Volume – the amounts of data being stored.
◼ Velocity –not only to the speed but also the process this
data quickly in order to generate information and insight.
◼ Variety – the data that being collected comes in multiple
different data formats
Emerging Data Models: Big Data and NoSQL
(cont’d.)
43
Sparse data
Number of attributes is very large
Number of actual data instances is low
NoSQL databases
Not based on the relational model, hence the name
NoSQL
Supports distributed database architectures
46
Nik Ruslawati-Uitm Perak
Data Model Basic Terminology
Comparison
©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.
48
Hierarchical Model
Advantages Disadvantages
©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.
49
Network Model
Advantages Disadvantages
©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.
50
Relational Model
Advantages Disadvantages
▪ Structural independence is ▪ Requires substantial hardware and
promoted using independent
system software overhead
tables
▪ Tabular view improves ▪ Conceptual simplicity gives
conceptual simplicity untrained people the tools to use a
good system poorly
▪ Ad hoc query capability is based
on SQL ▪ May promote information
▪ Isolates the end user from problems
physical-level details
▪ Improves implementation and
management simplicity
©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.
51
Entity Relationship Model
Advantages Disadvantages
©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.
53
NoSQL
Advantages Disadvantages
©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.
54
Data Models: A Summary
55
Common characteristics:
Conceptual simplicity without compromising the semantic
completeness of the database
Represent the real world as closely as possible
Degrees of Data Abstraction
56
Advantages:
Easy to identify specific data required to support
each business unit’s operations
Facilitates designer’s job by providing feedback
about the model’s adequacy
Creation of external models helps to ensure security
constraints in the database design
Simplifies application program development
The External Model
Attributes
Relationships
Constraints
Summary
70
Hierarchical model
Depicts a set of one-to-many (1:M) relationships between a
parent and its children segments
Relational model
Current database implementation standard
ER model is a popular graphical tool for data modeling that
complements the relational model
Summary
71