Explain entity integrity and referential integrity rules, Database Management System

Assignment Help:

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));


Related Discussions:- Explain entity integrity and referential integrity rules

Data integrity, You are required to implement integrity constraints within ...

You are required to implement integrity constraints within the database to enforce the following requirements:  For Projects: Start date must be supplied. Start date cannot be i

Er diatgrams, Ask q“A database will be made to store information about pati...

Ask q“A database will be made to store information about patients in a hospital. On arrival, each patient’s personal details (name, address, and telephone number) are recorded wher

Create database and define relationships between tables, Instructions: ...

Instructions: Follow the instructions below for completing this project: 1. Creating the Database: · Use the physical table descriptions given below to define and create each t

OLAP CUBES, 1) Define a job scheduling strategy that will meet business req...

1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Database design and documentation, A use case diagram giving a pictorial ov...

A use case diagram giving a pictorial overview of user requirements and brief use case descriptions. As the case study contains only an outline of a business scenario, you will als

HYRISE, how to implement hyrise in C plus plus

how to implement hyrise in C plus plus

Erds, What are the various symbols used to draw an E-R diagram (any 3)?

What are the various symbols used to draw an E-R diagram (any 3)?

Define an operator that a relational algebra does not have, Define an opera...

Define an operator that a Relational Algebra does not have Ans: Relational Algebra does not have Aggregation operators.

In e-r diagram how generalization is represented, In E-R diagram how genera...

In E-R diagram how generalization is represented? in E-R diagram generalization is represented by Triangle shape.

What are the benefits of prepared statements, What are the benefits of prep...

What are the benefits of prepared statements and place holders? Parameter binding operations automatically handle escaping of characters Encourage Statement reuse

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd