Download - An Introduction to Data Modelling
![Page 2: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/2.jpg)
2
WHY do we model data?
![Page 3: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/3.jpg)
3
WHAT is a data model?
![Page 4: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/4.jpg)
4
An album has an a creating artist, a title, recommended price, genre and album art that is displayed to a user. A user can subsequently purchase the album in various quantities and at different unit prices depending on specials on offer. A user’s purchase order will contain the date of purchase, their contact details (address, telephone and/or email) and the total price.
![Page 5: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/5.jpg)
Album
PK AlbumId
FK1 GenreIdFK2 ArtistId Title Price AlbumArtUrl
Artist
PK ArtistId
Name
OrderDetail
PK OrderDetailId
FK1 OrderIdFK2 AlbumId Quantity UnitPrice
Order
PK OrderId
Date Username Name Address Phone Email Total
Genre
PK GenreId
Name Description
![Page 6: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/6.jpg)
6
WHERE do we use data models?
![Page 7: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/7.jpg)
7
WHEN would a Business Analyst use data models?
![Page 8: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/8.jpg)
Data Model Levels
Conceptual
Logical
Physical
![Page 9: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/9.jpg)
How do we data model?• People
• Business, users, developers, DBAs
• Inputs• Business & functional requirements, business processes,
databases, documents, UI screens
• Tools• Drawing packages (e.g. PowerPoint, Visio), data modelling
packages (e.g. ERWin, System Architect)
![Page 10: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/10.jpg)
Entity Relationship Model• Most common data modelling technique• Used in most business information system development• Tools that engineer a database from a data model
![Page 11: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/11.jpg)
ER Process1. Identify entities2. Identify attributes3. Identify relationships4. Apply naming conventions5. Assign keys6. Normalise
![Page 12: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/12.jpg)
12
Identify entities• An object that exists and is distinguishable from other
objects• Examples: person, company, event, place• Should be a singular concept
EntityName Person Chair Entity
Name
![Page 13: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/13.jpg)
13
Identify attributes• Properties of an entity
Person ChairFirst NameLast NameEmail Address
ColourHeightPrice
AttributeName
AttributeName
![Page 14: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/14.jpg)
14
• One to many
Identify relationships• An association between two entities• Cardinality and optionality
• One to one
• Many to many
• Roles
Person Chair Person Table
Person Phone Number Person
Person Phone
Number
Phone Number
Person Chairsits on
![Page 15: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/15.jpg)
15
Apply naming conventionsExamples:• Singular vs plural names for entities
• Consistent names: date, summary, description, name
• Reference Types all ending with Type
• Standardise suffixes: Id, Key, Code, Flag
![Page 16: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/16.jpg)
16
Assign keys
Person
PK Tax File Number
First Name Middle Names Last NameFK1 Address Id
Address
PK Address Id
Address Line 1 Address Line 2 Suburb State Post Code
PrimaryKey
ForeignKey
SurrogateKey
PrimaryKey
NaturalKey
![Page 17: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/17.jpg)
17
Normalise• Every non-key attribute in every table is directly
dependent on the key• Results in:
• Elimination of redundancies
• Fewer anomalies
• Most information systems are in third-normal form
![Page 18: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/18.jpg)
18
Scenario 1
![Page 19: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/19.jpg)
19
Scenario 1 – A Possible Data Model
Incident
Incident DateSummaryDescriptionDangerous Event Flag
Location
Location IdName
Person
Person IdFirst NameLast Name
Electrical IncidentMotor Vehicle Incident
Environmental Incident
Injury/Illness Incident
DescriptionClassification
Bodily Location Type
Nature Type
Bodily Location
Nature
Investigation
Person Type
Investigator
Person Injured/Ill
Supervising Officer
Reported By
![Page 20: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/20.jpg)
20
Scenario 2
![Page 21: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/21.jpg)
21
Scenario 2 – A Possible Data Model
Asset
Serial Number
SegmentAsset Type
Model
Product FamilyRevision Number
Manufacturer
Installation History
Install DateUninstall Date
Agent
Attribute
Value
Unit TypeAttribute Type
![Page 22: An Introduction to Data Modelling](https://reader036.vdocument.in/reader036/viewer/2022062400/56816923550346895de057de/html5/thumbnails/22.jpg)
Data Model Patterns
David Hay – Data model patterns: Conventions of thought
Martin Fowler – Analysis patterns: Reusable object models
Len Silverston – The data model resource book: A library of universal data models for all enterprises