Relationship / Relationship Set and their types in ER Model

Relation between two or more entities is called relationship. If this relationship is between two or more entity set then it is called relationship set. In ER Model, relationship is represented by diamond box. In relational data model, primary key and foreign key is used for joining two or more relations.
By this relationship, we can write any complex SQL query from two or more tables.

Relationship are of following types - 

1. Unary relationship :- 
if relationship is between records of only one entity then it is called unary relationship.

Example :- employee manages or controls other employees.

2. Binary relationship :- if relationship lies between two different entities or entity set then this type of relationship is called binary relationship.

Example:- a teacher teaches student

3. Ternary relationship:- if three different type of entities/entity set takes part in a relationship, then it is called ternary relationship. A ternary relationship into three parts.
Here first of all we convert two entity/entity set into a higher level entity set. This process is called aggregation.

Example :- relationship between father, mother & children.

Degree of relationship - 

Total number of entities participated in a relationship are called degree of relationship.

No comments:

Post a Comment

Nested SQL Query or SQL Sub Query in hindi in english

if a SQL query is used inside another SQL query then this type of SQL query is called sub-query.  यदि किसी SQL क्वेरी का उपयोग, किसी अन्य SQ...