Entity integrity and referential integrity in database
What does it mean to say that a database displays both entity integrity and referential integrity? And why entity integrity and referential integrity important in a database? Provide an application example to support your discussion.
Sample Answer
Entity integrity and referential integrity are two important concepts in database design.
Entity integrity ensures that each row in a table is unique. This is done by assigning a primary key to each table, which is a column or a combination of columns that uniquely identifies each row in the table.
Referential integrity ensures that the foreign keys in a table point to valid values in the primary key of another table. This is done by creating a foreign key constraint on the foreign key column.
A database that displays both entity integrity and referential integrity is a well-designed database that is less likely to experience errors.