Database

Relationship In Database

Relationship in Database

Relationship In Database: A relationship is an association between the instances of one or more entity types in the database which represents some information. For example, a student may be related to a class by being enrolled in that class in different universities, college and school. Another example is the link between mother and children. One mother may have many children, but each children has only one mother.

A relationship between entities is given a relevant name that represent some data in the data file. or example there is a relationship between Manager and Department in the same organization or institute. A manager manages the department with in the specific organization or institute.

 

Relationship In Database

Related Articles

Relationship In Database

Types of Relationship

The most common relationship in E-R Models are as follows

  • Binary Relationship
  • Unary Relationship
  • Ternary Relationship

Binary Relationship

A relationship type of degree two is called binary relationship in the E-R Model of the relationship in the database. A binary relationship is the relationship between the instances of two entity types of the same data file of the same organization. It is the most common type of relationship countered in E-R data modeling of the database in the same organization. It is one of the famous relationship in  database

A binary relationship is further divided into

  1. One-to-one Relationship
  2. One-to-many Relationship
  3. Many-to-many Relationship

One-to-one Relationship

In one-to-one relationship, two entity types are associated in such a way that for each instance in first entity type, there is only one matching instance in second entity type.

For example the relationship between COUNTRY and CAPITAL and PRINCIPAL and COLLEGE can be shown as        

Relationship In Database

Example 2      

 

Relationship In Database

One-to-many Relationship

In one-to-many relationship two entities are associated in such a way that for each instance in first entity type, there can be many matching instances in Second entity type. On the other hand, for each instance in second entity type, there is only one matching instance in first entity type in the same data file of same organization or institute.

Example

Relationship In Database

Example 2      

      Relationship In Database                             

Many-to-many Relationship

In many-to-many two entities are associated in such a way that for each instance in first entity type, there can be many matching instance in second entity type.

Example

Relationship In Database

Example 2      
 
Relationship In Database

 

Elements Of ER Model

Show More
Check Also
Close
यौगिक किसे कहते हैं? परिभाषा, प्रकार और विशेषताएं | Yogik Kise Kahate Hain Circuit Breaker Kya Hai Ohm ka Niyam Power Factor Kya hai Basic Electrical in Hindi Interview Questions In Hindi