howtouse.php

The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we solve previous year question papers for you.
See Our team
Wondering how we keep quality?
Got unsolved questions?

Ask Questions
Database-Management-Systems---10CS54-VTU-notes-->View question


Explain insert, delete and update statements in SQL with example. Database Management Systems - 10CS54 VTU notes 8 Marks (Dec/Jan 2013 & June/July 2015)

Explain in brief.?

By:anonymousguy7799

Taged users:


Likes:
Be first to like this question

Dislikes:
Be first to dislike this question

Talk about thisDelete|Like|Dislike|


Answers

The Insert Operation This operation can violate all constraints in a relational database.Domain constraints can be violated if an attribute value is given that does not appear in the corresponding domain. 
Key constraints can be violated if a key value in the new tuple already exits in another tuple in the relation R. Entity constraints can be violated if the primary key of the new tuple is null. 
Referential integrity can be violated if the value of any foreign key in t refers to a tuple that does not exist in the referenced relation. Examples of this operation: 
• Insert <`Ahmad',`Jabbar', null, `60/04/05',F,28000,null,4> into EMPLOYEE.
 This insertion violates the entity integrity constraints (SSN=null). Insert <`Alicia',`Zelaya',`999887777',`60/04/05',F ,28000,`987654321',4> into EMPLOYEE. 
This insertion violates the key constraint (SSN=999887777 is already exists). • Insert <`Ahmad',`Jabbar',`677678989',`60/04/05',M, 28000,`987654321',7> into EMPLOYEE. This insertion violates referential integrity (DNO=7, there is no DEPNUMBER=7 in DEPARTMENT relation). • Insert <`Ahmad',`Jabbar',`987987987',`69/03/29',M,2800,null,4> into EMPLOYEE. This insertion is acceptable.

The Delete Operation This operation can violate only referential integrity. Examples of delete operation:
 • Delete the WORKS_ON tuple with SSN=`123456789' and PNO=1. This deletion is acceptable.
 • Delete the EMPLOYEE tuple with SSN=`999887777'. This deletion violates the referential integrity (tuples in WORKS_ON refer to this tuple).
• Delete the EMPLOYEE tuple with SSN=`333445555'. This deletion violates referential integrity (tuples in EMPLOYEE, DEPARTMENT, WORKS_ON, and DEPENDENT refer to this tuple)
The Update Operation The new value must be of the correct data type and domain. Examples of update operation:
 •Update the SALARY of the EMPLOYEE tuple with SSN=`999887777' to 28000. This update is acceptable. 
•Update the DNO of the EMPLOYEE tuple with SSN=`999887777' to 7. This update violates referential integrity (there is no DNUMBER=7 in DEPARTMENT relation). 
• Update the SSN of the EMPLOYEE tuple with SSN=`999887777' to `987654321'.. 

Nikhil-bharadwaj

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer
Talk about this|Once you have earned teacher badge you can edit this questionDelete|Like|Dislike|
------------------------------------

Can you help us to add better answer here? Please see this



Not the answer you're looking for? Browse other questions from this Question paper or ask your own question.

Join eduladder!