- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Types of Entity Relationships in DBMS
Entity in DBMS can be a real-world object with an existence, For example, in a Company database, the entities can be Employees, Department, Project, etc. In a College database, the entities are Profession, Students, Result, Activities, etc.
An entity is represented as a single rectangle, shown below
The following are the entity relationships −
One-to-One Relationship
Under One-to-One (1:1) relationship, an instance of entity P is related to instance of entity Q and an instance of entity Q is related to instance of entity P.
Let us see an example −
A person can have only one passport, and a passport is assigned to a single person.
One-to-Many Relationship
Under One-to-Many (1:N) relationship, an instance of entity P is related to more than one instance of entity Q and an instance of entity Q is related to more than one instance of entity P.
Let us see an example −
A Person can have more than one Bank Accounts but a bank account can have at most one person as account holder.
Many-to-Many Relationship
Under Many-to-Many (N:N) relationship, more than one instance of entity P is related to more than one instance of entity Q. For more than one instance of entity Q is related to more than one instance of entity P.
Let us see an example −
A person can have more than one skills. More than one person can attain a skill.