What is a Relationship in a database management system?
A relationship captures how two or more entities are related to one another. There will be relationship among entities.
Example:
A supervises relationship between an employee and a department.
Nurse take care the patient

Types of Relationships:
The relationship between entities may be one-to-one, one-to-many or many-to-many.
Example1: (One-to-one and One-to-many)
If you take entities Student, Batch and Subject, the following are the 2 possible relationships
One-to-one relationship between batch and subject. One batch is associated with only one subject.
One-to-many relationship between batch and student entities. One batch may contain many students.
Example2: Many-to-One:
Employees -> report to ->Manager. Employees in a particular team/dept are reporting to the manager of that team/dept.
A relationship captures how two or more entities are related to one another. There will be relationship among entities.
Example:
A supervises relationship between an employee and a department.
Nurse take care the patient

Types of Relationships:
The relationship between entities may be one-to-one, one-to-many or many-to-many.
Example1: (One-to-one and One-to-many)
If you take entities Student, Batch and Subject, the following are the 2 possible relationships
One-to-one relationship between batch and subject. One batch is associated with only one subject.
One-to-many relationship between batch and student entities. One batch may contain many students.
Example2: Many-to-One:
Employees -> report to ->Manager. Employees in a particular team/dept are reporting to the manager of that team/dept.
Comments
Post a Comment