Page 282 - Trackpad 402_Class-X_Final
P. 282
REFERENTIAL INTEGRITY
Referential Integrity is a very important rule of a DBMS. It deals with the rule that values of Foreign key in one table
is derived from the values of primary key in another table to ensure that this relationship between two tables will
provide accurate and consistent data. In other words, no data which serves as a link between two tables is either
deleted or changed by mistake.
Referential Integrity helps in the following conditions:
• Whenever a new record is added in a table with the foreign key then it ensures that the value added should exist in
a primary key of the other linked table.
• Updation or deletion in the Table with the primary key is not allowed if the matching record exists in the foreign key
of the other table.
WHAT ARE RELATIONSHIPS?
As we know a database contains a number of related tables. Sometimes we need data from different tables at the
same time. In such cases these tables need to be linked on the basis of a common field.
Relationships help you join two or more tables using a common field so that common data can be retrieved from
multiple tables at the same time.
The main advantage of joining the tables using relationships are:
• It saves time as the common data need not to be repeated in different tables.
• It reduces the chances of storing erroneous data.
• It helps you create a report or summarise data from two or more tables at the same time.
To understand the concept of a relationship let us create the given tables:
STUDENT MARKS
SUBJECTS BOOKS ISSUED
TEACHERS
282 Trackpad Information Technology-X

