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
compare the features of oracle RDBMS with MySQL and Microsoft SQL server

Question 1 Explain the concept of Foreign Key. How a foreign key differs from a Primary Key? Can the Foreign Key accept nulls? Question 2 With a necessary example explain (i)

1 - Serial RS232 comm port comunication 2 - NanoHTTPD serving a few processed pages 3 - System tray application to indicate status and access configuration forms 4 - SQLit

write short note on mobile database

Rearrange Classes and Operations Sometimes, the similar operation is defined across different classes and can easily be inherited from a familiar ancestor, but more often oper

Describe Interfaces for the DBA? Interfaces for the DBA - Most database systems holds privileged commands which could be used only through the DBA's staff. These involves com

What is the use of a slotted-page structure and what is the information are there in the header? The slotted-page structure is used for organizing records within a one block.


Data Definition Language It organises the data in the form of columns and rows. But what does the data field column of table accumulate? How do you describe it using SQL? Th

Change the city of First Bank Corporation to ‘New Delhi' UPDATE COMPANY SET CITY = ‘New Delhi' WHERE COMPANY_NAME = ‘First Bank Corporation';