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
Consider the following relations: BRANCH( bno, street, area, city, pcode, Tel_no, Fax_no) STAFF( Sno, Fname, Lname, address, position , salary, bno) Express the subsequent qu

What is the used of specifying alias? Specifying alias: is used to rename column or attribute in a table.

Describe the storage structure of indexed sequential files and their access method.  Ans:   Storage structure of Indexed Sequential files and their access: To achieve fast rand

Explain the relevance of Data Dictionary in a Database System? Data dictionary is a database in its own right residing on the disk that consist of Meta data which is = Data abo

Attributes having a one value for a particular entity. For instance, Age is a single valued attribute of a student entity. Attributes  that  have  more  than  single  values

To delete a particular column in a relation which command is used ? To delete a particular column in a relation ALTER command is used.

Define the step - Rearranging the Execution Order for Efficiency As we know that algorithm and data structure are closely related to one another, but data structure is conside

What is the difference between internal tables and extract datasets? The lines of an internal table always have the similar structure. By using extract datasets, you can ha

There are two major types of fragmentation: Horizontal& Vertical. Horizontal fragments, as the name suggests are subsets of tuples and vertical fragments are subsets of attributes

What is entity in DBMS? Entity: A DBMS entity is either a thing in the modelled world or a drawing element in an ERD.