Database - Explain the types of relationships in database

Explain the types of relationships in database.

1) One-to-one: One to one is implemented using single table by establishing relationship between same type of columns in a table.

2) One-to-many: Implemented using two tables with primary key and foreign key relationships.

3) Many-to-many: Implemented using a junction table. The keys from both the tables form composite primary key of the junction table.

Explain the types of relationships in database.

There are four relationships in database.

- One to One: One entity is associated with another entity. For Ex: Each employee is associated with one department
- One to Many: One entity is associated with many other entities. For Ex: A company is associated with all working employees in one branch/office/country.
- Many to One: Many entities are associated with only one entity. For Ex: Many employees are associated with one project.
- Many to Many: Many entities are associated with many other entities. For Ex: In a company many employees are associated with multiple projects(completed/existing), and at the same time, projects are associated with multiple employees.
Database - What are the benifits of normalizing database?
The benefits of normalization are: The process of searching, sorting and creating indexes is faster...
Database - What is normalization?
Normalization is the way of organizing data in a database by removing redundancy and inconsistent dependency....
Database - What is denormalization?
The process of adding redundant data to get rid of complex join, in order to optimize database performance.....
Post your comment
Discussion Board
Examples One-to-One is wring
Here the department can have multiple employee so how it can be one-to-one relationship
Rakesh 09-17-2016