Download presentation
Presentation is loading. Please wait.
1
Entity-Relationship Model
2
Degree of a Relationship Set
Refers to number of entity sets that participate in a relationship set. Relationship sets that involve two entity sets are binary (or degree two). Generally, most relationship sets in a database system are binary. Entity Relationship Modelling
3
Descriptive Attribute
Used to record information about relationship rather than about participating entities. Eg: sunil works in HR department since since is attribute of relationship works_in Entity Relationship Modelling
4
Binary Relationship set
Entity Relationship Modelling
5
Ternary relationship set
Entity Relationship Modelling
6
Total and partial participation
consider a relationship set "Manages" which associates departments with employees. If a department cannot have more than one manager, this is an example of a one-to-many relationship set (it may be that an individual manages multiple departments). Entity Relationship Modelling
7
Entity Relationship Modelling
an individual manages multiple departments Each employee works in at least one department and each department has at least one employee. Participation of both entities in works relationship is total Entity Relationship Modelling
8
Entity Relationship Modelling
The participation of entity set employee in relationship ‘Manages’ is partial – Not every employee can become manager. Represent a total participation constraint by using a thick line. Entity Relationship Modelling
9
Entity Relationship Modelling
10
Entity Relationship Modelling
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the existence of a identifying entity set Identifying relationship depicted using a double diamond Entity Relationship Modelling
11
Entity Relationship Modelling
The discriminator (or partial key) of a weak entity set is the set of attributes that distinguishes among all the entities of a weak entity set. The primary key of a weak entity set is formed by the primary key of the strong entity set on which the weak entity set is existence dependent, plus the weak entity set’s discriminator. Entity Relationship Modelling
12
Entity Relationship Modelling
13
Entity Relationship Modelling
Keys Employee table: Employee ( Employee ID, FullName, SSN, DeptID ) Super Key: If you add any other column/attribute to a Primary Key then it become a super key, like EmployeeID + FullName is a Super Key. a set of attributes collectively identify an entity in the entity set uniquely Entity Relationship Modelling
14
Entity Relationship Modelling
2. Candidate Key: are individual columns in a table that qualifies for uniqueness of all the rows. Here in Employee table EmployeeID & SSN are Candidate keys. It is minimal super key Entity Relationship Modelling
15
Entity Relationship Modelling
3. Primary Key: is the columns you choose to maintain uniqueness in a table. Here in Employee table you can choose either EmployeeID or SSN columns, EmployeeID is preferable choice, as SSN is a secure value. 4. Alternate Key: Candidate column other the Primary column, like if EmployeeID is PK then SSN would be the Alternate key. Entity Relationship Modelling
16
Entity Relationship Modelling
5. Composite Key: If a table do not have any single column that qualifies for a Candidate key, then you have to select 2 or more columns to make a row unique. Like if there is no EmployeeID or SSN columns, then you can make FullName + DateOfBirth as Composite primary Key. But still there can be a narrow chance of duplicate row. Candidate key with one attribute- simple attribute Candidate key with more than one attribute- composite attribute Entity Relationship Modelling
17
Entity Relationship Modelling
Extended ER Features Generalization is a bottom-up approach in which two lower level entities combine to form a higher level entity. In generalization, the higher level entity can also combine with other lower level entity to make further higher level entity Entity Relationship Modelling
18
Entity Relationship Modelling
Specialization Specialization is opposite to Generalization. It is a top-down approach in which one higher level entity can be broken down into two lower level entity. In specialization, some higher level entities may not have lower-level entity sets at all. Entity Relationship Modelling
19
Another way of representation
Entity Relationship Modelling
20
Entity Relationship Modelling
Aggregation Aggregation is a process when relation between two entity is treated as a single entity. Here the relation between Center and Course, is acting as an Entity in relation with Visitor. Entity Relationship Modelling
21
Entity Relationship Modelling
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.