Relationship In DBMS

Relationship In DBMS

Introduction

  1. Whenever we are storing data in data in a structured format, we will not store all the data in one single

  2. Instead what we do is we store data in multiple tables and then try to establish a relation between

  3. By doing this we increase the efficiency of the database by reducing the time taken to sort and fetch out the required data

How to establish the relationship

  1. We will be establishing the relationship using the help of primary and foreign keys

Types Of Relationship

There are 4 types of relationship

  1. One-to-one relationships

  2. One - to -Many relationships

  3. Many- to- Many relationship

  4. Many-to-one relationship

Why do study the relationship

  1. The reason to do that is in the end we will always try to combine the data stored in the multiple tables and then return a single value of that table based on our requirements

  2. Knowing the relationship will enable us to perform this joining in a more easy way