In this article we will discuss the Comprehensive notes on referential integrity IT class 10. This topic is the part of perform operations on table which is one of the learning outcomes of the Unit 3 Database Management System for IT 402.

What is referential integrity IT class 10?

As now you are familiar with the terms primary key and foreign key which is used for referential integrity. These keys link more than one table with each other. The referential integrity helps to maintain the accuracy and consistency of data in the relational database.

Sometimes we need to check the redundancy of data and inconsistency of data. A particular record in a table should not be repeated as well as different data should not appear for a single entity in a database.

To do this, relationship between two or more tables are required. For creating relationship between tables a common field between two tables are mandatory.

For example:

A database contains to tables :

  1. Dept: To store department details
  2. Emp: To store employees details

Departments Table

deptnodname
10HR
20IT
30Accounts
40Marketing

Emp Table

empnoenamedeptno
1111Kiran Parmar10
1112Mukul Chauhan20
1113Animesh Patel30
1114Bhavin Mishra40

Important Facts to be known about referential integrity:

  1. The common columns in both table must be same.
  2. LibreOffice Base doesn’t allow relationship if they are not same.
  3. The common field in a table which is not repeated is called a primary key. Here deptno is primary key in dept table.
  4. The common field in another table is called foreign key. Here deptno is foreign key in emp table.
  5. The table having primary key is called base/parent/master table.
  6. The table having foreign key is called child/transaction table.
  7. The record in master is known as known as master record.
  8. The record in transaction table is known as transaction record.

Let’s start an article referential integrity IT class 10 with its advantages.

Advantages of referential integrity in database

  • Add records into the referenced table even there are no matching records in the parent table (Primary Key table)
  • Update records automatically when changes made to the parent table
  • Delete records from automatically from the parent table
  • Allows to retrieve linked data as and when required
  • Save the time of database developer
  • No need to enter the same data in separate tables
  • reduce data entry errors
  • Summarize data from related tables

Now we will see the types of relationship in the next section of referential integrity IT class 10.

Types of relationship

There are three types of relationships:

types of relationships in libreoffice base

Click here to know more….

Creating and Editing relationships between table

Now we will see how to create a relationship using OO/LibreOffice base for referential integrity IT class 10. By using relationship we are going to provide a connection or link or association between two tables. Hence it avoids data redundancy, in simple words, data duplicity can be avoided.

Steps to Create a relationship in OO Base

Create table to create relationship with primary key and foreign key. You can create relationship in two ways:

  1. Through Menu: Insert > New Relation
  2. Drag and Drop > Drag Primary Key column to related column into the another table

Follow the below given steps to create relationship in OO base.

  1. Click on Tool > Relationships. A new window appears to add tables in the relationship.
  2. If tables are not available, click on Insert > Add Tables option or click on Add Tables icon on the taskbar.
  3. Click on Insert > New Relations. A new window appears to select the Tables, fields, update options, and delete options. Select appropriate fields and options then click on the OK button. If you want to create a relationship using drag and drop click on the field of the primary key of one table and link them with the foreign key of the child table.
relationship command in OO Base
relationship command in OO Base
table relation design

Similarly, you can set the relationship of other types as well. When you add a relationship, the relation design window show one line that connects your tables.

In the next section of referential integrity IT class 10 we will discuss remove relationship.

Steps to Create a relationship in LibreOffice Base

Create a table event as follows:

EventIDEventNameDateWinnerScoreCategoryID
1Soccer2024-05-15Team A3.5C003
2Basketball2024-06-20Team B4.2C001
3Cricket2024-07-10Team C5.1C002
4Volley Ball2024-08-25Team D6.2C001
5Kabaddi2024-09-12Team E5.8C003

Create table EventCategory as follows:

Category_IDCategoryTeacher_Inc
C001Net GamesManoj
C002Bat-Ball GamesRajan
C003Combative GamesAjay

Follow these steps to create a relationship in LibreOffice Base:

[1] Click on Tools > Relationships…

Creating relationship in libreoffice

[2] A Relationship Design window will open with with add tables dialog box.

relationship design window libreoffice

[3] Add desired tables to create relationships.

Comprehensive notes on Referential integrity IT class 10

[4] Click on Close button in Add tables dialog box and close it.

[5] Drag the common field CategoryID from category table and drop on to the categoryid of event table.

[6] It will create line between these two tables as follows:

Relationship between two tables in libreoffice base

As per relationship rules and principles, ensure these things:

  1. No unmatched foreign key value should exist in the table.
  2. If any records is deleted from master table, corresponding transaction table record should be deleted or should be null.

LibreOffice allows these referential integrity options to choose:

Comprehensive notes on Referential integrity IT class 10

Remove Relationship

Removing relationship is quite simple. You can remove this relationship using one of the following:

  1. Click on connecting line and press delete key.
  2. Click on connecting line and do right click, then select Delete option.

Edit relationship is quite similar to delete relationship, click on connecting lines and do right click on table and select edit option.

Follow this link to get NCERT solutions for Chapter 10 Working with multiple tables in base.

NCERT Solutions Chapter 10 working with multiple tables in base

Follow this link for more important questions on referential integrity in base.

Important previous year questions referential integrity

With this I am going to conclude the article referential integrity IT class 10. So I hope you understood the concept very well. Share this article with your groups and share your views or feedback or suggestions through comments.

Feel free to ask your doubts or queries through comments.

Thank you for vising our blog. Keep visiting, Keep Learning.

Leave a Reply