Академический Документы
Профессиональный Документы
Культура Документы
Oracle
MS Access
Chapter
MySQL
ITS232
Introduction To
Database
Data Models
The Importance of Data Models
2
Data models
Data Models
Data Model Basic Building Blocks
3
Entity
anything about which data are to be collected and stored
Attribute
a characteristic of an entity
Relationship
describes an association among entities
Constraint
a restriction placed on the data/user-defined structures
that let you restrict the behaviors of
columns/attributes
Data Models
Data Model Basic Building Blocks
4
Entity
PERSON, VEHICLE, BUILDING, PLANT, ANIMAL, etc
Attribute
person_name, animal_family, scientific_name, etc
Relationship
1:1, 1:M, M:N
Constraint
NOT NULL, CHECK, PRIMARY KEY, FOREIGN KEY, TRIGGER
Data Models
Business Rules
5
Data Models
Business Rules
6
Relationship
s
Attributes
characteristics of entities
Connectivity
Constraints
Data Models
Discovering Business Rules
7
Company managers
Policy makers
Department managers
Written documentation
Procedures
Standards
Operations manuals
Direct interviews with end users
Data Models
Discovering Business Rules
8
Data Models
Translating Business Rules into Data Model Components
9
Data Models
Discovering Business Rules
10
Generally
Nouns translate into entities
Verbs translate into relationships among entities
Relationships are bi-directional
Fact finding techniques:
The formal process of using techniques such as
interview and questionnaire to collect facts about
system, requirements and preferences.
To captures the essential facts necessary to build the
required database
What facts are collected?
Captured facts about the current and/or future system.
Data Models
Fact Finding Techniques
11
Examining
documents
(document
review)
Questionnaire
5 commonly
used fact
finding
techniques
Research
Interviewing
Observation the
organization in
operations
Data Models
The Evolution of Data Models
12
Object-Oriented Model
Based on object oriented concepts
Data Models
The Evolution of Data Models
13
Data Models
The Evolution of Data Models
14
Data Models
The Evolution of Data Models
15
Abu
Johor
3000
A001
Nut
Washer
Samad Kedah
A002
Washer
2500
A003
Hammer Nut
A004
Bolt Nut
Data Models
The Evolution of Data Models
16
Source:
http://worldacademyonline.com/article/25/359/data_models__relational__hierarchical_and_n
etwork_.html
Data Models
The Evolution of Data Models
17
Advantages
Many of the hierarchical data models features
formed the foundation for current data models
Its database application advantages are replicated,
albeit in a different form, in current database
environments
Generated a large installed (mainframe) base,
created a pool of programmers who developed
numerous tried-and-true business applications
Data Models
The Evolution of Data Models
18
Created to
Represent complex data relationships more
effectively
Improve database performance
Impose a database standard
Data Models
The Evolution of Data Models
19
Set
Relationship
Composed of at least two record types
Owner
Equivalent to the hierarchical models parent
Member
Equivalent to the hierarchical models child
Data Models
The Evolution of Data Models
20
Data Models
The Evolution of Data Models
21
CUSTOMER
Abu
Johor
3000
Samad
Kedah
2500
Zaitun
Melaka
INVOICE
PRODUCT
A001
Nut
A002
Washer
A003
Hammer
A004
Bolt
4500
Data Models
The Evolution of Data Models
22
Source:
http://worldacademyonline.com/article/25/359/data_models__relational__hierarchical_and_n
etwork_.html
Data Models
The Evolution of Data Models
23
Disadvantages
Too cumbersome/difficult to handle
The lack of ad hoc query capability put heavy
pressure on programmers
Any structural change in the database could
produce havoc in all application programs that drew
data from the database
Many database old-timers can recall the
interminable information delays
Data Models
The Evolution of Data Models
24
Relational Model
Data Models
The Evolution of Data Models
25
Relational Model
Table
(relations)
Relational
diagram
Relational
Table
Relational
table is
purely
logical
structure
Data Models
The Evolution of Data Models
26
Relational Model
Data Models
The Evolution of Data Models
27
Relational Model
Data Models
The Evolution of Data Models
28
Relational Model
Data Models
The Evolution of Data Models
29
Relational Model
Example of form
Data Models
The Evolution of Data Models
30
Relational Model
Data Models
The Evolution of Data Models
31
Relational Model
Data Models
The Evolution of Data Models
32
Relational Model
Example of ERD
Chen
Crow
s
Foot
Data Models
The Evolution of Data Models
33
Data Models
The Evolution of Data Models
34
Data Models
The Evolution of Data Models
35
Data Models
The Evolution of Data Models
36
Data Models
A Summary
37
Common characteristics:
Conceptual simplicity without compromising
the semantic completeness of the database
Represent the real world as closely as possible
Representation of real-world transformations
(behavior) must comply with consistency and
integrity characteristics of any data model
Data Models
A Summary: The development of data model
38
Semantic
data - data
is organized
in such a way
that it can be
interpreted
meaningfully
without
human
intervention
Data Models
Degrees of Data Abstraction
39
Data Models
Degrees of Data Abstraction
40
Data Models
Degrees of Data Abstraction
41
Data Models
Three Level ANSI-SPARC Architecture
42
-users view
External
Model
1.
External
level
User 1
User 2
View 1
View 2
User n
Model
2.Conceptual
Conceptual
level
-designers view
-h/w independent
-s/w independent
Conceptual Schema
3.Internal
Internal
level
Model
-DBMSs view
-h/w independent
-s/w dependent
Internal Schema
Internal Model
Physical
data
Physical
Model
organization
-h/w dependent
-s/w dependent
Database
View n
ERD
Advantages:
Easy to identify specific data required to support each
business units operations
Facilitates designers job by providing feedback about the
models adequacy
Creation of external models helps to ensure security
constraints in the database design
Simplifies application program development
Object-Oriented Model
_____________________________________________
-users view
1. External level
User 1
User 2
View 1
View 2
User n
2. Conceptual level
-designers view
-h/w independent
-s/w independent
Conceptual Schema
3.Internal
Internal
level
Model
-DBMSs view
-h/w independent
-s/w dependent
Internal Schema
Physical
data
Physical
Model
organization
-h/w dependent
-s/w dependent
Database
View n
ERD