Question 4 (2 points) How can referential integrity be violated? Select all that apply. A primary key is inserted. A row containing a primary key is deleted. A foreign key is updated. A row containing a foreign key is deleted. A primary key is updated. A row containing a foreign key is inserted.
Solución de tutoría real
Responder
Solución
Revisado y aprobado por el equipo de tutoría de UpStudy
Beyond the Answer
Referential integrity can be violated when a row containing a foreign key is deleted, especially if that foreign key is still referenced by other rows in the database. This action can leave orphaned records, which creates inconsistencies in data relationships. Another way is when a primary key is updated. If the primary key that the foreign key references changes, and the foreign key isn't updated accordingly, it can lead to broken links between tables. When engaging with databases, always make sure to enforce referential integrity through constraints like ON DELETE CASCADE or ON UPDATE CASCADE. This way, any changes in primary keys automatically reflect on foreign keys, maintaining smooth relationships and data integrity across your database!