Pr.Pg Next Pg

Type of Relationships tutorials

There are 3 types of relationships

1)      One to One ( 1 : 1 )

2)      One to many or Many to one ( 1 : m )

3)      Many to Many ( m : m )

 

One to One ( 1 : 1 )

  • In one to one relationship, one instance of entity can relate to only one instance of related entity. The relationship is one to one.

  • For example: assume in college one student is allowed to do one project. So here there is relationship of one to one between student and project.

 

 

ONE to MANY relationship ( 1 : m )

  • In a one to many relationships, one instance of an entity can relate to more than one instance of the related entity.

  • For example: in a company a departments have more than one employee.

 

 

 

 

3) MANY to MANY Relationship ( m : m )

  • In many to many relationship, more than one instance of an entity can relate to more than one instance of related entity.

  • For example: a customer can purchase more than one product, and a product can be purchased by more than one customer.

 

 

 

Once ER table is drawn, you need to derive table in following Database Structure

 

CUSTOMER PRODUCT

Customer_ID Product_ID

First_name Product_name

Last_name Purchase_price

Address_1 Sale_price

Address_2 Mfg_name

city Weight

State

telno

 


 

Pr.Pg border                                              Next Pg