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
What are composite attributes? Composite attributes can be separated in to sub parts.

Question 1 Explain ER model Question 2 What are the characteristics of a computer provided information? Question 3 What are facts and guidelines to be considered when se

Draw an ER diagram that shows the organization of a simple student database. The database captures the information about letter grades obtained by university students who enrolled

You group has been hired by  TrainingrUs.com to keeps track of training revenues. TrainingrUS.com wants you to keep scheduling. COURSE table contains following information:

Give an example of enforcement in Typing. You can understand the idea of enforcement as it makes sure objects of dissimilar classes may not be interchanged as below:  Exampl

Show a centralised schema to support the operation of the system you have chosen, including in particular: the product catalogue; the outlets and respective stocks; customer record

Attribute Preservation This is a easy and obvious necessity that includes preserving all the attributes that were there in the relation that is being decomposed.

Given the following set of functional dependencies {cf?bg, g?d, cdg?f, b?de, d?c} defined on R(b,c,d,e,f,g) a.Find a non-redundant cover. b.Find a canonical cover.

Describe the various types of Online Analytical Processing (OLAP) tools and briefly discuss how the support common analytical operations.

Primary Key The primary key is the candidate key that is selected by the database designer as the principal denotes of identifying entities within an entity set. The left candi