Constraints violation during insertion, Database Management System

Assignment Help:

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


Related Discussions:- Constraints violation during insertion

What is database trigger, What is database Trigger? A database trigger ...

What is database Trigger? A database trigger is a PL/SQL block that can explained to automatically execute for insert, update, and delete statements against a table. The trigge

What is a candidate key, What is a candidate key? Minimal super keys ar...

What is a candidate key? Minimal super keys are known as candidate keys.

Write modified version of transfer that avoids deadlock, Your OS has a set ...

Your OS has a set of queues, each of which is protected by a lock. To enqueue or dequeue an item, a thread must hold the lock associated to the queue. You need to implement an a

Queries, Write a query that display ename annual salary and comm from emp t...

Write a query that display ename annual salary and comm from emp table

What are the various forms of data transparency, What are the various forms...

What are the various forms of data transparency? a) fragmentation transparency b) replication transparency c) location transparency

Design a gennalization and specialization hierarchy for an a, Design a genn...

Design a gennalization and specialization hierarchy for an automobile sales company

Views-data control, Views A view is like a window by which data from ta...

Views A view is like a window by which data from tables can be changed or viewed. The table on which a view is based is known as Base table. The view is stored as a SELECT stat

Data control, Data Control The data control mostly refers to commands that...

Data Control The data control mostly refers to commands that permit system and data privileges to be passed to several users. These commands are usually available to database admi

What is derived and stored attribute, What is Derived and stored Attribute?...

What is Derived and stored Attribute? Derived and Stored Attribute - In a few cases, two or more attribute values are associated, for example, Age and BirthDate attributes of a

What is the difference between link and reference, What is the difference b...

What is the difference between link and reference? The fundamental difference between links and references is that links are symmetrical on the other hand references refer only

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd