SlideShare a Scribd company logo
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter 8
Data Modeling and Ana
lysis
Objectives
• Define data modeling and explain its benefits.
• Recognize and understand the basic concepts and constructs of
a data model.
• Read and interpret an entity relationship data model.
• Explain when data models are constructed during a project and w
here the models are stored.
• Discover entities and relationships.
• Construct an entity-relationship context diagram.
• Discover or invent keys for entities and construct a key-based dia
gram.
• Construct a fully attributed entity relationship diagram and describ
e data structures and attributes to the repository.
• Normalize a logical data model to remove impurities that can mak
e a database unstable, inflexible, and nonscalable.
• Describe a useful tool for mapping data requirements to business
operating locations.
8-3
8-4
Data Modeling
Data modeling – a technique for organizing
and documenting a system’s data. Sometim
es called database modeling.
Entity relationship diagram (ERD) – a dat
a model utilizing several notations to depict
data in terms of the entities and relationship
s described by that data.
8-5
Sample Entity Relationship Diagram
(ERD)
8-6
 Persons: agency, contractor, customer,
department, division, employee,
instructor, student, supplier.
 Places: sales region, building, room,
branch office, campus.
 Objects: book, machine, part, product, raw material, software
license, software package, tool, vehicle model, vehicle.
 Events: application, award, cancellation, class, flight, invoice,
order, registration, renewal, requisition, reservation, sale, trip.
 Concepts: account, block of time, bond, course, fund, qualific
