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
What is a hashing function?  What are the properties of a good hashing function?  Describe the folding technique for hashing functions.      Ans:  Hashing function is a method

Prepare a gantt chart for the stock control project: Scenario Lucas-TVS is the Leader in Auto Electricals in India today with 50 years experience in desig

Fundamentals of Database Management 1. Explain the concept of Foreign Key. How a foreign key differs from a Primary Key? Can the Foreign Key accept nulls? 2. With a necess

Question 1 Create a table student with attributes student name, roll number, total marks and percentage. Do the following operations Insert details in to the table Update

When It is better to use files than a DBMS? It is better to use files than a DBMS when Multiple users wish to access the data.

Create a table according to given data:  AmbulanceDriver(Driver_Number#, Name, Address, Birth_Date) AmbulanceDriverTeam(Team_Number#, Driver_Number#, Join_Date, Lea

What is an index? An index is a structure that helps to place desired records of a relation quickly, without probing all records.

What are the categories of SQL command? SQL commands are separated in to the following categories: 1. Data - Definitition Language 2. Data Manipulation language 3. Dat

What is SQL Server Agent? SQL Server agent plays a significant role in the day-to-day tasks of a database administrator (DBA). It is often overlooked as one of the major tools

1. Which model is used to store data in tree structures Ans: Hierarchical model is used to store data in tree structures