explain entity integrity and referential


Explain entity integrity and referential integrity rules within relational model. Show how these are realized in SQL?

Entity Integrity Rule - No primary key value could be null.

Referential Integrity Rule - In referential integrity, it is ensured in which a value which appears in one relation for a given set of attributes also appears for a certain set of attributes within another relation.

In SQL, entity integrity and referential integrity rules are implemented as constraints on the relation known as primary key constraint or reference key constraint corresponding. These constraints can be specified along with relation at the time of creation of the relations or after the creation of the relations through altering the definition of the relations. For instance:

CREATE TABLE DEPT

(DEPTNO NUMBER PRIMARY KEY,

DNAME VARCHAR2(15));

CREATE TABLE EMP

(EMPNO NUMBER PRIMARY KEY,

 20

 ENAME VARCHAR2(15),

JOB VARCHAR2(10),

DEPTNO NUMBER REFERENCES DEPT(DEPTNO));

Request for Solution File

Ask an Expert for Answer!!
Database Management System: explain entity integrity and referential
Reference No:- TGS0277221

Expected delivery within 24 Hours