Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
751 In a one-to-many relationship, where is the foreign key normally placed?
A
In the table on the one side
B
In a separate junction table only
C
In the table on the many side, referencing the one side
D
In both tables
Explanation
The many side stores the foreign key, so each child row points to its single parent.
Last verified on 27-11-2026
752 What is an orphan row?
A
A row with a null primary key
B
A row that has been deleted
C
A row with no columns
D
A child row whose foreign key points to a parent row that does not exist
Explanation
An orphan row is a child record left without its parent, which referential integrity is designed to prevent.
Last verified on 27-11-2026
753 A designer chooses a composite key (BookID, CopyNo) for a LibraryCopy table. Why is this suitable?
A
Because BookID alone identifies a copy
B
Because it makes the table smaller
C
Because it avoids a surrogate key
D
Because a book can have several copies, and CopyNo distinguishes copies of the same book
Explanation
BookID alone repeats for each copy, but BookID plus CopyNo is unique for every physical copy, so the composite key fits the real data.
Last verified on 27-11-2026
754 If a parent row is deleted and the foreign key is defined as ON DELETE CASCADE, what happens?
A
The child rows are also deleted automatically
B
The delete is blocked
C
The child foreign key is set to null
D
The child rows are moved to another table
Explanation
CASCADE propagates the delete to dependent child rows so no orphans remain.
Last verified on 27-11-2026
755 If a foreign key is defined as ON DELETE SET NULL, what happens when the parent row is deleted?
A
The child rows are deleted
B
The foreign key in child rows is set to NULL
C
The delete is rejected
D
The parent row is restored
Explanation
SET NULL keeps the child rows but clears their link to the deleted parent, which is allowed only if the foreign key column permits nulls.
Last verified on 27-11-2026
756 If a foreign key is defined as ON DELETE RESTRICT, what happens when a user tries to delete a parent row that has children?
A
The child rows are deleted automatically
B
The foreign key is set to zero
C
The delete is blocked until the child rows are removed or reassigned
D
The parent row is archived
Explanation
RESTRICT, also called NO ACTION, prevents deletion of a parent that is still referenced, protecting child data.
Last verified on 27-11-2026
757 A Department row is deleted. With ON DELETE SET NULL, what happens to Employees in that department?
A
The employees are deleted
B
The deletion is blocked
C
The employees are moved to another department
D
The employees remain but their DepartmentID becomes NULL
Explanation
ON DELETE SET NULL keeps child rows and sets their foreign key to NULL when the parent row is deleted.
Last verified on 27-11-2026
758 Which action should be used when child rows must never exist without a parent?
A
ON DELETE CASCADE
B
ON DELETE SET NULL
C
ON DELETE RESTRICT
D
ON DELETE SET DEFAULT
Explanation
CASCADE ensures that deleting a parent removes its dependent children, so no orphan rows can survive.
Last verified on 27-11-2026
759 A university wants to delete a Department that still has Students. Which foreign-key action best protects the students’ records from accidental loss?
A
ON DELETE CASCADE
B
ON DELETE RESTRICT
C
ON DELETE SET NULL
D
ON DELETE SET DEFAULT
Explanation
RESTRICT blocks the delete while students still reference the department, forcing a deliberate decision about the students first.
Last verified on 27-11-2026
760 A parent primary key changes and the child foreign keys change automatically. Which referential action is in effect?
A
ON UPDATE SET NULL
B
ON UPDATE RESTRICT
C
ON UPDATE CASCADE
D
ON UPDATE SET DEFAULT
Explanation
ON UPDATE CASCADE propagates changes in a parent primary key to the foreign keys of child rows.
Last verified on 27-11-2026