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
Objectives After reading this part, you should be able to: Modify, create, and delete database schema objects; Update database using SQL command; Retrieve data f

Analyzing Association Traversal Till now, we have supposed that associations are bi-directional. But in the case of traversal, it is in only one direction in any application,

What is meant by object-oriented data model? The object-oriented paradigm is based on encapsulation of data and code related to an object in to a one unit, whose contents are n

What is the difference between WHERE and HAVING clauses?. Predicates in the WHERE clause applies to every tuple while the predicate in the HAVING clause applies to groups.

Object-oriented decompositions Object-oriented decompositions of systems better are able to cope with change. Each subsystem has a well-defined interface which communicates with

what would go in order patient#, patient name, patien address, surgeon#, surgeon name, surgery date, surgery type, drug admin

Explain the difference between using functions along with and without grouping attributes in relational algebra. Give examples. Ans: Group functions are used to group data of

employee(empid,empname,dept,telno,mobno, add,sssno,tinno,WEdates,WEcomp,WEadd,WEpos,WEres) this is a employee record which is need to be normalize.the WE means work experience

Package classes and associations into models  Programs are made of separate physical units which could be edited, imported, complied or otherwise manipulated. The careful part