0% found this document useful (0 votes)
4 views15 pages

Referential Integrity in SQL Databases

The document outlines a project on 'Referential Integrity' in relational databases, focusing on ensuring data integrity and consistency using SQL queries. It includes details about the project's objectives, database design, sample SQL code, and the importance of referential integrity through practical examples. The project was completed by a student under the guidance of a teacher during the academic year 2025-2026.

Uploaded by

srajavarman25
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views15 pages

Referential Integrity in SQL Databases

The document outlines a project on 'Referential Integrity' in relational databases, focusing on ensuring data integrity and consistency using SQL queries. It includes details about the project's objectives, database design, sample SQL code, and the importance of referential integrity through practical examples. The project was completed by a student under the guidance of a teacher during the academic year 2025-2026.

Uploaded by

srajavarman25
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MOUNT ZION INTERNATIONAL

SCHOOL (CBSE)

PROJECT WORK
INFORMATION TECHNOLOGY
SUBJECT CODE : 402
SESSION : 2025 – 2026

SUBMITTED BY: SUBMITTED TO:


STUDENT NAME : ________________ TEACHER’S NAME :

ROLL NUMBER : ___________________ MRS. SUBHASHINI S

CLASS & SECTION : _________________

1 | Page
CERTIFICATE

This is to certify that _________________________ of class X has

successfully completed the Information Technology Project work

on the topic REFERENTIAL INTEGRITY – The Power of

Relational Databases Ensuring DATA INTEGRITY &

CONSISTENCY Using SQL QUERIES under the guidance of

Mrs. Subhashini S during the academic year 2025-2026.

Signature of Internal Examiner Signature of External Examiner

__________________________ __________________________

Signature of Principal

___________________

Date

___________

2 | Page
ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to our Principal

Dr. JALEJA KUMARI, as well as our IT teacher SUBHASHINI S, who gave

me a golden opportunity to do this project work in Information

Technology as a part of our Internal Assessment. This project has helped

me understand the importance of Data Consistency in Relational

Database Management System. It helps me understand how data records

are related between database tables in Parent – Child relationship using a

real-time example. I thank them sincerely for their help, guidance and

support, enabling me complete this project work.

Secondly, I would also like to thank my parents and friends who

helped us a lot in finishing this project within the stipulated time. Though I

have done this project work as a part of my internal assessment, I fully

feel satisfied as I gained more knowledge in Database coding.

Once again I thank everyone who have helped me in doing this

project.

3 | Page
INDEX

Sno. Particulars Page No.

1. Title of the Project

2. Software and Hardware

Requirements

3. Introduction

4. Problem Statement

5. Database Design

6. Sample Code

7. Output Screens

8. Bibliography

4 | Page
Topic of the Project

REFERENTIAL INTEGRITY

– The Power of Relational

Databases Ensuring

DATA INTEGRITY & CONSISTENCY

Using

SQL QUERIES

Session : 2025 – 2026

5 | Page
Software and Hardware

Requirements

Software:

● Operating System: Windows 10 /11 (64 bit)

● Application: LIBRE OFFICE [Link]

Hardware:

● Processor – Intel Core i3 or above

● RAM – Minimum 2 GB

● Storage – Minimum 100 GB Hard Disk

● Display – Standard

● KeyBoard & Mouse – Standard

6 | Page
INTRODUCTION

LibreOffice is a private, free and open-source office suite

released by a non-profit organisation. LibreOffice Base is a

free, open-source relational database management system

(RDBMS) front-end within the LibreOffice suite that helps users

create, manage, and interact with databases through tables,

queries, forms, and reports, using wizards for ease of use, and

can connect to various database engines . It offers a graphical

interface for data entry, modification, and analysis, functioning

as a powerful tool for everyday data management tasks.

A Relational Database Management System (RDBMS)

is software that manages databases based on the relational

model, storing data in structured tables with rows and

columns, using SQL for data manipulation, and ensuring data

