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
Implementing software control To implement software control designer must redesign strategy of state event model which is present in dynamic model. There are three basic ap

What is a database? Database - Basically in simple terms A database is a collection of inter related data and/or information stored so which it is available to several users

What is known as a search key? An attribute or set of attributes used to look up records in a file is known as a search key.

Have a look around the site, and at some of the sites they have featured. These are all examples of bad design, and also offer an explanation about why they fall into this category

Serialisability: Any schedule that makes the similar results as a serial schedule is known as a serialisable schedule. But how can a schedule are determined to be serialisable or n

Determine the Three Views of Data We know that the similar thing, if viewed from dissimilar angles produces difference sights. Similarly, the database that we have formed alrea

Explain ODBC? ODBC - Open DataBase Connectivity (ODBC) enable the integration of SQL along with a general-reasons programming language.

Removing a Synonym: DROP SYNONYM D30;

Super keys of a relation can have extra attributes. Candidate keys are minimal super key, i.e. such a key have no extraneous attribute. An attribute is known as extraneous if even

CREATE YOUR DATABASE TABLES Your database project must have a minimum of four tables. Include the SQL scripts used to create the tables in your documentation. Explain the tables