Relationships between tables


☞ While working with multiple tables you need to check the redundancy and inconsistency of data.

☞ This is done by setting relationships between the tables of a database.

☞ Let us consider an example of a database containing following two tables : Student_Details and Student_Result.

Master table and Master record :The record pertaining to admission number in Student_Details table is considered as master record and the table is called master table.

Transaction table and Transaction record :The corresponding record in the related table Student_Result is called transaction record and the table is called transaction table.

Types of Relationship

  1. One-to-One relationship : One specific record of a master table has one and only one corresponding record in the transaction table.
  2. One-to-Many relationship : One specific record of the master table has more than one corresponding record in the related transaction table.
  3. Many-to-Many relationship : There will be multiple records in the master table that correspond to multiple records in the transaction table as well.