Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
901 Which SQL clause defines a foreign key with cascade delete?
Explanation
This clause links the column to the parent key and specifies CASCADE as the delete action.
Last verified on 27-11-2026
902 What happens if you try to insert a child row before its parent row exists?
Explanation
Referential integrity requires the parent to exist first, so the child insert is rejected.
Last verified on 27-11-2026
903 Which integrity rule is enforced by a foreign key?
Explanation
Foreign keys enforce referential integrity between related tables.
Last verified on 27-11-2026
904 What is the purpose of referential integrity?
Explanation
Referential integrity prevents orphan rows and broken links between parent and child tables.
Last verified on 27-11-2026
905 If a foreign key column allows NULL, what does a NULL value mean?
Explanation
A NULL foreign key means no parent is assigned, which is allowed if the column permits NULL.
Last verified on 27-11-2026
906 Which of the following is a valid foreign key value?
Explanation
Only an existing parent key, or NULL where permitted, satisfies referential integrity.
Last verified on 27-11-2026
907 What is the difference between ON DELETE CASCADE and ON DELETE SET NULL?
Explanation
CASCADE removes dependent rows, while SET NULL preserves them with a NULL foreign key.
Last verified on 27-11-2026
908 Which action is safest when child rows must never be lost?
Explanation
RESTRICT blocks parent deletion while children exist, so no child data is lost.
Last verified on 27-11-2026
909 Can a foreign key reference a column that is neither a primary key nor a unique key?
Explanation
A foreign key must reference a primary key or a unique key so that each referenced value identifies exactly one parent row.
Last verified on 27-11-2026
910 After a parent row is deleted, the child rows remain but their foreign key becomes empty. Which referential action caused this?
Explanation
ON DELETE SET NULL keeps the child rows and sets their foreign key to NULL when the parent row is deleted.
Last verified on 27-11-2026