Download presentation
Presentation is loading. Please wait.
Published byIrea Baptiste Modified over 10 years ago
1
Documenting Database Designs with Entity- Relationship Diagrams IS 460 Notes by Thomas Hilton
2
What is the E-R Model? A method of conceptualizing and documenting data structures used in organizationsA method of conceptualizing and documenting data structures used in organizations Static, not dynamic (data, not process)Static, not dynamic (data, not process) Logical/conceptual, not physicalLogical/conceptual, not physical
3
Essential Definitions a group of instances that share the same attributes a group of instances that share the same attributes a link between entities a link between entities a simplified, abstract replica of some real-world system a simplified, abstract replica of some real-world system Entity- Relationship Diagram Conversations, observations, forms, reports, etc. Entity Identification Relationship Identification Key/Attribute identification Table Normalization Entity:Entity: Relationship:Relationship: Model:Model:
4
E-R Symbols No Fixed Standard, but Some Common Usage Maximum Cardinality 1 or M (or a particular number) If I have one of these, how many of those can I have?Maximum Cardinality 1 or M (or a particular number) If I have one of these, how many of those can I have? Minimum Cardinality 0 or 1 (or a particular number) If I have one of these, how many of those must I have?Minimum Cardinality 0 or 1 (or a particular number) If I have one of these, how many of those must I have? ENTITY Relationship Max:MinMin:Max
5
Attributes Can be represented with a circle or ellipse on the entity, but please dont for meCan be represented with a circle or ellipse on the entity, but please dont for me Instead do this: ENTITY [KEY-ATT, REQ-NON-KEY-ATT, REQ-NON-KEY-ATT, Opt-non-key-att]Instead do this: ENTITY [KEY-ATT, REQ-NON-KEY-ATT, REQ-NON-KEY-ATT, Opt-non-key-att]
6
Keys one or more attributes whose values uniquely identify each instance in an entity one or more attributes whose values uniquely identify each instance in an entity attributes (or attribute groups) which could function as primary keys attributes (or attribute groups) which could function as primary keys candidate keys not chosen as the primary key candidate keys not chosen as the primary key key consisting of more than one attribute key consisting of more than one attribute one or more attributes whose values identify groups of instances within an entity one or more attributes whose values identify groups of instances within an entity key replicated in two entities to instantiate a relationship between them key replicated in two entities to instantiate a relationship between them common key which is primary in one entity and secondary in the other common key which is primary in one entity and secondary in the other Primary:Primary: Candidate:Candidate: Alternate:Alternate: Composite:Composite: Secondary:Secondary: Common:Common: Foreign:Foreign:
7
Attribute Constraints Instantiate Business Rules consistency between entities (particularly common keys) consistency between entities (particularly common keys) whats legal and whats not (format, size, value ranges, etc.) whats legal and whats not (format, size, value ranges, etc.) (external and) internal consistency within the entity (external and) internal consistency within the entity transactions, data sources, required approvals, legitimate users, etc. transactions, data sources, required approvals, legitimate users, etc. Referential Integrity:Referential Integrity: Domain:Domain: Entity Integrity:Entity Integrity: Triggering operations:Triggering operations:
8
Table Normalization Analyze entities into tables that can be manipulated without data redundancy and the resulting modification anomaliesAnalyze entities into tables that can be manipulated without data redundancy and the resulting modification anomalies splitting the attributes of one entity into multiple tablessplitting the attributes of one entity into multiple tables All non-key attributes must be fully functionally dependentAll non-key attributes must be fully functionally dependent on the key, 1NF (non-dependencies)on the key, 1NF (non-dependencies) the whole key, 2NF (partial dependencies)the whole key, 2NF (partial dependencies) and nothing but the key. 3NF (transitive dependencies)and nothing but the key. 3NF (transitive dependencies) Definition:Definition: Tool:Tool: Rule:Rule:
9
Domain-Key Normal Form Every constraint on the table is a logical consequence of the table's domain constraints and key constraints Every constraint on the table is a logical consequence of the table's domain constraints and key constraints Have one theme per table Have one theme per table
10
Lets Do An Example!
11
INVOICECUSTOMER STOCK-ITEM- ON-INVOICE STOCK-ITEM sent to lists allocates 1 and only 1 0 or more 1 and only 1 0 or more 1 and only 1
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.