Cho 2
Cho 2
1
Data Model Basic Building Blocks
Business Rules
Terminology
• Entity: anything about which data are to be • Descriptions of policies or principles within an
collected and stored organization
• Attribute: a characteristic of an entity • Description of operations or procedures, to
• Relationship: describes an association among create/enforce actions within an organization’s
entities environment
– One-to-many (1:M) relationship – Must be in writing and kept up to date
– Must be easy to understand and widely disseminated
– Many-to-many (M:N or M:M) relationship
– Sometimes externally defined, i.e. government
– One-to-one (1:1) relationship
regulations.
• Constraint: a restriction placed on the data • These describe characteristics of data as viewed
by the company
CS275 Fall 2010 5 CS275 Fall 2010 6
2
Translating Business Rules into Data
Naming Conventions
Model Components
• Naming occurs during translation of business
• Generally, nouns translate into entities
rules to data model components
• Verbs translate into relationships among entities
• Names should make the object unique and
• Relationships are bidirectional distinguishable from other objects
• Two questions to identify the relationship type: • Names should also be descriptive of objects in the
– How many instances of B are related to one environment and be familiar to users
instance of A?
• Proper naming:
– How many instances of A are related to one
– Facilitates communication between parties
instance of B?
– Promotes self-documentation
Evolution of Data
The Hierarchical Model
Implementation Models
• Hierarchical • The hierarchical model was developed in the 1960s
– Logically represented by an upside down tree to manage large amounts of data for manufacturing
• Each parent can have many children projects
• Each child has only one parent
• Basic logical structure is represented by an upside-
down “tree”
• Network
• Hierarchical structure contains levels or segments
• Relational – Segment analogous to a record type
• Object oriented – Set of one-to-many relationships between segments
• Hybrid, XML • Example – manufacturing a car from components
(a,b,or c), each made of subassemblies (1,2,or3),
each having parts (x,y,&z) ....(tree structure)
3
Hierarchical Structure Hierarchical Structure
• Each parent can have many children
• Each child has only one parent
• Tree is defined by path that traces parent
segments to child segments, beginning from the
left
• Hierarchical path
– Ordered sequencing of segments tracing
hierarchical structure
• Preorder traversal or hierarchic sequence
– “Left-list” path
CS275 Fall 2010 13 CS275 Fall 2010 14
4
The Network Model The Network Model
• The network model was created to represent • Collection of records in 1:M relationships
complex data relationships more effectively than • A Set is a relationship and composed of two
the hierarchical model record types:
– Improves database performance – Owner: Equialent to the hierarchical model’s
– Imposes a database standard parent
– Represent complex data relationships more – Member: Equivalent to the hierarchical model’s
effectively – such as child w/ multiple parents child
• Conference on Data Systems Languages
(CODASYL)
• American National Standards Institute (ANSI)
• Database Task Group (DBTG)
CS275 Fall 2010 17 CS275 Fall 2010 18
5
The Relational Model Relational Table
• Developed by E.F. Codd (IBM) in 1970 • A Relational table is a purely logical structure
• Relational models were considered impractical in – How data are physically stored in the database is
the 1970’s. of no concern to the user or the designer.
• Model was conceptually simple at expense of • Stores a collection of related entities
computer overhead – Resembles a file
• Relational table is purely logical structure • Table (relations)
– How data are physically stored in the database is – Matrix consisting of a series of row/column
of no concern to the user or the designer intersections
– This concept is the source of a real database
– Each row in a relation is called a tuple
revolution
– Related to each other by sharing a common entity
characteristic
CS275 Fall 2010 21 CS275 Fall 2010 22
6
The Relational DBMS Application The Relational Implementation Model
Logical/Conceptual Model
The Entity Relationship Model
The Entity Relationship Model
• Widely accepted standard for data modeling • Entity instance (or occurrence) is row in table
• Introduced by Chen in 1976 • Entity set is collection of like entities
• Graphical representation of entities and their • Connectivity labels types of relationships
relationships in a database structure • Relationships are expressed using Chen notation
• Entity relationship diagram (ERD) – Relationships are represented by a diamond
– Uses graphic representations to model database – Relationship name is written inside the diamond
components
– Entity is mapped to a relational table • Crow’s Foot notation used as design standard in
this book
7
Logical/Conceptual Model
The Object-Oriented (OO) Model
• Models both data and relationships contained in a
single structure known as an object
• OODM (object-oriented data model) is the basis
for OO-DBMS (Semantic data model)
• An object is described by its factual content:
– Are self-contained: a basic building-block for
autonomous structures
– Is an abstraction of a real-world entity
– Contains information about relationships between
facts within the object and with other objects.
CS275 Fall 2010 CS275 Fall 2010 30
8
Logical Models:
Newer Data Models: Object/Relational
Object Oriented Model
• Extended relational data model (ERDM)
• Advantages • Disadvantages
– Semantic data model developed in response to
– Adds semantic content – Slow pace of OODM
standards
increasing complexity of applications
– Visual presentation
includes semantic development – Includes many of OO model’s best features
content – Complex navigational – Often described as an object/relational database
– Database integrity data access management system (O/RDBMS)
– Both structural and – Steep learning curve – Primarily geared to business applications
data independence – High system overhead
slows transactions
– Lack of market
penetration
CS275 Fall 2010 33 CS275 Fall 2010 34
9
The Development of Data Models Data Models: A Summary
• Each new data model capitalized on the
shortcomings of previous models
• Common characteristics:
– Conceptual simplicity with semantic completeness
– Represent the real world as closely as possible
– Real-world transformations (behavior) must
comply with consistency and integrity
characteristics
• Some models better suited for some tasks
SPARC Framework :
The SPARC External Model
Degrees of Data Abstraction
• Represents the End users’ view of the data
• Database designer starts with abstracted view, environment
then adds details
• ER diagrams represent external views
• ANSI Standards Planning and Requirements
• External schema: specific representation of an
Committee (SPARC)
external view
– Defined a framework for data modeling based on
– Entities
degrees of data abstraction (1970s):
1. External
– Relationships
2. Conceptual – Processes
3. Internal – Constraints
10
External Models showing
The External Model two different Users
Conceptual Model
• End users’ view of the data environment
• Requires that the modeler subdivide set of
requirements and constraints into functional
modules that can be examined within the
framework of their external models
• Advantages:
– Easy to identify specific requirements to support
each business unit’s operations
– Facilitates designer’s job by providing feedback
about the model’s adequacy
– Ensures security constraints in database design
– Simplifies application program development
CS275 Fall 2010 41 CS275 Fall 2010 42
11
The SPARC Internal Model
• Representation of the database as “seen” by the
DBMS
– Maps the Conceptual model to the DBMS
• Internal schema depicts a specific representation
of an internal model
• Depends on specific database software
– Change in DBMS software requires internal model
be changed
• Logical independence: change internal model
without affecting conceptual model
CS275 Fall 2010 45 CS275 Fall 2010
12
Summary Summary
• Hierarchical model • Object-oriented data model: object is basic
– Set of one-to-many (1:M) relationships between a modeling structure
parent and its children segments • Relational model adopted object-oriented
• Network data model extensions: extended relational data model
– Uses sets to represent 1:M relationships between (ERDM)
record types • OO data models depicted using UML
• Relational model • Data-modeling requirements are a function of
– Current database implementation standard different data views and abstraction levels
– ER model is a tool for data modeling – Three SPARC abstraction levels: external,
• Complements relational model conceptual, internal
13