0% found this document useful (0 votes)
8 views3 pages

Understanding DBMS Integrity Constraints

Uploaded by

abhiramraaj39
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Understanding DBMS Integrity Constraints

Uploaded by

abhiramraaj39
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DBMS AND PL/SQL WEEK 5

Domain integrity constraint contains a certain set of rules or conditions to restrict the kind
of attributes or values a column can hold in the database table.

In the above student's table, the value A in the last row last column violates the domain integrity
constraint because the Class attribute contains only integer values while A is a character.

Entity Integrity Constraint is used to ensure that the primary key cannot be null. A primary
key is used to identify individual records in a table and if the primary key has a null value, then
we can't identify those records. There can be null values anywhere in the table except the
primary key column.

In the above employee's table, we can see that the ID column is the primary key and contains a
null value in the last row which violates the entity integrity constraint.

1 | Page
DBMS AND PL/SQL WEEK 5

Referential Integrity Constraint ensures that there must always exist a valid relationship
between two relational database tables. This valid relationship between the two tables confirms
that a foreign key exists in a table. It should always reference a corresponding value or attribute
in the other table or be null.
o A referential integrity constraint is specified between two tables. o In the Referential
integrity constraints, if a foreign key in Table 1 refers to the Primary Key of Table 2, then
every value of the Foreign Key in Table 1 must be null or be available in Table 2.

Primary key constraint: It states that the primary key attributes are required to be unique and
not null. That is, primary key attributes of a relation must not have null values and primary key
attributes of two tuples must never be same.

Example:
Here, in the below example the Student_id is the primary key attribute. The data entry of 4th
tuple violates the primary key constraint.

2 | Page
DBMS AND PL/SQL WEEK 5

Keys are the entity set that is used to identify an entity within its entity set uniquely. An entity set can
have multiple keys, but out of which one key will be the primary key. A primary key can contain a
unique and null value in the relational table.
Example:

3 | Page

You might also like