Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Database Management System (DBMS)  >  Previous Year Questions: Integrity Constraints

Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE) PDF Download

Q1:Consider the following tables T1 and T2.  (2017 SET 2)

Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE)

In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with ondelete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 on-delete set NULL and on-update cascade. In order to delete record (3,8) from table T1, the number of additional records that need to be deleted from table T1 is _____.
(a) 0
(b) 1
(c) 2
(d) 3
Ans: 
(a)
Sol: 
As Q refers to R so, deleting 8 from Q won't be an issue, however S refers P. But as the relationship given is on delete set NULL, 3 will be deleted from T 1 and the entry in T 2 having 3 in column S will be set to NULL. So, no more deletions. Answer is 0.

Q2: The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-delete cascade.  (2005) 

Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE)

The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:
(a) 3,4) and (6,4)
(b) (5,2) and (7,2)
(c) (5,2), (7,2) and (9,5)
(d) (3,4), (4,3) and (6,4)

Ans: (c)
Sol: Since deleting ( 2 , 4 ) , since 2 is a primary key, you have to delete its foreign key occurrence i.e ( 5 , 2 ) and ( 7 , 2 )
Since we are deleting 5 , and 7 we have delete it foreign key occurrence i.e ( 9 , 5 ) .
There is no foreign key occurrence for 9 .

The document Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Database Management System (DBMS).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
62 videos|66 docs|35 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Previous Year Questions: Integrity Constraints - Database Management System (DBMS) - Computer Science Engineering (CSE)

1. What are integrity constraints in the context of computer science engineering?
Ans. Integrity constraints in computer science engineering refer to rules that define the valid values and conditions for data stored in a database, ensuring data accuracy and consistency.
2. How do integrity constraints help in maintaining data integrity in a database system?
Ans. Integrity constraints help in maintaining data integrity by enforcing rules such as uniqueness, referential integrity, and domain constraints, preventing the insertion of invalid or inconsistent data into the database.
3. What is the difference between a primary key and a foreign key in the context of integrity constraints?
Ans. A primary key is a unique identifier for a table and enforces entity integrity, while a foreign key establishes a relationship between two tables and enforces referential integrity by ensuring that the values in the foreign key column exist in the referenced table's primary key column.
4. How can constraints like NOT NULL and CHECK be used to enforce data integrity in a database?
Ans. The NOT NULL constraint ensures that a column cannot contain NULL values, while the CHECK constraint allows for the definition of conditions that must be met for values in a column, thereby enforcing data integrity.
5. Why is it important to define and enforce integrity constraints in a database management system?
Ans. Defining and enforcing integrity constraints in a database management system is crucial as it ensures data accuracy, consistency, and reliability, helping prevent errors, inconsistencies, and data corruption.
62 videos|66 docs|35 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

pdf

,

Previous Year Questions with Solutions

,

Objective type Questions

,

ppt

,

Important questions

,

shortcuts and tricks

,

Summary

,

video lectures

,

Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Semester Notes

,

Free

,

Viva Questions

,

MCQs

,

Extra Questions

,

Previous Year Questions: Integrity Constraints | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

practice quizzes

,

study material

,

mock tests for examination

,

Exam

,

past year papers

,

Sample Paper

;