Constraints violation during insertion, Database Management System

If the insertion violates one or more constraints, then two alternatives are available:

  • Default option: - Insertion can be discarded and the reason of refusal can also be explained to the user by DBMS.
  • Ask the user to resubmit, correct the data, also give the cause for rejecting the insertion.

Example:

Consider the Relation PERSON of Example :

PERSON

 

1015_Constraints violation during insertion.png

(1)     Insert<1, 'Vipin', 20, 'Mayur Vihar'> into PERSON

Violated constraint: - Key constraint

Reason: - Primary key 1 already exists in PERSON.

Dealing: - DBMS could ask the user to give valid PERSON_ID value and accept the insertion if valid PERSON_ID value is given.

 

(2)     Insert<'null', 'Anurag', 25, 'Patparganj'> into PERSON

Violated constraint: - Entity Integrity constraint

Reason: - Primary key is 'null'.

Dealing: - DBMS could ask the user to give valid PERSON_ID value and accept the insertion if valid PERSON_ID value is given.

 

(3)     Insert<'abc', 'Suman', 25, 'IP college'> into PERSON

Violated constraint: - Domain constraint

Reason: - value of PERSON_ID is provide a string which is not valid.

 

(4)     Insert <10, 'Anu', 25, 'Patpatganj'> into PERSON

Violated constraint: - None

Posted Date: 3/6/2013 5:37:05 AM | Location : United States







Related Discussions:- Constraints violation during insertion, Assignment Help, Ask Question on Constraints violation during insertion, Get Answer, Expert's Help, Constraints violation during insertion Discussions

Write discussion on Constraints violation during insertion
Your posts are moderated
Related Questions
Security And Integrity After Reading the concepts of database recovery in the last section, let us now deal with a vital concept that helps in minimizing consistency errors in

DROP TABLE Command: When an existing object is not needed for further use, it is always better to eliminate it from the database. To remove the existing object from the databas

Lock Based Protocol A lock is nothing but a mechanism that tells the DBMS whether a particular data item is being used by any transaction for read/write purpose. As there are t

Locks: Serialisabilty is just a test whether a given interleaved schedule is ok or has a concurrency related trouble. Though, it does not make sure that the interleaved concurrent

Define outer union operation of the relational algebra. Compute the outer union for the relations R and S given below. Outer Join - If there are any values in one tabl

What do you mean by an execution plan? Why is it used? How will you view it? a.) An execution plan can be known as a road map which textually or graphically illustrates the dat

What is transaction? Collections of operations that form a single logical unit of work are known as transactions.

Order by clause By using this rows can be sorted It is used in the last portion of select statement By default it gets ascending order DESC: is used

Problem 1. Create a PL/SQL program to insert data into student table and display the details of the student having Reg.No 1010 Writing a PL/SQL program to Insert data

Storage Of Database On Hard Disks At this point, it is worthwhile to note the difference among the terms file Organisation and the access method. A file organisation shows to t