0% found this document useful (0 votes)
5 views4 pages

Akashdbmslab 3

The laboratory exercise focuses on Entity Integrity and Referential Integrity Constraints in relational databases, emphasizing the execution of DDL and DML commands. Students will create a database, populate it with data, and check for constraint violations through practical implementation. The exercise aims to enhance understanding of SQL commands and their application in database management.

Uploaded by

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

Akashdbmslab 3

The laboratory exercise focuses on Entity Integrity and Referential Integrity Constraints in relational databases, emphasizing the execution of DDL and DML commands. Students will create a database, populate it with data, and check for constraint violations through practical implementation. The exercise aims to enhance understanding of SQL commands and their application in database management.

Uploaded by

akash711ap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: AKASH A P Registration Number:22ETIS411004

Laboratory 3
Title of the Laboratory Exercise: Entity Integrity and Referential Integrity Constraints

1. Introduction and Purpose of Experiment


Entity integrity ensures the uniqueness and non-nullity of primary keys within a table, while
referential integrity ensures the consistency and accuracy of relationships between tables by
enforcing foreign key constraints. These concepts contribute to the overall reliability and
correctness of a relational database. By doing this lab, students will be able to check for the
various violations of referential integrity constraint by executing DDL and DML commands.

2. Aim and Objectives


Aim
• To execute Data Definition Language (DDL) and Data Management Language (DML)
commands to check for Entity Integrity and Referential Integrity constraints.
Objectives
At the end of this lab, the student will be able to
• Create a database and populate it with data using SQL commands
• Execute DDL and DML commands for the given database
• Check for the constraint violations

3. Experimental Procedure
i. Analyse the problem statement
ii. Execute DDL and DML commands
iii. Create a database for the given schema
iv. Design SQL commands using DDL and DML commands
v. Test the executed commands for constraint violations
vi. Analyse and discuss the outcomes of your experiment
vii. Document the work

4. Questions
a. Consider the following relational schema that keeps track of the employees in a
company. Enter three tuples for the relation. Assume appropriate domain and data type
for each field.
EMPLOYEE (Name, SSN, Salary, gender, phone, super_ssn, dno)
DEPARTMENT(dname,dnumber)

1
Name: AKASH A P Registration Number:22ETIS411004

i) Create the tables with SSN as PK of Employee, dnumber as PK of department,


super_ssn is the FK that references SSN of the employee table and dno is the FK that
references dnumber of department.

ii) Add a new attribute “Depart_Start_Date” after creation of department table.

iii) Populate each relation with minimum 3 tuples.

2
Name: AKASH A P Registration Number:22ETIS411004

iv) Check for the violation of constraints from referencing table and referenced table.

v) Drop the attribute “salary” from the employee table.

5. Conclusion:

n this laboratory exercise, we successfully explored the foundational concepts of SQL, focusing
on Data
Definition Language (DDL) and Data Manipulation Language (DML) commands. Through
practical implementation, we created a database, defined its schema, and manipulated data
within it using SQL
commands.
The exercise enhanced our understanding of:
Using DDL commands to establish and modify the structure of a database.
Applying DML commands to manage data by inserting, updating, deleting, and retrieving
records.
By practicing these commands, we strengthened our ability to interact with relational
databases, a crucial skill for database management and application development. This lab
provides a solid foundation for more
advanced SQL operations and database design techniques in future exercises.

3
Name: AKASH A P Registration Number:22ETIS411004

You might also like