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
Find the names of all Albums that have more than 30 tracks. Result: (name: varchar(255))

Let us now make the E-R diagram for the student database as per the explanation given in the previous section. We can also states the overall logical structure of a database usi

what characterizes the levels in RAID technology

want a idea for final year project

how to implement mid square hashing?

This project requires you to perform a systems analysis and then design a system solution using database software. Ace Auto Dealers specializes in selling new vehicles from Subaru.

Consider the relations described below: PHYSICIAN (regno, name, telno, city) PATIENT (pname, street, city) VISIT (pname, regno, date_of_visit, fee) Where the regno and pname ide

What are the features of embedded SQL? Explain. Embedded SQL - SQL could be implemented within two ways. It can be used interactively or embedded in a host language or throu

Modular growth: In distributed environments, it is simple to expand. Latest sites can be added to the network without affecting the operations of other sites, as they are somewhat

Task Partitioning, Sequencing and Project Planning The tasks required for the service might be broadly partitioned into: 0.      Set up database tables and account file