ation, stock.
Data Modeling Concepts: Entity
Entity – a class of persons, places, objects, even
ts, or concepts about which we need to capture a
nd store data.
• Named by a singular noun
8-7
Data Modeling Concepts: Entity
Entity instance – a single occurrence of an entity.
Student ID Last Name First Name
2144 Arnold Betty
3122 Taylor John
3843 Simmons Lisa
9844 Macy Bill
2837 Leath Heather
2293 Wrench Tim
instances
entity
8-8
Data Modeling Concepts: Attrib
utes
Attribute – a descriptive property or ch
aracteristic of an entity. Synonyms incl
ude element, property, and field.
• Just as a physical student can have attri
butes, such as hair color, height, etc., da
ta entity has data attributes
Compound attribute – an attribute tha
t consists of other attributes. Synonym
s in different data modeling languages
are numerous: concatenated attribute,
composite attribute, and data structure.
8-9
Data Modeling Concepts: Data
Type
Data type – a property of an attribute that identifies what
type of data can be stored in that attribute.
Representative Logical Data Types for Attributes
Data Type Logical Business Meaning
NUMBER Any number, real or integer.
TEXT A string of characters, inclusive of numbers. When numbers are included in a TEXT
attribute, it means that we do not expect to perform arithmetic or comparisons with th
ose numbers.
MEMO Same as TEXT but of an indeterminate size. Some business systems require the abi
lity to attach potentially lengthy notes to a give database record.
DATE Any date in any format.
TIME Any time in any format.
YES/NO An attribute that can assume only one of these two values.
VALUE SET A finite set of values. In most cases, a coding scheme would be established (e.g., F
R=Freshman, SO=Sophomore, JR=Junior, SR=Senior).
IMAGE Any picture or image.
8-10
Data Modeling Concepts: Doma
ins
Domain – a property of an attribute that defines what val
ues an attribute can legitimately take on.
Representative Logical Domains for Logical Data Types
Data Type Domain Examples
NUMBER For integers, specify the range.
For real numbers, specify the range and precision.
{10-99}
{1.000-799.999}
TEXT Maximum size of attribute. Actual values usually infinite;
however, users may specify certain narrative restrictions.
Text(30)
DATE Variation on the MMDDYYYY format. MMDDYYYY
MMYYYY
TIME For AM/PM times: HHMMT
For military (24-hour times): HHMM
HHMMT
HHMM
YES/NO {YES, NO} {YES, NO} {ON, OFF}
VALUE SET {value#1, value#2,…value#n}
{table of codes and meanings}
{M=Male
F=Female}
8-11
Data Modeling Concepts:
Default Value
Default value – the value that will be recorded if a
value is not specified by the user.
Permissible Default Values for Attributes
Default Value Interpretation Examples
A legal value from t
he domain
For an instance of the attribute, if the user does not specify
a value, then use this value.
0
1.00
NONE or NULL For an instance of the attribute, if the user does not specify
a value, then leave it blank.
NONE
NULL
Required or NOT N
ULL
For an instance of the attribute, require that the user enter
a legal value from the domain. (This is used when no value
in the domain is common enough to be a default but some
value must be entered.)
REQUIRED
NOT NULL
8-12
Data Modeling Concepts: Identif
ication
Key – an attribute, or a group of attribut
es, that assumes a unique value for ea
ch entity instance. It is sometimes calle
d an identifier.
• Concatenated key - group of attributes t
hat uniquely identifies an instance. Syno
nyms: composite key, compound key.
• Candidate key – one of a number of key
s that may serve as the primary key. Syn
onym: candidate identifier.
• Primary key – a candidate key used to u
niquely identify a single entity instance.
• Alternate key – a candidate key not sel
ected to become the primary key. Synon
ym: secondary key.
8-13
Subsetting criteria – an attrib
ute(s) whose finite values divi
de all entity instances into us
eful subsets. Sometimes calle
d an inversion entry.
Data Modeling Concepts:
Subsetting Criteria
8-14
Data Modeling Concepts: Relati
onships
Relationship – a natural business associati
on that exists between one or more entities
.
The relationship may represent an event that
links the entities or merely a logical affinity th
at exists between the entities.
8-15
Data Modeling Concepts: Cardi
nality
Cardinality – the minimum and maximum numbe
r of occurrences of one entity that may be related
to a single occurrence of the other entity.
Because all relationships are bidirectional, cardinalit
y must be defined in both directions for every relatio
nship.
bidirectional
8-16
Cardinality Notations
8-17
Data Modeling Concepts: Degre
e
Degree – the number of entities that partici
pate in the relationship.
A relationship between two entities is called
a binary relationship.
A relationship between three entities is calle
d a 3-ary or ternary relationship.
A relationship between different instances of
the same entity is called a recursive relation
ship.
8-18
Data Modeling Concepts: Degre
e
Relationships may
exist between more
than two entities an
d are called
N-ary relationships.
The example ERD
depicts a ternary re
lationship.
8-19
Data Modeling Concepts: Degre
e
Associative entity
– an entity that inher
its its primary key fr
om more than one o
ther entity (called pa
rents).
Each part of that co
ncatenated key poin
ts to one and only o
ne instance of each
of the connecting en
tities.
Associative
Entity
8-20
Data Modeling Concepts:
Recursive Relationship
Recursive relationship - a relationship that
exists between instances of the same entity
8-21
Data Modeling Concepts:
Foreign Keys
Foreign key – a primary key of an entity that is
used in another entity to identify instances of a r
elationship.
• A foreign key is a primary key of one entity that is cont
ributed to (duplicated in) another entity to identify inst
ances of a relationship.
• A foreign key always matches the primary key in the a
nother entity
• A foreign key may or may not be unique (generally no
t)
• The entity with the foreign key is called the child.
• The entity with the matching primary key is called the
parent.
8-22
Data Modeling Concepts:
Parent and Child Entities
Parent entity - a data entity that contributes
one or more attributes to another entity, call
ed the child. In a one-to-many relationship t
he parent is the entity on the "one" side.
Child entity - a data entity that derives one
or more attributes from another entity, called
the parent. In a one-to-many relationship th
e child is the entity on the "many" side.
8-23
Data Modeling Concepts:
Foreign Keys
Student ID Last Name First Name Dorm
2144 Arnold Betty Smith
3122 Taylor John Jones
3843 Simmons Lisa Smith
9844 Macy Bill
2837 Leath Heather Smith
2293 Wrench Tim Jones
Dorm Residence Director
Smith Andrea Fernandez
Jones Daniel Abidjan
Primary Key
Primary Key
Foreign Key
Duplicated from p
rimary key of Dor
m entity
(not unique in Stu
dent entity)
8-24
Data Modeling Concepts: Nonid
entifying Relationships
Nonidentifying relationship – relationship where each
participating entity has its own independent primary key
• Primary key attributes are not shared.
• The entities are called strong entities
8-25
Data Modeling Concepts:
Identifying Relationships
Identifying relationship – relationship in which the parent
entity’ key is also part of the primary key of the child entity.
• The child entity is called a weak entity.
8-26
Data Modeling Concepts:
Sample CASE Tool Notations
8-27
Data Modeling Concepts: Nons
pecific Relationships
Nonspecific relati
onship – relations
hip where many in
stances of an entit
y are associated wi
th many instances
of another entity. A
lso called many-to-
many relationship.
Nonspecific relatio
nships must
be resolved, gener
ally by introducing
an associative entit
y.
8-28
Resolving Nonspecific Relation
ships
The verb or verb phrase of a many-
to-many relationship sometimes su
ggests other entities.
8-29
Resolving Nonspecific Relation
ships (continued)
Many-to-many rel
ationships can be r
esolved with an as
sociative entity.
8-30
Resolving Nonspecific Relation
ships (continued)
While the above relationship is a many-to-many, the many on th
e BANK ACCOUNT side is a known maximum of "2." This sugg
ests that the relationship may actually represent multiple relatio
nships... In this case two separate relationships.
Many-to-Many Relationship
8-31
Data Modeling Concepts: Gene
ralization
Generalization – a concept wherein the attributes
that are common to several types of an entity are
grouped into their own entity.
Supertype – an entity whose instances store attri
butes that are common to one or more entity subty
pes.
Subtype – an entity whose instances may inherit
common attributes from its entity supertype
And then add other attributes unique to the subtype.
8-32
Generalization Hierarchy
8-33
Process of Logical Data Modeli
ng
• Strategic Data Modeling
• Many organizations select IS development pr
ojects based on strategic plans.
• Includes vision and architecture for information sy
stems
• Identifies and prioritizes develop projects
• Includes enterprise data model as starting point fo
r projects
• Data Modeling during Systems Analysis
• Data model for a single information system is
called an application data model.
8-34
Logical Model Development Sta
ges
1. Context Data model
• Includes only entities and relationships
• To establish project scope
2. Key-based data model
• Eliminate nonspecific relationships
• Add associative entities
• Include primary and alternate keys
• Precise cardinalities
3. Fully attributed data model
• All remaining attributes
• Subsetting criteria
4. Normalized data model
Metadata - data about data.
8-35
JRP and Interview Questions
for Data Modeling
Purpose Candidate Questions
(see textbook for a more complete list)
Discover system entities What are the subjects of the business?
Discover entity keys What unique characteristic (or characteristics) distinguishes
an instance of each subject from other instances of the same
subject?
Discover entity subsetting criteria Are there any characteristics of a subject that divide all insta
nces of the subject into useful subsets?
Discover attributes and domains What characteristics describe each subject?
Discover security and control needs Are there any restrictions on who can see or use the data?
Discover data timing needs How often does the data change?
Discover generalization hierarchies Are all instances of each subject the same?
Discover relationships? What events occur that imply associations between subjects
?
Discover cardinalities Is each business activity or event handled the same way, or
are there special circumstances?
8-36
Automated Tools for Data Mode
ling
8-37
Entity Discovery
• In interviews or JRP sessions, pay attention to
key words (i.e. "we need to keep track of ...").
• In interviews or JRP sessions, ask users to iden
tify things about which they would like to captur
e, store, and produce information.
• Study existing forms, files, and reports.
• Scan use case narratives for nouns.
• Some CASE tools can reverse engineer existin
g files and databases.
8-38
The Context Data Model
8-39
The Key-based Data Model
8-40
The Key-based Data Model
with Generalization
8-41
The Fully-Attributed Data Model
8-42
What is a Good Data Model?
• A good data model is simple.
• Data attributes that describe any given entity shoul
d describe only that entity.
• Each attribute of an entity instance can have only o
ne value.
• A good data model is essentially nonredundan
t.
• Each data attribute, other than foreign keys, descri
bes at most one entity.
• Look for the same attribute recorded more than on
ce under different names.
• A good data model should be flexible and ada
ptable to future needs.
Data Analysis & Normalization
Data analysis – a technique used to impro
ve a data model for implementation as a da
tabase.
Goal is a simple, nonredundant, flexible, and
adaptable database.
Normalization – a data analysis technique
that organizes data into groups to form non
redundant, stable, flexible, and adaptive en
tities.
8-44
Normalization: 1NF, 2NF, 3NF
First normal form (1NF) – entity whose attributes have no more
than one value for a single instance of that entity
• Any attributes that can have multiple values actually describe a s
eparate entity, possibly an entity and relationship.
Second normal form (2NF) – entity whose nonprimary-key attrib
utes are dependent on the full primary key.
• Any nonkey attributes dependent on only part of the primary key
should be moved to entity where that partial key is the full key. M
ay require creating a new entity and relationship on the model.
Third normal form (3NF) – entity whose nonprimary-key attribut
es are not dependent on any other non-primary key attributes.
• Any nonkey attributes that are dependent on other nonkey attribu
tes must be moved or deleted. Again, new entities and relationsh
ips may have to be added to the data model.
8-45
First Normal Form Example 1
8-46
First Normal Form Example 2
8-47
Second Normal Form Example 1
8-48
Second Normal Form Example 2
8-49
Third Normal Form Example 1
Derived attribute – an attribute whose value can be cal
culated from other attributes or derived from the values
of other attributes.
8-50
Third Normal Form Example 2
Transitive dependency
– when the value of a no
nkey attribute is depende
nt on the value of another
nonkey attribute other tha
n by derivation.
8-51
SoundStage 3NF Data Model
8-52
Data-to-Location-CRUD Matrix

More Related Content

Similar to 8.pptx

DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
JasmineMichael1
 

Similar to 8.pptx (20)

Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptx
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
DBMS CS 4-5
 
Database Management System
Database Management System Database Management System
Database Management System
 
7chap007_data modeling and analysis_14-7-19.ppt
7chap007_data modeling and analysis_14-7-19.ppt7chap007_data modeling and analysis_14-7-19.ppt
7chap007_data modeling and analysis_14-7-19.ppt
 
Asi Chap007
Asi Chap007Asi Chap007
Asi Chap007
 
ER Modeling.ppt
ER Modeling.pptER Modeling.ppt
ER Modeling.ppt
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
Database design
Database designDatabase design
Database design
 
Database design
Database designDatabase design
Database design
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
 
Conceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-modelsConceptual Data Modelling Using ER-models
Conceptual Data Modelling Using ER-models
 
chapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdfchapter 3-Data Modelling using Entity Relationship .pdf
chapter 3-Data Modelling using Entity Relationship .pdf
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
Entity relationship diagram (erd)
Entity relationship  diagram (erd)Entity relationship  diagram (erd)
Entity relationship diagram (erd)
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modeling
 
Data Modelling..pptx
Data Modelling..pptxData Modelling..pptx
Data Modelling..pptx
 

Recently uploaded

Sustainability: Balancing the Environment, Equity & Economy
Sustainability: Balancing the Environment, Equity & EconomySustainability: Balancing the Environment, Equity & Economy
Sustainability: Balancing the Environment, Equity & Economy
Operational Excellence Consulting
 
Communicative rationality and the evolution of business ethics: corporate soc...
Communicative rationality and the evolution of business ethics: corporate soc...Communicative rationality and the evolution of business ethics: corporate soc...
Communicative rationality and the evolution of business ethics: corporate soc...
BOHR International Journal of Business Ethics and Corporate Governance
 
chapter 10 - excise tax of transfer and business taxation
chapter 10 - excise tax of transfer and business taxationchapter 10 - excise tax of transfer and business taxation
chapter 10 - excise tax of transfer and business taxation
AUDIJEAngelo
 
20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf
tjcomstrang
 
anas about venice for grade 6f about venice
anas about venice for grade 6f about veniceanas about venice for grade 6f about venice
anas about venice for grade 6f about venice
anasabutalha2013
 

Recently uploaded (20)

Using Generative AI for Content Marketing
Using Generative AI for Content MarketingUsing Generative AI for Content Marketing
Using Generative AI for Content Marketing
 
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-indiafalcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
 
Lookback Analysis
Lookback AnalysisLookback Analysis
Lookback Analysis
 
Sustainability: Balancing the Environment, Equity & Economy
Sustainability: Balancing the Environment, Equity & EconomySustainability: Balancing the Environment, Equity & Economy
Sustainability: Balancing the Environment, Equity & Economy
 
IPTV Subscription in Ireland: Elevating Your Entertainment Experience
IPTV Subscription in Ireland: Elevating Your Entertainment ExperienceIPTV Subscription in Ireland: Elevating Your Entertainment Experience
IPTV Subscription in Ireland: Elevating Your Entertainment Experience
 
Communicative rationality and the evolution of business ethics: corporate soc...
Communicative rationality and the evolution of business ethics: corporate soc...Communicative rationality and the evolution of business ethics: corporate soc...
Communicative rationality and the evolution of business ethics: corporate soc...
 
chapter 10 - excise tax of transfer and business taxation
chapter 10 - excise tax of transfer and business taxationchapter 10 - excise tax of transfer and business taxation
chapter 10 - excise tax of transfer and business taxation
 
Improving profitability for small business
Improving profitability for small businessImproving profitability for small business
Improving profitability for small business
 
Equinox Gold Corporate Deck May 24th 2024
Equinox Gold Corporate Deck May 24th 2024Equinox Gold Corporate Deck May 24th 2024
Equinox Gold Corporate Deck May 24th 2024
 
20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf
 
Team-Spandex-Northern University-CS1035.
Team-Spandex-Northern University-CS1035.Team-Spandex-Northern University-CS1035.
Team-Spandex-Northern University-CS1035.
 
April 2024 Nostalgia Products Newsletter
April 2024 Nostalgia Products NewsletterApril 2024 Nostalgia Products Newsletter
April 2024 Nostalgia Products Newsletter
 
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
 
Business Valuation Principles for Entrepreneurs
Business Valuation Principles for EntrepreneursBusiness Valuation Principles for Entrepreneurs
Business Valuation Principles for Entrepreneurs
 
5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer
 
anas about venice for grade 6f about venice
anas about venice for grade 6f about veniceanas about venice for grade 6f about venice
anas about venice for grade 6f about venice
 
What are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdfWhat are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdf
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
 
Unveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdfUnveiling the Secrets How Does Generative AI Work.pdf
Unveiling the Secrets How Does Generative AI Work.pdf
 
sales plan presentation by mckinsey alum
sales plan presentation by mckinsey alumsales plan presentation by mckinsey alum
sales plan presentation by mckinsey alum
 

8.pptx

  • 1. McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 8 Data Modeling and Ana lysis
  • 2. Objectives • Define data modeling and explain its benefits. • Recognize and understand the basic concepts and constructs of a data model. • Read and interpret an entity relationship data model. • Explain when data models are constructed during a project and w here the models are stored. • Discover entities and relationships. • Construct an entity-relationship context diagram. • Discover or invent keys for entities and construct a key-based dia gram. • Construct a fully attributed entity relationship diagram and describ e data structures and attributes to the repository. • Normalize a logical data model to remove impurities that can mak e a database unstable, inflexible, and nonscalable. • Describe a useful tool for mapping data requirements to business operating locations.
  • 3. 8-3
  • 4. 8-4 Data Modeling Data modeling – a technique for organizing and documenting a system’s data. Sometim es called database modeling. Entity relationship diagram (ERD) – a dat a model utilizing several notations to depict data in terms of the entities and relationship s described by that data.
  • 6. 8-6  Persons: agency, contractor, customer, department, division, employee, instructor, student, supplier.  Places: sales region, building, room, branch office, campus.  Objects: book, machine, part, product, raw material, software license, software package, tool, vehicle model, vehicle.  Events: application, award, cancellation, class, flight, invoice, order, registration, renewal, requisition, reservation, sale, trip.  Concepts: account, block of time, bond, course, fund, qualific ation, stock. Data Modeling Concepts: Entity Entity – a class of persons, places, objects, even ts, or concepts about which we need to capture a nd store data. • Named by a singular noun
  • 7. 8-7 Data Modeling Concepts: Entity Entity instance – a single occurrence of an entity. Student ID Last Name First Name 2144 Arnold Betty 3122 Taylor John 3843 Simmons Lisa 9844 Macy Bill 2837 Leath Heather 2293 Wrench Tim instances entity
  • 8. 8-8 Data Modeling Concepts: Attrib utes Attribute – a descriptive property or ch aracteristic of an entity. Synonyms incl ude element, property, and field. • Just as a physical student can have attri butes, such as hair color, height, etc., da ta entity has data attributes Compound attribute – an attribute tha t consists of other attributes. Synonym s in different data modeling languages are numerous: concatenated attribute, composite attribute, and data structure.
  • 9. 8-9 Data Modeling Concepts: Data Type Data type – a property of an attribute that identifies what type of data can be stored in that attribute. Representative Logical Data Types for Attributes Data Type Logical Business Meaning NUMBER Any number, real or integer. TEXT A string of characters, inclusive of numbers. When numbers are included in a TEXT attribute, it means that we do not expect to perform arithmetic or comparisons with th ose numbers. MEMO Same as TEXT but of an indeterminate size. Some business systems require the abi lity to attach potentially lengthy notes to a give database record. DATE Any date in any format. TIME Any time in any format. YES/NO An attribute that can assume only one of these two values. VALUE SET A finite set of values. In most cases, a coding scheme would be established (e.g., F R=Freshman, SO=Sophomore, JR=Junior, SR=Senior). IMAGE Any picture or image.
  • 10. 8-10 Data Modeling Concepts: Doma ins Domain – a property of an attribute that defines what val ues an attribute can legitimately take on. Representative Logical Domains for Logical Data Types Data Type Domain Examples NUMBER For integers, specify the range. For real numbers, specify the range and precision. {10-99} {1.000-799.999} TEXT Maximum size of attribute. Actual values usually infinite; however, users may specify certain narrative restrictions. Text(30) DATE Variation on the MMDDYYYY format. MMDDYYYY MMYYYY TIME For AM/PM times: HHMMT For military (24-hour times): HHMM HHMMT HHMM YES/NO {YES, NO} {YES, NO} {ON, OFF} VALUE SET {value#1, value#2,…value#n} {table of codes and meanings} {M=Male F=Female}
  • 11. 8-11 Data Modeling Concepts: Default Value Default value – the value that will be recorded if a value is not specified by the user. Permissible Default Values for Attributes Default Value Interpretation Examples A legal value from t he domain For an instance of the attribute, if the user does not specify a value, then use this value. 0 1.00 NONE or NULL For an instance of the attribute, if the user does not specify a value, then leave it blank. NONE NULL Required or NOT N ULL For an instance of the attribute, require that the user enter a legal value from the domain. (This is used when no value in the domain is common enough to be a default but some value must be entered.) REQUIRED NOT NULL
  • 12. 8-12 Data Modeling Concepts: Identif ication Key – an attribute, or a group of attribut es, that assumes a unique value for ea ch entity instance. It is sometimes calle d an identifier. • Concatenated key - group of attributes t hat uniquely identifies an instance. Syno nyms: composite key, compound key. • Candidate key – one of a number of key s that may serve as the primary key. Syn onym: candidate identifier. • Primary key – a candidate key used to u niquely identify a single entity instance. • Alternate key – a candidate key not sel ected to become the primary key. Synon ym: secondary key.
  • 13. 8-13 Subsetting criteria – an attrib ute(s) whose finite values divi de all entity instances into us eful subsets. Sometimes calle d an inversion entry. Data Modeling Concepts: Subsetting Criteria
  • 14. 8-14 Data Modeling Concepts: Relati onships Relationship – a natural business associati on that exists between one or more entities . The relationship may represent an event that links the entities or merely a logical affinity th at exists between the entities.
  • 15. 8-15 Data Modeling Concepts: Cardi nality Cardinality – the minimum and maximum numbe r of occurrences of one entity that may be related to a single occurrence of the other entity. Because all relationships are bidirectional, cardinalit y must be defined in both directions for every relatio nship. bidirectional
  • 17. 8-17 Data Modeling Concepts: Degre e Degree – the number of entities that partici pate in the relationship. A relationship between two entities is called a binary relationship. A relationship between three entities is calle d a 3-ary or ternary relationship. A relationship between different instances of the same entity is called a recursive relation ship.
  • 18. 8-18 Data Modeling Concepts: Degre e Relationships may exist between more than two entities an d are called N-ary relationships. The example ERD depicts a ternary re lationship.
  • 19. 8-19 Data Modeling Concepts: Degre e Associative entity – an entity that inher its its primary key fr om more than one o ther entity (called pa rents). Each part of that co ncatenated key poin ts to one and only o ne instance of each of the connecting en tities. Associative Entity
  • 20. 8-20 Data Modeling Concepts: Recursive Relationship Recursive relationship - a relationship that exists between instances of the same entity
  • 21. 8-21 Data Modeling Concepts: Foreign Keys Foreign key – a primary key of an entity that is used in another entity to identify instances of a r elationship. • A foreign key is a primary key of one entity that is cont ributed to (duplicated in) another entity to identify inst ances of a relationship. • A foreign key always matches the primary key in the a nother entity • A foreign key may or may not be unique (generally no t) • The entity with the foreign key is called the child. • The entity with the matching primary key is called the parent.
  • 22. 8-22 Data Modeling Concepts: Parent and Child Entities Parent entity - a data entity that contributes one or more attributes to another entity, call ed the child. In a one-to-many relationship t he parent is the entity on the "one" side. Child entity - a data entity that derives one or more attributes from another entity, called the parent. In a one-to-many relationship th e child is the entity on the "many" side.
  • 23. 8-23 Data Modeling Concepts: Foreign Keys Student ID Last Name First Name Dorm 2144 Arnold Betty Smith 3122 Taylor John Jones 3843 Simmons Lisa Smith 9844 Macy Bill 2837 Leath Heather Smith 2293 Wrench Tim Jones Dorm Residence Director Smith Andrea Fernandez Jones Daniel Abidjan Primary Key Primary Key Foreign Key Duplicated from p rimary key of Dor m entity (not unique in Stu dent entity)
  • 24. 8-24 Data Modeling Concepts: Nonid entifying Relationships Nonidentifying relationship – relationship where each participating entity has its own independent primary key • Primary key attributes are not shared. • The entities are called strong entities
  • 25. 8-25 Data Modeling Concepts: Identifying Relationships Identifying relationship – relationship in which the parent entity’ key is also part of the primary key of the child entity. • The child entity is called a weak entity.
  • 26. 8-26 Data Modeling Concepts: Sample CASE Tool Notations
  • 27. 8-27 Data Modeling Concepts: Nons pecific Relationships Nonspecific relati onship – relations hip where many in stances of an entit y are associated wi th many instances of another entity. A lso called many-to- many relationship. Nonspecific relatio nships must be resolved, gener ally by introducing an associative entit y.
  • 28. 8-28 Resolving Nonspecific Relation ships The verb or verb phrase of a many- to-many relationship sometimes su ggests other entities.
  • 29. 8-29 Resolving Nonspecific Relation ships (continued) Many-to-many rel ationships can be r esolved with an as sociative entity.
  • 30. 8-30 Resolving Nonspecific Relation ships (continued) While the above relationship is a many-to-many, the many on th e BANK ACCOUNT side is a known maximum of "2." This sugg ests that the relationship may actually represent multiple relatio nships... In this case two separate relationships. Many-to-Many Relationship
  • 31. 8-31 Data Modeling Concepts: Gene ralization Generalization – a concept wherein the attributes that are common to several types of an entity are grouped into their own entity. Supertype – an entity whose instances store attri butes that are common to one or more entity subty pes. Subtype – an entity whose instances may inherit common attributes from its entity supertype And then add other attributes unique to the subtype.
  • 33. 8-33 Process of Logical Data Modeli ng • Strategic Data Modeling • Many organizations select IS development pr ojects based on strategic plans. • Includes vision and architecture for information sy stems • Identifies and prioritizes develop projects • Includes enterprise data model as starting point fo r projects • Data Modeling during Systems Analysis • Data model for a single information system is called an application data model.
  • 34. 8-34 Logical Model Development Sta ges 1. Context Data model • Includes only entities and relationships • To establish project scope 2. Key-based data model • Eliminate nonspecific relationships • Add associative entities • Include primary and alternate keys • Precise cardinalities 3. Fully attributed data model • All remaining attributes • Subsetting criteria 4. Normalized data model Metadata - data about data.
  • 35. 8-35 JRP and Interview Questions for Data Modeling Purpose Candidate Questions (see textbook for a more complete list) Discover system entities What are the subjects of the business? Discover entity keys What unique characteristic (or characteristics) distinguishes an instance of each subject from other instances of the same subject? Discover entity subsetting criteria Are there any characteristics of a subject that divide all insta nces of the subject into useful subsets? Discover attributes and domains What characteristics describe each subject? Discover security and control needs Are there any restrictions on who can see or use the data? Discover data timing needs How often does the data change? Discover generalization hierarchies Are all instances of each subject the same? Discover relationships? What events occur that imply associations between subjects ? Discover cardinalities Is each business activity or event handled the same way, or are there special circumstances?
  • 36. 8-36 Automated Tools for Data Mode ling
  • 37. 8-37 Entity Discovery • In interviews or JRP sessions, pay attention to key words (i.e. "we need to keep track of ..."). • In interviews or JRP sessions, ask users to iden tify things about which they would like to captur e, store, and produce information. • Study existing forms, files, and reports. • Scan use case narratives for nouns. • Some CASE tools can reverse engineer existin g files and databases.
  • 40. 8-40 The Key-based Data Model with Generalization
  • 42. 8-42 What is a Good Data Model? • A good data model is simple. • Data attributes that describe any given entity shoul d describe only that entity. • Each attribute of an entity instance can have only o ne value. • A good data model is essentially nonredundan t. • Each data attribute, other than foreign keys, descri bes at most one entity. • Look for the same attribute recorded more than on ce under different names. • A good data model should be flexible and ada ptable to future needs.
  • 43. Data Analysis & Normalization Data analysis – a technique used to impro ve a data model for implementation as a da tabase. Goal is a simple, nonredundant, flexible, and adaptable database. Normalization – a data analysis technique that organizes data into groups to form non redundant, stable, flexible, and adaptive en tities.
  • 44. 8-44 Normalization: 1NF, 2NF, 3NF First normal form (1NF) – entity whose attributes have no more than one value for a single instance of that entity • Any attributes that can have multiple values actually describe a s eparate entity, possibly an entity and relationship. Second normal form (2NF) – entity whose nonprimary-key attrib utes are dependent on the full primary key. • Any nonkey attributes dependent on only part of the primary key should be moved to entity where that partial key is the full key. M ay require creating a new entity and relationship on the model. Third normal form (3NF) – entity whose nonprimary-key attribut es are not dependent on any other non-primary key attributes. • Any nonkey attributes that are dependent on other nonkey attribu tes must be moved or deleted. Again, new entities and relationsh ips may have to be added to the data model.
  • 49. 8-49 Third Normal Form Example 1 Derived attribute – an attribute whose value can be cal culated from other attributes or derived from the values of other attributes.
  • 50. 8-50 Third Normal Form Example 2 Transitive dependency – when the value of a no nkey attribute is depende nt on the value of another nonkey attribute other tha n by derivation.

Editor's Notes

  1. This repository of slides is intended to support the named chapter. The slide repository should be used as follows: Copy the file to a unique name for your course and unit. Edit the file by deleting those slides you don’t want to cover, editing other slides as appropriate to your course, and adding slides as desired. Print the slides to produce transparency masters or print directly to film or present the slides using a computer image projector.
  2. No additional notes
  3. Teaching Notes This slide shows the how this chapter's content fits with the building blocks framework used throughout the textbook. The emphasis of this chapter is upon the DATA. It also reflects the fact that data modeling may be performed during certain analysis phases and involves not only systems analysts…but owners and users.
  4. No additional notes
  5. Teaching Notes Be sure to explain that this is merely an example – there are numerous data modeling notations. While they may differ in appearance (symbology) the knowledge that data models are intended to convey the same.
  6. Teaching Notes: Prompt the students for additional examples. Have them classify their example(s). Obtain a data model from a source other than the textbook. Ask the students to classify the entities.
  7. Teaching Notes Substitute the name(s) of one or more of your students. Be sure to explain that these are “instances” and that instances do NOT appear in the names of entity symbols.
  8. Teaching Notes: Go back to the slide showing the sample ERD (Figure 8-1). Pick an entity and ask the students to list attributes that they feel describe those entities. Show the students a form. Ask the students to identify the attributes. Be sure that the students recognize what items appearing on the form are truly attributes and those that are simply headings or preprinted items. Also, often students accidentally identify attribute values as attributes. For example, they may say that an item that appears as a check box is an attribute when in fact it may be the value of an attribute (ie. Male and female are values, whereas GENDER is the real attribute).
  9. Teaching Notes These are generic data types. If your students have taken a database class they would be familiar with the data types specific to that database.
  10. No additional notes
  11. No additional notes
  12. Teaching Notes Students can generally relate to the following example. Suppose you are working for an hourly wage. The employer has some method of tracking the hours you work. Whether that involves a time clock, an identification badge that it scanned, or a log book, the system records a certain number of hours and some employee identifier that says those hours are yours. Without that identifier, come pay day the employer would not know whose hours were whose. The employer might pay someone else for the hours you worked. That’s how important a primary key or identifier is.
  13. No additional notes
  14. Teaching Notes Explain that there may be more than one relationship between two entities. You may reinforce this by adding additional relationships to the example (such as “transferred from” (to reflect a relationship where students changed from one curriculum to another).
  15. Teaching Notes Ask the students to read (or write) declarative sentences to reflect the bidirectional meaning of the relationship between student and curriculum.
  16. Teaching Notes Although this figure shows five different options, help students see that there are really only two options for minimum cardinality (0 or 1) and two options for maximum cardinality (1 or many).
  17. Teaching Notes: Provide the students with an ERD that does not contain relationships. Ask the students to identify possible relationships and indicate a possible degree for that relationship. Emphasize to the students that the degree represents a business rule! Failure to accurately identify and document the degree will result in a system that does not reflect a correct business requirement.
  18. Teaching Notes The example also depicts an associative entity for the first time…as explained on the next slide.
  19. No additional notes
  20. Teaching Notes Ask the students to read (or write) declarative sentences to reflect the bidirectional meaning of the relationship. We created a composite key in this example. Be sure to point out the notation. Another classic example of a recursive relationship is in an Employee entity with a Supervisor attribute that holds the identifier of the supervisor’s instance of that same Employee entity.
  21. Teaching Notes Foreign keys are what make a relational database relational.
  22. Teaching Notes These concepts are illustrated on the next slide.
  23. Teaching Notes Have students identity which is the parent entity (Major) and which is the child (Student). Additional examples should be given to test the student’s ability to recognize the parent entity. We suggest you also provide an example of a one-to-one relationship!
  24. No additional notes.
  25. No additional notes.
  26. Teaching Notes Add slides to show students how the CASE or modeling tool that will be used in the class differentiates between identifying and nonidentifying relationships and weak and strong entities.
  27. Teaching Notes You may need to refer to the earlier slide that defines an associative entity In the bottom diagram we see that a student can declare multiple majors and that a curriculum can offer multiple majors. Note that for associative entities the cardinality from child to parent is always one and only one. An instance of MAJOR must correspond to one and only one STUDENT and to one and only one CURRICULUM.
  28. Teaching Notes Part (c) of Figure 8-9 is on the next slide
  29. No additional notes
  30. Teaching Notes This shows that while most nonspecific relationships are resolved by introducing a third entity, some are resolved by introducing separate relationships.
  31. Teaching Notes: If students have already studied object-oriented modeling, they will be familiar with generalization from that. Ask the students to identify a generalization example. What are some common attributes? What are some unique attributes associated with the subtype(s)? One common example is EMPLOYEE (supertype) with HOURLY EMPLOYEE (subtype) and SALARY EMPLOYEE (subtype).
  32. Teaching Notes Generalization can be multiple levels deep.
  33. Teaching Notes Data modeling may be performed during various types of projects and in multiple phases of projects. Data models are progressive and should be considered a living document that will change in response to changing business needs.
  34. Teaching Notes These are the steps that are followed in the case studies that accompany the text
  35. Teaching Notes Regardless of whether you use JRP, interviewing, or any other approach for information gathering, these are good questions to ask. Ask students to suggest other questions they could ask. It will help them and you make sure they understand the concepts and their real-world application. Students can ask themselves these questions as they walk though data modeling for class assignments.
  36. Teaching Notes You could substitute a screen shot from the modeling tool you use in your class. If your classroom has computer projection capabilities, you could demo the modeling tool.
  37. Teaching Notes The purpose of this slide is not just to show what a context data model looks like. Take the time to walk through the entities and relationships using information from the textbook as a guide.
  38. Teaching Notes Depending on your room conditions, you may want to break this diagram into two or more parts and resize each to insure readability. Discuss the issues regarding keys and codes from the textbook
  39. Teaching Notes Depending on your room conditions, you may want to break this diagram into two or more parts and resize each to insure readability. Discuss the need for the generalization.
  40. Teaching Notes Depending on your room conditions, you may want to break this diagram into two or more parts and resize each to insure readability. Discuss attribute naming conventions, attribute discovery from forms, and other attribute issues. Use the information in the textbook as a guide.
  41. No additional notes.
  42. No additional notes
  43. No additional notes
  44. Teaching Notes The repeating attributes are moved to a separate entity that has a one-to-many relationship to the original entity.
  45. Teaching Notes The repeating attributes are moved to a separate entity that has a one-to-many relationship to the original entity.
  46. Teaching Notes The attributes ordered-product-description and ordered-product-title do not describe the primary key (order-number) of Member Ordered Product. They describe Merchandise and Title instead.
  47. Teaching Notes This could be a good time to bring out the old saw, “The key, the whole key, and nothing but the key.”
  48. Teaching Notes Some students also might see Purchased-Unit-Price as a derived attribute since it can be derived from Suggested-Retail-Price of the PRODUCT entity. This is a useful concept to discuss in class. The reason why Purchased-Unit-Price must exist in MEMBER ORDERED PRODUCT is that while it can initially be derived from the PRODUCT entity, one would not be able to derive it at a later time if there were a price change. So these two attributes have subtly different definitions. One is the current price, which may change. The other is the price use for that particular order, which should not change.
  49. Teaching Notes Member Name and Member Address are dependent on Member Number, which is a foreign key to the Member entity. So they are moved to the Member entity.
  50. Teaching Notes Edit this slide as needed to ensure readability or refer students to the textbox.
  51. No additional notes