What is the default behavior of a foreign key when a referenced row is deleted? MCQ with Answer and Explanation

What is the default behavior of a foreign key when a referenced row is deleted?
A. Set null
B. Cascade delete
C. Depends on the ON DELETE action specified
D. Restrict
Answer: Option C
Solution (By JKSSB Mock Tests)
The behavior is defined by the ON DELETE rule (CASCADE, SET NULL, RESTRICT, NO ACTION) specified in the foreign key constraint.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
Which condition-tester returns TRUE if a subquery returns one or more records, and FALSE if the subquery returns no rows?
A. EXISTS
B. ANY
C. IN
D. ALL

Correct Answer: Option A


Explanation:
The EXISTS operator is used to test for the presence of any records in a subquery, returning TRUE as soon as a single matching row is encountered.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What is a 'foreign key' constraint specifically designed to prevent?
A. Actions that would destroy links or introduce invalid references between tables.
B. Slow search execution times.
C. The use of duplicate data values within the primary key column.
D. Unauthorized login attempts to the database.

Correct Answer: Option A


Explanation:
A Foreign Key constraint enforces referential integrity, preventing updates or deletions that would leave orphaned child records pointing to non-existent parent rows.

This question belongs to: Computer Database Management System (DBMS)
Question #3
What is the purpose of the SQL 'GROUP BY' clause?
A. To filter rows
B. To join tables
C. To sort the result set
D. To group rows that have the same values in specified columns into summary rows

Correct Answer: Option D


Explanation:
GROUP BY organizes data into groups based on the values of one or more columns, often used with aggregate functions.

This question belongs to: Computer Database Management System (DBMS)