In a relational database with referential integrity, which key prevents the deletion of a row from a customer table while referencing it in orders?

Prepare for the CISA Domain 4 Exam with tailored quizzes. Enhance your auditing skills with detailed explanations and practice multiple-choice questions for cybersecurity professionals. Optimize your study time and ensure success!

In a relational database, referential integrity ensures that relationships between tables remain consistent. When a record in one table references a record in another table, any operation—such as deletion—on the referenced table must maintain this integrity.

In the scenario described, the customer table and orders table are related. The foreign key in the orders table corresponds to the primary key in the customer table, establishing a link between the two. This foreign key constraint prevents the deletion of a row from the customer table if there are still orders linked to that customer. If an attempt to delete a customer is made while there are existing related orders, the database will reject the deletion to maintain referential integrity.

The primary key uniquely identifies each record in a table but does not enforce any constraints regarding other tables' dependencies. The secondary key serves the purpose of facilitating data retrieval based on non-primary key columns but also does not enforce referential integrity. Lastly, a public key is unrelated to the concepts of database keys; it is typically associated with encryption and data security.

Thus, the foreign key serves the critical function of preserving referential integrity between the customer and orders tables by preventing the deletion of a customer record that is still referenced, making it the appropriate choice.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy