Dealing with constraints violation, Database Management System

If the deletion violates referential integrity constraint, then three alternatives are available:

  • Default option: - refuse the deletion. It is the job of the DBMS to describe to the user why the deletion was rejected.
  • Attempt to propagate (or cascade) the deletion by deleting tuples that reference the tuple that is being deleted.
  • Vary the value of referencing attribute that origins the violation.

Example:

Let R:

A#

B

C^

A1

B1

C1

A2

B3

C3

A3

B4

C3

A4

B1

C5

Q

C#

D

C1

D1

C3

D2

C5

D3

 

 

 

Note:

1) '#' shows the Primary key of a relation.

2) '^' shows the Foreign key of a relation.

(1) Delete a tuple with C# = 'C1' in Q.

Violated constraint: - Referential Integrity constraint

Motive: - Tuples in relation A refer to tuple in Q.

Dealing: - Options available are

1)  Decline the deletion.

2)  DBMS may automatically delete all tuples from relation S and Q with C

# = 'C1'. This is known as cascade detection.

3)  The one more option would result in putting NULL value in R where C1 exist, which is the initial tuple R in the attribute C.

Posted Date: 3/6/2013 5:39:55 AM | Location : United States







Related Discussions:- Dealing with constraints violation, Assignment Help, Ask Question on Dealing with constraints violation, Get Answer, Expert's Help, Dealing with constraints violation Discussions

Write discussion on Dealing with constraints violation
Your posts are moderated
Related Questions
Describe the nested-loop join and block-nested loop join.   Ans:   The block nested- loop join algorithm is as described below:     for every block B r of relation R do beg

Develop Database academic assignment Project Description: For a provided set of instructions in a case study design Entity Relationship Diagram. - Entity Relationship Diag

Describe how you can simplify Operations. To simplify operation, one should use inheritance, where possible to use, to reduce the quantity of distinct operations. Introduce new

What is Secondary Index While making the index, generally the index table is kept in the primary memory (RAM) and the main table, because of its size is keeps in the secondary

The physical location of a record is determined by which mathematical formula that transforms a file key into a record location? The physical location of a record is determined

What is key ? Key - A single attribute or a combination of two or more attributes of an entity set which is used to recognize one or more instances (rows) of the set (table) is

Control as State within Program 1.  The term control exactly means to check effect of input within a program. For illustration, in Figure, after the ATM card is inserted (a

In object oriented design, which steps must designer take to adjust inheritance? To readjust inheritance following steps should be taken: i)  Rearrange and adjust the classe

Question: Consider the following database relations for a textbook ordering system used by a college bookshop: Book (b-copy#, bname, ISBN#, author, price, subject) Order (s#

Having Clause with sub queries: First we have to recollect the GROUP BYclause. The following query searches the minimum salary in every department. SELECT DEPTNO, MIN (SAL)