08 data modelling pt2
TRANSCRIPT
-
8/13/2019 08 Data Modelling Pt2
1/19
Bite sized training sessions:Data ModellingPart 2 of 2
Data Definitions
-
8/13/2019 08 Data Modelling Pt2
2/19
Objectives
To understand
What is a data model and what it
is not!Why do data modelling
To be able to
Read a data modelBuild a data model
Critically review a data model
-
8/13/2019 08 Data Modelling Pt2
3/19
What is a data model? Specification of the data that isrequiredin order for
The solution to meet its objectives Processes to be able to run
A data model comprises: A diagram showing therequireddata dependencies
A set of data definitions required foreach attribute on thediagram
Also referred to as: Logical Data Model (LDM) Entity Model
Entity Relationship Diagram (ERD) Data Dictionary Object Model Class Diagram Data Structure
etc!
-
8/13/2019 08 Data Modelling Pt2
4/19
What a data model is not
A physical design for storing
data
A database design
Database table definitions
Object specification
-
8/13/2019 08 Data Modelling Pt2
5/19
Data Model Components
Entity A real world thing or an interaction between 2 or more real world things.
Relationship How and why entities depend on each other (the relationship) and what thatrelationship is (the cardinality of the relationship).
Attribute The atomic pieces of information that we need to know about entities.
-
8/13/2019 08 Data Modelling Pt2
6/19
Attributes
No (attribute) Name (attribute)
10 Fred Bloggs ( instance)
67 Freda Jones ( instance)
Customer(entity)
Customer No Product No Date
10 101 21/2/2020
67 452 22/2/2020
Sale
No Name Price
101 Flange 123.00
452 Blitwort 34.50
Product
The atomic pieces of information that we need to know about entities
-
8/13/2019 08 Data Modelling Pt2
7/19
Primary KeysA special kind of attribute, set of attributes and/or relationships
Is the way for the business to identify 1 unique instance of an entity
Certain rules apply to a primary key:
Must not be repeated within an entity
Once assigned can never be updated (only deleted)
Must be the way that the business uniquely identify an instance of an entity
No (attribute) Name (attribute)
10 Fred Bloggs ( instance)
67 Freda Jones ( instance)
Customer(entity)
-
8/13/2019 08 Data Modelling Pt2
8/19
Primary Keys are the navigation method for
relationships
Purchases
Purchased via
No (attribute) Name (attribute)
10 Fred Bloggs ( instance)
67 Freda Jones ( instance)
Customer(entity)
Customer No Product No Date
10 101 21/2/2020
67 452 22/2/2020
Sale
No Name Price
101 Flange 123.00
452 Blitwort 34.50
Product
-
8/13/2019 08 Data Modelling Pt2
9/19
5 Data Modelling No-Nos
1. No repeating attributes on entities
E.g. On a Customer entity 1stchild name, 2ndchild name
2. No attributes on entities that do not depend on the primary key
E.g. On Customer entity order date
The following should have been addressed via enti ty relationshipdiagram:
3. No Many to Manys between entities
4. No one to ones between entities (usually)
5. No circular relationships between entities (usually)
-
8/13/2019 08 Data Modelling Pt2
10/19
A word about data definitions
There is no definitive set of information to define data
There is some basic information that will always beneeded
Do what you need to do in order to define the data
The following has worked during real-life project and is aproven starting point
-
8/13/2019 08 Data Modelling Pt2
11/19
Process for defining the data
For each entity on the diagram
Define the entity
Define its relationships
Identifynon-key attributes from
Process specs
User input
Your analysis of requirements but always verify they are in scope!
Define attributes
-
8/13/2019 08 Data Modelling Pt2
12/19
Data definitions - Entities
what the entity really islegal definition
Example: the Sale entity is a record of when a Product waspurchased by a Customer
The (non-functional)requirementsthe business has for entities
Attributes
example: Date, Quantity
Retention period
example: 6 yearsjustification: legal requirement
Max volume (max number of instances)
Example: 60,000 based on average number of sales per year of
10,000 x retention period Examples (not a requirement but very useful)
Example: On 28/4/2011 a flange was sold to Fred Bloggs
-
8/13/2019 08 Data Modelling Pt2
13/19
Data definitions - Relationships
What the relationship really islegaldefinition
Example: For the relationship Customer
purchases Sale A Customer agrees to makeimmediate and full payment for a Product
which is given to the Customer at the time the
Sale is made.
The (non-functional)requirementsforrelationships is the cardinalityalreadydefined in the diagram
-
8/13/2019 08 Data Modelling Pt2
14/19
Data definitions - Attributes What the attribute really islegal definition
Example: On entity Sale the attribute Date: the day and time theSale was agreed with the Customer
The (non-functional)requirementsthe business has for them
Data type
Example: Numeric
Size Example: 12
Domainnot all attributes will have a domain
Example: Timestamp YYYYMMDDHHMM
Rulesnot all attributes will have a rule(s)
Example: Cannot be a Sunday or Bank Holiday andmust be between 09:00 and 17:30 and
always display as YYYY-MM-DD:HH.MM
Examples (not a requirement but very useful)
Example: 2011-04-28:10.05
-
8/13/2019 08 Data Modelling Pt2
15/19
Minor Exercise
I own a florists shop called MyFlorist.
I want to start emailing
reminders to customers whenspecial occasions are due forwhich they have broughtflowers in the pastforexample a spouses birthday.
We have already got a datamodel of the requirements solets define the data forCustomer.
-
8/13/2019 08 Data Modelling Pt2
16/19
AnanswerEntity Definition Attributes Retention
Period
Max
Volume
Examples
Customer
Relationship DefinitionCustomer needs Reminder
Attribute Definition Data Type Size Domain Rules Example
Customer.Email
Address
Someone who
purchases flowers from
My Florist
Email Address 3 years 9900
(3 years, 302 working
days per year, 15
customers per day)
The customer has purchased flowers from My Florist for a Special Occasion in the past, so reminders need to be
sent just before the anniversary of the event.
The email address given by the
customer at the point of sale offlowers for a Special Occasion
Character Unlimited Email address None [email protected]
-
8/13/2019 08 Data Modelling Pt2
17/19
Major Exercise You are business analysts working for a company called
re-Evolution Coffee Houses Ltd You have been given a piece of workref handouts
You have already produced a data model showing Entities
Primary Keys
Relationships
Define the data entities, relationships and attributes.
Suggestion: follow the process for producing a datamodel diagram 6 slides previously
The business users will be available for questions
-
8/13/2019 08 Data Modelling Pt2
18/19
If you need to make an assumption aboutbusiness requirements or anything else thendocument it
Time allowed: 45 minutes Deliverable:
Flip chart data definitions
Flip chart assumptions Be prepared to present your data
definitions to the other team
Dontworry about completing the exercise
Major Exercise
-
8/13/2019 08 Data Modelling Pt2
19/19
and finally
Any questions?
Further resources
Feedback
Thank-you!