logow

Data Integrity And Data Integrity Rules, E-R DIAGRAM

HELLO WELCOME TO THIS DATABASE MANAGEMENT SYSTEM BLOG...........

IN THIS TOPIC WE ARE GOING TO COVER FOLLOWING TOPICS .........

1.) WHAT IS DATA INTEGRITY AND DATA INTEGRITY RULES ???????? 



DATA INTEGRITY 

Data integrity is the overall completeness, accuracy and consistency of data. This can be indicated by the absence of alteration between two instances or between two updates of a data record, meaning data is intact and unchanged. Data integrity is usually imposed during the database design phase through the use of standard procedures and rules. Data integrity can be maintained through the use of various error-checking methods and validation procedures.
Data integrity is important techniques in database creation and reduce redundancy of data.

>>  DATA INTEGRITY RULES IN DBMS .......... >>

Entity Integrity:

Requirement: All primary key entries are unique, and no part of a primary key may be null.

Purpose: Each row will have a unique identity, and foreign key values can properly reference primary key values.

Example: No invoice can have a duplicate number, nor can it be null. In short, all invoices are uniquely identified by their invoice number.


Referential Integrity:
     
Requirement: A foreign key may have either a null entry, as long as it is not a part of its table’s primary key, or an entry that matches the primary key value in a table to which it is related. (Every non-null foreign key value must reference an existing primary key value).

RULES 2 .....

1. Domain constraints

  • Domain constraints can be defined as the definition of a valid set of values for an attribute.
  • The data type of domain includes string, character, integer, time, date, currency, etc. The value of the attribute must be available in the corresponding domain.
Example:

2. Entity integrity constraints

  • The entity integrity constraint states that primary key value can't be null.
  • This is because the primary key value is used to identify individual rows in relation and if the primary key has a null value, then we can't identify those rows.
  • A table can contain a null value other than the primary key field.
Example:


HERE IS THE E-R DIAGRAM OF DOCTOR PATIENT RELATIONSHIP IN DBMS ................... 


DIFFERENTIATE BETWEEN WEAK ENTITY SET AND STRONG ENTITY SET ...........................................  



ANOTHER DIFFERENCE ................





THANKS ALL !!!!!!!!!!!!!!!!!!!!!!!      

Post a Comment

0 Comments