0% found this document useful (0 votes)
0 views

Lecture 3.1.1 Anomalies

The document discusses issues related to redundant information in relational database schemas, particularly focusing on update, insert, and delete anomalies. It provides examples of each anomaly using the EMP_PROJ relation and outlines guidelines for designing schemas that minimize these issues, including reducing NULL values and ensuring lossless joins. Reference materials and additional resources for further learning are also provided.

Uploaded by

siyalohiya67
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Lecture 3.1.1 Anomalies

The document discusses issues related to redundant information in relational database schemas, particularly focusing on update, insert, and delete anomalies. It provides examples of each anomaly using the EMP_PROJ relation and outlines guidelines for designing schemas that minimize these issues, including reducing NULL values and ensuring lossless joins. Reference materials and additional resources for further learning are also provided.

Uploaded by

siyalohiya67
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

UNIVERSITY INSTITUTE OF COMPUTING

UNIT-3
Bachelor of Computer Applications
Database Management System
(23CAT-251/23SCT-251)

DATABASE MANAGEMENT SYSTEM DISCOVER . LEARN . EMPOWER


A simplified COMPANY relational
database schema
Redundant Information in Tuples and Update
Anomalies
• Information is stored redundantly
• Wastes storage
• Causes problems with update anomalies
• Insertion anomalies
• Deletion anomalies
• Modification anomalies

Slide 10- 3
EXAMPLE OF AN UPDATE ANOMALY

• Consider the relation:


• EMP_PROJ(Emp#, Proj#, Ename, Pname, No_hours)
• Update Anomaly:
• Changing the name of project number P1 from “Billing” to “Customer-
Accounting” may cause this update to be made for all 100 employees working
on project P1.

Slide 10- 4
EXAMPLE OF AN INSERT ANOMALY

• Consider the relation:


• EMP_PROJ(Emp#, Proj#, Ename, Pname, No_hours)
• Insert Anomaly:
• Cannot insert a project unless an employee is assigned to it.
• Conversely
• Cannot insert an employee unless an he/she is assigned to a project.

Slide 10- 5
EXAMPLE OF AN DELETE ANOMALY

• Consider the relation:


• EMP_PROJ(Emp#, Proj#, Ename, Pname, No_hours)
• Delete Anomaly:
• When a project is deleted, it will result in deleting all the employees who work
on that project.
• Alternately, if an employee is the sole employee on a project, deleting that
employee would result in deleting the corresponding project.

Slide 10- 6
Two relation schemas suffering from update
anomalies

Slide 10- 7
Example States for EMP_DEPT and
EMP_PROJ

Slide 10- 8
Guideline to Redundant Information in Tuples
and Update Anomalies
• GUIDELINE 2:
• Design a schema that does not suffer from the insertion, deletion and update
anomalies.
• If there are any anomalies present, then note them so that applications can be
made to take them into account.

Slide 10- 9
Null Values in Tuples

• GUIDELINE 3:
• Relations should be designed such that their tuples will have as few NULL
values as possible
• Attributes that are NULL frequently could be placed in separate relations
(with the primary key)
• Reasons for nulls:
• Attribute not applicable or invalid
• Attribute value unknown (may exist)
• Value known to exist, but unavailable

Slide 10- 10
Spurious Tuples

• Bad designs for a relational database may result in erroneous results


for certain JOIN operations
• The "lossless join" property is used to guarantee meaningful results for
join operations

• GUIDELINE 4:
• The relations should be designed to satisfy the lossless join condition.
• No spurious tuples should be generated by doing a natural-join of any
relations.

Slide 10- 11
Spurious Tuples (2)

• There are two important properties of decompositions:


a) Non-additive or losslessness of the corresponding join
b) Preservation of the functional dependencies.

• Note that:
• Property (a) is extremely important and cannot be sacrificed.
• Property (b) is less stringent and may be sacrificed. (See Chapter 11).

Slide 10- 12
REFERENCE BOOKS

References
• Ø Fundamentals of Database Systems by R. Elmasri and S.B. Navathe, 3rd Edition, Pearson Education,
New Delhi.
• Ø An Introduction to Database Systems by C.J. Date, 7th Edition, Pearson Education, New Delhi.

Suggestive Reading
• https://www.geeksforgeeks.org/dbms/https://www.w3schools.in/dbms/

Video Links
• Ø YouTube Link- Video Lectures
• Ø https://www.youtube.com/watch?v=T7AxM7Vqvaw&list=PLdo5W4Nhv31b33kF46f9aFjoJPOkdlsRc
THANK YOU

You might also like