integrity through relationships (keys) between tables.

Referential Integrity is a database concept that ensures

relationships between tables remain valid and consistent by

7 | Page
requiring that every foreign key value must match an existing

primary key value in a related table.

This prevents "orphan" records and ensures data accuracy

by guaranteeing that a record in one table cannot refer to a

record that no longer exists in another.

UPDATE CASCADE in databases automatically propagates

changes from a parent table's primary key to matching foreign

key values in related child tables, ensuring data consistency

without manual updates, often used with foreign key

constraints to maintain referential integrity when parent keys

change, say for migrating or merging data.

8 | Page
PROBLEM STATEMENT

This project works on two tables Customer and Orders. Customer

table will store the Customer ID, Customer Name and Customer Phone

number. Primary key in Customer table will be Customer Id.

Orders table will store the Order Id, Order Date and the related

customer who has placed the Order.

A relation will be created between Customer and Orders table, such

that One Customer can place Many Orders. Hence the relation created

between the two tables is One-to-Many. The main aim of this project is

to depict the Integrity Constraint Error, when a user tries to create an

order for a non-existing customer.

At the same time, this project aims in explaining the concept of

Update Cascade such that when a customer details is being changed,

the corresponding rows of the customer in Order table (Child) will

automatically be updated.

Customer table with above fields will be created first, using the DDL

– Create Table query. The next step is to insert data rows in Customer

table using the DML – Insert command. Once the rows are inserted in

customer table, we now create the Order Table.

While trying to insert a non-existing customer Id in customer table,

the system throws an Integrity Constraint – No Parent error. The system

9 | Page
will not allow the user to insert data rows in the Orders table. The

system will only insert records in Orders table, for all those Customers

only existing in Customer Table. This is done through the Customer ID

field. This customer ID is the primary key in Customer table and the

same becomes the foreign key in Orders table.

While creating the relation between both tables, Update Cascade option

should be selected. Now execute a update customer ID statement in the

sql editor. Then display all the records in the customer table. New value

will be there in the customer table (Parent table). Immediately when

checking the Orders table (Child table), we can see the updated new

customer Id value being shown for all the child table data records related

to that customer Id.

10 | Page
DATABASE DESIGN

DATABASE NAME : MYSHOP

TABLE NAME : CUSTOMER

COLUMN LIST:

CUSTID INT PRIMARY KEY

CUSTNAME VARCHAR()

CUSTPHNO VARCHAR()

TABLE NAME : ORDERS

COLUMN LIST:

ORDERID INT PRIMARY KEY

ORDERDATE DATE

CUSTID VARCHAR()

RELATION :

1 n
places ORDERS
CUSTOMER many 11 | Page
SQL QUERIES (SAMPLE CODING)

Creation of Tables
create table customer
(
custId int primary key,
custname varchar(100),
custphno varchar(100)
)

create table orders


(
Orderid int primary key,
Orderdate date,
Custid int
)
Insertion of Data into the Tables

insert into customer


( custid, custname, custphno)
Values
(1, ‘veena’, ‘9876654333’)

Insert into orders


( orderid, orderdate, custid)
Values
(1001, ‘2025-12-03’, 1)

Viewing data in the Tables

12 | Page
Select * from customer;
Select * from orders;

OUTPUT CODE

13 | Page
CONCLUSION

I hereby thank all my teachers and team mates, helping me

complete this project work in a successful manner. I am now, very well

aware of how queries form the major part of database manipulation,

thereby facilitating data input, processing and relating data with other

tables, putting in constraints to maintain data consistency, avoiding data

redundancy, avoiding existence of orphan records using the concept of

Referential Integrity in Relational Database Management System.

14 | Page
BIBILIOGRAPHY

REFERENCE FROM TEXTBOOKS:

1. NCERT TEXT BOOK CLASS 10 – INFORMATION TECHNOLOGY

WEBSITES
1. [Link]
2. [Link]
3. [Link]

15 | Page

You might also like