Conceptual Data Modeling Using E-R Diagrams: PM Jat
Conceptual Data Modeling Using E-R Diagrams: PM Jat
PM Jat
[email protected]
Summary
Entity Type: Description of an Entity. For example:
Student(ID, Name, Batch, CPI)
Entity Set: set of all entitities belonging to a type, for example all students
17-Aug-12
Entity-Set
{ {ID:200701001,Name:Charu,Batch:2007, CPI:6.12}, {ID:200711002,Name:Amit Khanna,Batch:2007,CPI:7.12}, {ID:200711003,Name:Kamla Kiran,Batch:2007,CPI:7.50}, {ID:200711004,Name:Raj Kumar,Batch:2007,CPI:4.00}, {ID:200711005,Name:Raj Tiwari,Batch:2007,CPI:5.56}, {ID:200811001,Name:Rama Kant,Batch:2008,CPI:8.12}, {ID:200811002,Name:Akshya,Batch:2008,CPI:9.22}, {ID:200811003,Name:Unnati Gupta,Batch:2008,CPI:5.52} }
17-Aug-12
17-Aug-12
17-Aug-12
Relationship - Schema
Schema Diagram (ERD) tells (intention) that instance of one entity type is to be related with instances of other entity type
17-Aug-12
Relationship - instance
When you say Aditi studies in BIT, it is one instance of studies relationship; and It is interpreted as a student entity identified by Aditi is related with a program entity identified by BIT through studies relationship.
17-Aug-12
Relationship - instance
Example: entities related to another entities
When an entity is associated with other entity in the relationship type, then it is said to be participating in the relationship
17-Aug-12 Data Modeling Using E-R Diagrams 9
Relationship
When an entity is associated with other entity in the relationship type, the it is said to be participating in the relationship
17-Aug-12
10
Exercise
17-Aug-12
11
17-Aug-12
12
17-Aug-12
13
17-Aug-12
18
17-Aug-12
19
17-Aug-12
20
17-Aug-12
22
Participation Constraints
17-Aug-12
24
Participation Constraint
Participation Constraint can be Total (mandatory) or Partial (optional) If participating of an entity in a relationship is mandatory, then it is total participation otherwise, it is partial. For example, consider following Can a Student Entity exist without related with Program or without participating in studies relation. Can Employee exists without associated with a department as an employee Can an employee exist without becoming manager of some department If answer of any question above is yes, then participation of the entity in the relationship is Partial, otherwise it is Total
17-Aug-12 Data Modeling Using E-R Diagrams 25
Participation Constraints
In our Customer-Account example If customer record can exist in database without having associated with an account then participation of customer is partial otherwise total. Can a customer exist without having (associated with) an account? Can an account exist without having (associated with) a customer?
Partial Participation Total Participation
17-Aug-12
26
Student-Program schema
Participation of Student in Studies relationship is mandatory student has to study in a program. Participation of a Program can be optional we may not take admission in a program.
Total Participation
17-Aug-12
Partial Participation
27
Most of the time figuring out cardinality and participation constraints are easy but sometimes may become hard. Relationship Instance Diagram should helps in visualizing and figuring out these constraints
17-Aug-12
28
Relationship diagram should help in better visualization of Cardinality and Participation constraints
17-Aug-12
29
Exercise
17-Aug-12
30
Recursive Relationship
Entity having relationship with itself There can be many situations like this Employee supervises another employee One course has pre-requisite of another course One category is parent of another category One citizen is spouse of another citizen
17-Aug-12
31
17-Aug-12
32
Supervises
17-Aug-12
35