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
Critically evaluate the bulleted list of information-related items in this case study. How are each contradictory to the notion of being an information-literate knowledge worker?

Differance between internal and external schema? Internal and external schema: Internal Schema • Describes the physical storage structure • Uses a physical data model External

You are required to implement integrity constraints within the database to enforce the following requirements:  For Projects: Start date must be supplied. Start date cannot be i

Describe Participation Constraints? Participation Constraints - The participation constraint exacts whether the existence of an entity depends on its being related to another

Explain outer join? Outer Join - If there are any values in one table which do not have corresponding value(s) in the other, in an equi-join which will not be chosen. Such ro

read-set(T) : Each data items that are read by a transaction T Timestamps : for all transaction T, the start-time and the end time are reserved for all the three phases.

Describe the various types of Online Analytical Processing (OLAP) tools and briefly discuss how the support common analytical operations.

examples of fields in a database

Explain Dynamic Two-Phase Locking Here a transaction locks a data item instantly earlier than any operation is applied on the data item.  After finishing all the operations on

In this practical assignment, we will run through a complete database application development cycle, starting with the schema design, from an initial data import to database applic