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
Illustrate the class diagram for class room scheduling system If in any college, the number of classrooms are limited which have to be allocated to various classes and instruct

Is it mandatory to declare all the tables in Report by the key word tables for all the tables that exist in the structure of LDB, and are being explained in the Database part of LD

Describe Parameteric end users? Parametric end users might be given update access, but are commonly not permitted to change the structure of data.

Example RELATION SCHEMA for STUDENT: STUDENT (Roll No: string, name: string, login: string, age: integer) RELATION INSTANCE

First Normal Form and second normal form First Normal Form (1NF) A relation is said to be in 1NF if it having no non-atomic values and each row can give a unique combinat

#question. Draw a picture of a moving source and the waves surrounding it according to what you observed in this experiment. How does the spacing of the wave-fronts in front of the

Example- Search the salary of employees who are not 'ANALYST' but get a salary below than or equal to any people employed as 'ANALYST'. SELECT EMPNO, ENAME, JOB, SAL FROMEMP

How to define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a

Information about films holds information about movies, stars and studios. Movies have a title, year of production, length and the film type. Stars have a name and address. Studi

Explain the ACID properties of a transaction Ans: ACID properties are a significant concept for databases. The ACID stands for Atomicity, Consistency, Isolation, and Durability