What is a foreign key constraint violation? MCQ with Answer and Explanation

What is a foreign key constraint violation?
A. Deleting a primary key that is referenced by a foreign key
B. Inserting a value in a foreign key column that does not exist in the referenced primary key
C. All of the above
D. Updating a primary key that is referenced
Answer: Option C
Solution (By JKExamLibrary)
Any action that breaks referential integrity, such as inserting an orphan record, deleting a referenced record, or updating a referenced key, will violate the foreign key constraint.

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

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1 Report Error
Which property of a DBMS ensures that all operations within a transaction are completed successfully, or none of them are executed at all?
A. Consistency
B. Atomicity
C. Durability
D. Isolation

Correct Answer: Option B


Explanation:
Atomicity follows the 'all-or-nothing' rule, ensuring that a transaction is either fully committed or completely rolled back if an error occurs.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
What is a super key in a relational database?
A. A key that includes the primary key
B. A set of attributes that uniquely identifies a row
C. A key that has extra attributes beyond a candidate key
D. Both A and B

Correct Answer: Option D


Explanation:
A super key is a set of one or more attributes that uniquely identifies a row. A candidate key is a minimal super key.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
What is a relation in relational database terms?
A. A key
B. A row
C. A table
D. A column

Correct Answer: Option C


Explanation:
In the relational model, a relation is a table consisting of rows and columns.

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