3. Data Integrity
Data integrity refers to maintaining and assuring the accuracy and
consistency of data over its entire life-cycle
Data integrity is a fundamental component of information security
Data integrity is the opposite of data corruption, which is a form of data loss.
Any unintended changes to data as the result of a storage, retrieval or
processing operation, including malicious intent, unexpected hardware
failure, and human error, is failure of data integrity
5. Entity Integrity
Entity::
In database , an entity is a single person, place, or thing about which data
can be stored.
Integrity:
The term integrity refers to the accuracy or correctness of data in the
Database..
6. Entity Integrity is the mechanism the system provides to maintain primary keys.
Entity Integrity ensures that there are no duplicate records within the table and that
the field that identifies each record within the table is unique and never null.
The existence of the Primary Key is the core of the entity integrity. If you define a
primary key for each entity, they follow the entity integrity rule.
The primary key serves as a unique identifier for rows in the table.
Entity Integrity ensures two properties for primary keys: The primary key for a row is
unique; it does not match the primary key of any other row in the table.
7. Refrential integrity:
Referential integrity is a relational database concept in which multiple tables
share a relationship based on the data stored in the tables, and that
relationship must remain consistent.
Referential integrity is a property of a database that requires all properties of
one particular table to be included in another.
Based On foreign Key
When Foreign Key is Imposed Means Refrential Integrity is Implemented
If foreign key is not imposed means refrential integrity is voilated
8.
9. Question For You?
Suppose company X has 2 tables, an Employee table, and an Employee Salary
table. In the Employee table we have 2 columns – the employee ID and the
employee name. In the Employee Salary table, we have 2 columns – the
employee ID and the salary for the given ID
Now, suppose we wanted to remove an employee because he no longer works at
company X. Then, we would remove his entry in the Employee table. Because he
also exists in the Employee Salary table, we would also have to manually remove
him from there also. Manually removing the employee from the Employee Salary
table can become quite a pain. And if there are other tables in which Company X
uses that employee then he would have to be deleted from those tables as well –
an even bigger pain.