Conceptual Data Modeling Concept of ERD Entity Relationship Diagram (ERD) is building block of Relational Database Design It was developed by Peter Chain in 1976
Conceptual Data Modeling Concept of ERD It is end result of Systematic process to visualize Business data not Business Process Its is graphical representation of relationship between things in System
Conceptual Data Modeling Concept of ERD It is end result of Systematic process to visualize Business data not Business Process Its is graphical representation of relationship between things in System
Conceptual Data Modeling Components of ERD Entity Attributes Relationships
Conceptual Data Modeling Entity and Attributes Word is rooted from Latin word “en” meaning being. Entity is name of place, person or thing about which something can be stored in a system
Conceptual Data Modeling Entity and Attributes Attribute are those qualities or data about Entities to be stored. #: Primary Key * : Mandatory 0: Optional
Conceptual Data Modeling Relationships To reduce redundancy in databases , relationships are created between entities Interaction among entities are captures using relationships
Conceptual Data Modeling Relationships Relationship is bi-directional It consist of Optionality (O) and Cardinality (C) R=O + C
Conceptual Data Modeling Optionality Minimum child records that can exist per parent record It can be Zero or One Zero is represented by ----- (dotted line) One by Solid line
Conceptual Data Modeling
Conceptual Data Modeling
Conceptual Data Modeling Cardinality Maximum child records that can exist per parent record It can be One or more Represented by < , >
Conceptual Data Modeling Cardinality Cardinality is read with opposite entity
Conceptual Data Modeling
Conceptual Data Modeling
Conceptual Data Modeling One to Many Relationship This is basic relationship One record of parent entity (table) having zero or more occurrence in child entity (table)
Conceptual Data Modeling One to Many Relationship Primary key of parent table is referenced in Child Table as Foreign Key
Conceptual Data Modeling
Conceptual Data Modeling
Conceptual Data Modeling
Conceptual Data Modeling Many to Many Relationship This is basic not a relationship Third table is created where primary keys of both table are exported as foreign keys
Conceptual Data Modeling Many to Many Relationship One to many is resolved into Two One to Many relationships
Conceptual Data Modeling
Conceptual Data Modeling
Conceptual Data Modeling One-to-One This is A basic relationship There is no parent and child table There is exactly one matching record in two tables
Conceptual Data Modeling One-to-One Primary key of any table exported as Foreign key in any one table Foreign is made is Unique Key
Conceptual Data Modeling
Conceptual Data Modeling Implementing ERD using Scenario – 1
Implementing ERD using Scenario – 1 In a Building – Apartment renting scenario, there are Apartment, building and customer. There are multiple floors in the building and on each floor there are multiple apartments, floor can have zero or no apartment. Each apartment can be rented at most one customer but customer can rent out multiple apartments from same building and apartment can be available on multiple floor or same. At the end of month a recipe is generated against which a rent is deposited
Implementing ERD using Scenario – 1
Conceptual Data Modeling Implementing ERD using Scenario – II
Implementing ERD using Scenario – 1 There are musical bands which record songs and request musical companies to launch their songs in the form of Album. Songs are written by song writers. Album can contain at least one song to be album and max of 12 songs. Writer can write multiple songs but songs are usually written irrespective of the number of person in the bands.
Implementing ERD using Scenario – 1