Entity integrity and referential integrity in dbms in hindi referential integrity constraint in dbms

Опубликовано: 16 Декабрь 2020
на канале: QuickCS
5,194
83

Referential Integrity, Entity Integrity Constraint, Foreign Keys
A tutorial by QUICKCS
What are we going to learn?
What is Entity Integrity Constraint?
What is Referential Integrity Constraint?
What is Foreign Key?
Entity Integrity Constraints
Entity Integrity Constraints : It states that no primary key value be NULL.
Why?
This is because Primary Key is used to identify individual tuple in a relation.


Having “NULL” values for primary key implies that we cannot identify some tuple.
For example If we were trying to reference some tuple from other relation & 2 or more tuple had the primary key “NULL” how can we differentiate.
Example
Referential Integrity Constraints:
Informally, the referential integrity constraint states that a tuple in one relation that refers to another relation must refer to an existing tuple in that relation.
The Referential Integrity Constraint is specified between 2 relations and is used to maintain consistency among tuples in 2 relations.
Foreign Key
Definition: A foreign key is a set of attributes in relation schema R1 is a foreign key in R1 that references relation schema R2 if it satisfies following 2 conditions:
1. The attributes in FK have the same domain(s) as the primary key attributes PK of R2; the attributes FK are said to reference or refer to the relation R2.
2. A value of FK in a tuple t1 of the current state r1(R1) either occurs as a value of PK for some tuple t2 in the current state r2(R2) or is NULL. In the former case, we have t1[FK] = t2[PK], and we say that the tuple t1 references or refers to the tuple t2.
#referentialintegrityconstraints #foreignkey #entityintegrity


Смотрите видео Entity integrity and referential integrity in dbms in hindi referential integrity constraint in dbms онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь QuickCS 16 Декабрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 5,194 раз и оно понравилось 83 людям.