Degree of relationship in DBMS

The number of entities that are participating in the relationship or known as the degree of that relationship.

The degree of relationship can be binary, ternary, or quaternary. For example, a student can be related to a teacher this relationship will be known as a binary relationship, also the teachers are related to a student and both the teacher and the student are related to the course then this will be called as ternary relationship

Another relationship can be quaternary in nature such as the students are related to the teacher and they are related to the course and department. 

There can be a case of unary relationship, for example, an employee can be related to another employee, in that case, the employee entity set will be related back to the employer entity set for example when some employees work under some other employees then we can see that unary relationships are in use. Therefore there are cases in which a unary entity set is also present.

 Also, there is no limit to which the entity set can be related to each other therefore there can be a degree of relationship which relates to many entity sets. Many times these relationships are binary in nature however there are times when we have to use many entity sets to relate to each other. Also, the binary relationships are very easy and less costly and as we increase the number of entity sets in a relationship the more time-consuming as well as expensive it becomes to map them physically into the databases. Therefore while designing an ER diagram mostly the designer tries to keep it to a binary relationship which reduces the cost of implementation and also you will find around 80 percent of the relationship in the ER diagram to be binary in nature. 

Let’s talk about the degree of relationship in detail

Unary relationship

These relationships are set when both the participating entity sets are the same. When this type of relationship exists then this type of relationship is called as unary as a relationship with degree one. This is the least degree for the relationship to exist and this type of relationship is always one to one.

Binary relationship

These relationships sets exist when there are two entity sets that are participating in the relationship. So when this type of relationship exists when the participating entity is two in number then it is called the binary relationship or relationship with degree two. Also, these types of relationships are very common and are easy to convert in a relational table.

Ternary

A relationship is said to be ternary in nature when there are three participating entities in the relationship set. These types of relationships are known as the ternary relationship. As the degree of the relationship exists so does the complexity of converting them into a relational table therefore there exists a method to convert these relationships into a simpler form.

N-ary 

There can be n number of entity sets that can participate in the relationship set then this type of relationship is called the N-ary relationship. There is absolutely no limit to which the number of entity sets can be created in the relationship therefore we describe them as the N-ary relationship. 

Leave a Comment