How To Read A Data Model
How To Read A Data Model
By: Sanjay Sharma Consulting Enterprise and Data Architect e.mail: [email protected]
Goal
To develop basic literacy about data models.
To understand what it contains. To understand how information in it can be used more effectively. We would not touch upon technicalities of developing a data model.
Session Structure
What is a data model, its need and context. Different types of data models Semantics of data models How to read a data model How to use data models more effectively Question answers.
Why Model?
John Boyd (1927-1997) Military Strategist and Thinker Most original military thinker since Sun Tzu (600BC) OODA Loop: Every organization/organism uses OODA loop to adapt to its surroundings and survive.
Why model?
Observation is information gathering. Orientation is developing a mental framework of information by understanding its structure and relationships . Models are observation as well as orientation tools which use symbols for real world facts. Models are effective because human mind absorbs more information visually than textually. Models in business and IT Enterprise Models, Business Process Models, Workflow Models Interaction Models, Network Models etc.
HospitalConsultationReport inReportID: int IDENTITY (FK) hospConReportID: int NOT NULL doctorPersonRoleID: int NOT NULL doctorLU: text NULL dictationDate: datetime NULL diagnosis: text NULL findings: text NULL procedures: text NULL
HospitalOtherReport inReportID: int IDENTITY (FK) hospitalOtherReportID: int NOT NULL reportDate: datetime NULL hosOthReportTypeCode: int NULL source: varchar(50) NULL findings: text NULL procedures: text NULL comments: text NULL
HospitalImagingReport inReportID: int IDENTITY (FK) hospImgReportID: int NOT NULL reportDate: datetime NULL proceduresCode: int NULL findings: text NULL opinions: text NULL
InReportPsychTest inReportID: int NOT NULL (FK) source: varchar(50) NULL assessmentDate: varchar(30) NULL conclusions: text NULL summary: text NULL recs: text NULL
HospitalImagingReport inReportID: int IDENTITY (FK) hospImgReportID: int NOT NULL reportDate: datetime NULL proceduresCode: int NULL findings: text NULL opinions: text NULL GlasgowComaScale gcsID: int IDENTITY inReportID: int NOT NULL (FK) time: datetime NULL eyes: tinyint NULL verbal: tinyint NULL motor: tinyint NULL total: tinyint NULL InReportAmb inReportID: int NOT NULL (FK) scene: varchar(50) NULL sceneTime: datetime NULL destination: varchar(50) NULL destinationTime: datetime NULL complaint: varchar(100) NULL injuryMech: text NULL history: text NULL medications: text NULL allergies: text NULL consciousness: varchar(50) NULL airwayControlCode: int NULL note: text NULL NeuroPsychTest neuroPsychTestID: int IDENTITY inReportID: int NOT NULL (FK) test: varchar(75) NULL result: varchar(75) NULL note: text NULL
10
11
12
ESTIMATE DAIS CHUNKS Claim File Id (FK) Sequence Number DAIS Data
VEHICLE REPAIR LOG Vehicle Repair Log Claim File Id (FK) Vehicle Repair Log Secondary Id Vehicle Repair Log Logon Id Vehicle Repair Log TimeStamp Vehicle Repair Log Car In Date Vehicle Repair Log Car In Time Vehicle Repair Log Customer Contact Date Vehicle Repair Log Customer Contact Time Vehicle Repair Log Car Out Date Vehicle Repair Log Car Out Time Vehicle Repair Log Exclude Flag VRL_PVRT_NUM_DAYS ESTIMATE PRINT IMAGE LINE Claim File Id (FK) EstimateID (FK) Estimate Print Line Number Estimate Print Line Text
13
VRL_CLF_ID: DECIMAL(15,0) NOT NULL (FK) VRL_SEC_ID: SMALLINT NOT NULL VRL_LOGON_ID: CHAR(8) NOT NULL VRL_TMESTMP: TIMESTAMP NOT NULL VRL_CAR_IN_DTE: DATE NOT NULL VRL_CAR_IN_TME: DATE NOT NULL VRL_CUST_CNTCT_DTE: DATE NULL VRL_CUST_CNTCT_TME: DATE NULL VRL_CAR_OUT_DTE: DATE NULL VRL_CAR_OUT_TME: DATE NULL VRL_EXCLUDE_FLG: CHAR(1) NOT NULL VRL_PVRT_NUM_DAYS: SMALLINT NULL
14
15
Entities
A Thing of significance for business for which data has to be stored and manipulated. Nouns representing Objects, Events, Concepts, Relationships, Actions.. In data models represented as rectangles. Examples: Insurance policy, Claim, Vehicle, Event etc.
16
Entity sub-types
Some entities have many subtypes PERSON and ORGANIZATION entities are sub types of PARTY entity FULL TIME EMPLOYEE and CONTRACT EMPLOYEE are sub types of EMPLOYEE entity They are depicted as contained in main entity or as child of main entity
Party Employee
Full Time
Contract
Person
Organization
17
Attributes
The properties of Entities for which data has to be collected and stored. Attributes are represented as text strings contained inside the entities in data models. Example- Policy holder`s name, event date, claim amount etc
18
Relationships
Relationships represent how entities interact and create, use, modify or delete each other. They are represented by different types of lines going from one entity to another.
---------------_________
________ ________
-------------
19
Cardinality of relationship
Cardinality of relationship is number of instances of entities at the two ends of relationships. It is represented by 3 domain values Zero, One or Many It may be shown as a circle, a vertical line and a crow feet at the end of relationship lines or some other symbol. Sometimes it is represented as 0, 1 or n on relationship lines.
Policy ..1.. 0n Claim
Product
Line Item
20
Optionality of relationships
Optionality of relationship means whether the entity may be present or must be present in the relationship. It may be represented as solid line or broken line part in the relationship ( or some other way)
Policy
_____----------
Claim
21
22
Verb phrases
Verb Phrases describe relationship between two entities going from one entity to another in both directions.
Employs organization Works for Employee
Paid to Claim
Makes
Policy Holder
23
Keys
Keys are for navigating through data: information retrieval Primary Keys: A primary key is a group of attributes that uniquely identifies an entity instance. Every entity has exactly one primary key Foreign Keys: Navigating to attribute of an entity from another entity. FK attributes implement relationships and are owned by parent entities.
24
25
Domains
A named set of data values all of the same data type, upon which the actual value for an attribute instance is drawn. Every attribute must be defined on exactly one underlying domain. Multiple attributes may be based on the same underlying domain. Example of domain
Gender- M, F Province -Varchar(2) BC, AB, ON, NF, QC, MN, SC, YU Short Description- Varchar(40) Long Description Varchar(2000) Unique Identifier Integer(9)
26
27
Types of notations
Different types of semantic notations are available for ER diagramming
Chen Notations IDEF1X Information Engineering Barker Notations
28
Types of notations-IDEF1X
.
Independent Entities
Identifying Solid lines
Dependent Entities
Discriminator
Non-Identifying- Dashed lines
-----------Many-to-Many
Category Complete
Category In-Complete
-----------Zero-One or Many
Z
-----------P
Attributes
Mandatory
Optional
29
Types of notations-IDEF1X
Supported by most of the available tools. More geared towards developing physical database design Needs combination of notations to capture rules. These combinations not easily understood by business people- difficult to use in JAD sessions.
30
IDEF1X model
31
Super Type
Identifying
Sub Type
Sub Type
Exclusive OR in Finkelstein
Attributes
32
33
IE model
34
Exclusive OR
Super Type
Sub Type
35
36
37
Barker model
38
39
40
41
42
43
44
A PURCHASE ORDER must be received from only one PARTY. A PARTY must be of either PERSON or ORGANIZATION type. A PURCHASE ORDER may contain Zero, One or Many LINE ITEM. A LINE ITEM must be placed on only one PURCHASE ORDER. A PRODUCT may be on Zero, One or More LINE ITEM A LINE ITEM must shows only one PRODUCT. A PRODUCT may be of SOURCED PRODUCT or SERVICE Type Party Identifier is key identifier for PARTY. Product Identifier is key identifier for PRODUCT.
45
46
47
48
Further readings
Help section of the data modeling tools: most of the tools come with good support documentations on modeling methodology and notations.
Data Model Patterns: Convention of Thought by David C. Hay Data Modeling Made Simple: A Practical Guide for Business and IT Professionals by Steve Hoberman Data Modeling for the Business: A Handbook for Aligning the Business with IT using High-Level Data Models (Take It with You Guides) - By Steve Hoberman, Donna Burbank, Chris Bradley
50
51