Professional Documents
Culture Documents
Class 4 - Integrity Constraints
Class 4 - Integrity Constraints
• Controlled Redundancy √
• Achieving Complex Relationship and Integrity – In Progress
Integrity Constraints
Type of Integrity Constraints
• Entity Integrity Constraint
• Referential Integrity Constraint
• Domain Integrity Constraint
• Self Referential Integrity Constraint
Keys
1. Candidate Key
2. Primary Key
3. Unique Key
4. Super Key
5. Foreign Key
6. Check constraint
7. Not Null
8. Default Constraint
9. Recrsive foreign Key
Candidate Key – Theoretical Key
Definition: An attribute or set of attributes that will retrieve unique rows
from the relation
Candidate Key # Attribute
Example: Student 1 Rollno
2 Name ,address
1. Rollno
3 Email
2. Name 4 Mobile
3. address 5 Rollno, name
.
4. Mobile
.
5. Email
Primary Key
• Uniqueness
• Not Null
• Will not change its value over lifetime
• Not an intelligent key
• Except Candidate key 1 other keys may fail in any one of the
properties. Rollno is the Primary key
Unique Key
• Unique
• But can be Null