SlideShare a Scribd company logo
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Anomalies in Database
Name
@abhishekmenon121989@gmail
.com
www.facebook.com/
Abhishek H menon
twitter.com/Abhishek H
Menon
in.linkedin.com/in/Abhishek
H menon
Anomaly
Normalization is a technique for producing
relational schema with the following
properties.
• no information redundancy.
• no anomalies.
so we are clear when the process of reducing
the anomaly comes into action.
What is an Anomaly?
• Definition
– Problems that can occur in poorly planned, un-
normalized databases where all the data is stored
in one table (a flat-file database).
Types of Anomalies
• Insert
• Delete
• Update
Insert Anomaly
• An Insert Anomaly occurs when certain
attributes cannot be inserted into the
database without the presence of other
attributes.
Insert Anomaly
Course _no Tutor Room Room_size En_limit
353 Smith A532 45 40
351 Smith C320 100 60
355 Clark H940 400 300
456 Turner H940 400 45
e.g. we have built a new room (e.g. B123) but it has not yet been timetabled
for any courses or members of staff.
Delete Anomaly
• A Delete Anomaly exists when certain
attributes are lost because of the deletion of
other attributes.
Delete Anomaly
Course_no Tutor Room Room_size En_limit
353 Smith A532 45 40
351 Smith C320 100 60
355 Clark H940 400 300
456 Turner H940 400 45
e.g. if we remove the entity, course_no:351 from the above table, the details of
room C320 get deleted. Which implies the corresponding course will also get
deleted.
Update Anomaly
• An Update Anomaly exists when one or more
instances of duplicated data is updated, but
not all.
Update Anomaly
Course_no Tutor Room Room_size En_limit
353 Smith A532 45 40
351 Smith C320 100 60
355 Clark H940 400 300
456 Turner H940 400 45
e.g. Room H940 has been improved, it is now of RSize = 500. For updating
a single entity, we have to update all other columns where room=H940.
A conceptual model
• Consider the following ‘simple’ conceptual
data model:
Staff( Staff-id, Name,address, scale_point, Rate_of_pay, DOB..)
Student(Enroll-no, Name, Address, Olevelpoints..)
Course(Course-code, Name, Duration..)
Course StudentStaff
M M1N
The ‘Translation’ process
• Entities become relations.
• Attributes become attributes.
• Entity identifier (s) become primary key(s)
• Relationships are represented by additional
foreign keys attributes in those relation that
are at the ‘M’ end of the 1:M relationship.
The ‘Staff’ and ‘Student’ relations
• Staff(Staff-id, Name , Address, Rate-of-pay, DOB)
• Student(Enrol-no, Name, Address, Olevelpoints, Tutor);
NB: Foreign Key Tutor references Staff.Staff_id
Staff_id Name Address Scale point Rate_of_pay DOB
Enrol-no Name Address Olevelpoints Tutor
The ‘Staff’ & ‘Course’ relations
• Staff
• Course
NB: according to the conceptual model specified, both the above entities
have M:M relationships at the end.
We must create an artificial link in between these two entities.
Staff_id Name Address Scalepoint Rate_of_pay DOB
Course-code Name Duration
The ‘Staff’, ‘Course’ and ‘Team’ relations
• Staff
• Team
• Course
Staff_id Name Address Scalepoint Rate_of_pay DOB
Course_code Staff_id
Course_code Name Duration
The ‘Staff’, ‘Course’ and ‘Team’ relations
• In our new relation ‘Team’:
– Primary key is the combination of Course_code
and Staff_id.
– Foreign key Course_code references
Course.Course_code.
– Foreign key Staff_id references Staff.Staff_id.
For 3 entities 4 relations
• Student
• Staff
• Team
• Course
But these tables are not free from the above anomalies!
Enrol_no Name Address Olevelpoints Tutor
Staff_id Name Address Scalepoint RateofPay DOB
Course_code Staff_id
Course_code Name Duration
Checking for anomalies
• every tuple unique?
• no hidden meaning from location?
• data cells atomic?
• For relations with single_attribute keys:
– every attribute depends upon the primary key
• For relations with composite keys:
– Every attribute depends upon the whole key(the
components of this key are prime attributes?)
Relation fails
• Especially when we check dependency between
various attributes in a relationship.
• So we must split that relation into two relations.
• And we should create a foreign key in the new table
which references the primary key in the old table.
Problem arises
• The attribute ‘Rate_of_pay’ does not depends on the ‘Staff_id’ but on
‘Scalepoint’ in the relation Staff.
• So the next step will be splitting the relation Staff into relation Staff and
relation Pay.
Staff
Pay
Where in new relation Pay;
Combination of Scalepoint and rate_of_pay is taken as primary key.
Foreign key Scalepoint references Staff.Scalepoint.
Staff_id Name Address Scalepoint DOB
Scalepoint Rate_of_Pay
For 3 entities 5 relations
• Student
• Staff
• Team
• Course
• Pay
Enrol_no Name Address Olevelpoints Tutor
Staff_id Name Address Scalepoint DOB
Course_code Staff_id
Course_code Name Duration
Scalepoint Rate_of_pay
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us

More Related Content

What's hot

1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
BHARATH KUMAR
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
Anusha sivakumar
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
Crash recovery in database
Crash recovery in databaseCrash recovery in database
Crash recovery in database
Prof.Nilesh Magar
 
joins in database
 joins in database joins in database
joins in database
Sultan Arshad
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
Krish_ver2
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisationMuzamil Hussain
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
Adam Mukharil Bachtiar
 
Data Models
Data ModelsData Models
Data Models
RituBhargava7
 
Database recovery
Database recoveryDatabase recovery
Database recovery
Vritti Malhotra
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Hitesh Mohapatra
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
Sharad Dubey
 
Arrays
ArraysArrays
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
Vignesh Saravanan
 
Linked list
Linked listLinked list
Linked list
akshat360
 

What's hot (20)

1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Crash recovery in database
Crash recovery in databaseCrash recovery in database
Crash recovery in database
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
joins in database
 joins in database joins in database
joins in database
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisation
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Data Models
Data ModelsData Models
Data Models
 
Database recovery
Database recoveryDatabase recovery
Database recovery
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Arrays
ArraysArrays
Arrays
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
b+ tree
b+ treeb+ tree
b+ tree
 
Linked list
Linked listLinked list
Linked list
 

Similar to Anomalies in database

Module 4_PART1.pptx
Module 4_PART1.pptxModule 4_PART1.pptx
Module 4_PART1.pptx
Haso12
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
ERD.pptERD.ppt
Database normalization
Database normalizationDatabase normalization
Database normalization
Edward Blurock
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
Dr. GOPINATH D
 
Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Edwin Ayernor
 
Database part3-
Database part3-Database part3-
Database part3-
Taymoor Nazmy
 
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATIONUNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
Bhakti Pawar
 
lect2-model.ppt
lect2-model.pptlect2-model.ppt
lect2-model.ppt
vinayakjadhav94
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
IRWANBINISMAILKPMGur1
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
Rupali Rana
 
Advanced Cherwell Administration Tips
Advanced Cherwell Administration TipsAdvanced Cherwell Administration Tips
Advanced Cherwell Administration Tips
Cherwell Software
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Normalization
NormalizationNormalization
Normalization
Ahmed Farag
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
Deependra35
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
harshalkwagh999
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
 
Lecture7.pptx
Lecture7.pptxLecture7.pptx
Lecture7.pptx
HarpreetHeer1
 

Similar to Anomalies in database (20)

Module 4_PART1.pptx
Module 4_PART1.pptxModule 4_PART1.pptx
Module 4_PART1.pptx
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
Entity relationship modelling - DE L300
Entity relationship modelling - DE L300Entity relationship modelling - DE L300
Entity relationship modelling - DE L300
 
Database part3-
Database part3-Database part3-
Database part3-
 
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATIONUNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
 
lect2-model.ppt
lect2-model.pptlect2-model.ppt
lect2-model.ppt
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Advanced Cherwell Administration Tips
Advanced Cherwell Administration TipsAdvanced Cherwell Administration Tips
Advanced Cherwell Administration Tips
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Erd
ErdErd
Erd
 
Normalization
NormalizationNormalization
Normalization
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
 
Lecture7.pptx
Lecture7.pptxLecture7.pptx
Lecture7.pptx
 

More from baabtra.com - No. 1 supplier of quality freshers

Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
baabtra.com - No. 1 supplier of quality freshers
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
baabtra.com - No. 1 supplier of quality freshers
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
baabtra.com - No. 1 supplier of quality freshers
 
Php database connectivity
Php database connectivityPhp database connectivity
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Blue brain
Blue brainBlue brain
5g
5g5g
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra

More from baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 

Anomalies in database

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. Anomalies in Database Name @abhishekmenon121989@gmail .com www.facebook.com/ Abhishek H menon twitter.com/Abhishek H Menon in.linkedin.com/in/Abhishek H menon
  • 4. Anomaly Normalization is a technique for producing relational schema with the following properties. • no information redundancy. • no anomalies. so we are clear when the process of reducing the anomaly comes into action.
  • 5. What is an Anomaly? • Definition – Problems that can occur in poorly planned, un- normalized databases where all the data is stored in one table (a flat-file database).
  • 6. Types of Anomalies • Insert • Delete • Update
  • 7. Insert Anomaly • An Insert Anomaly occurs when certain attributes cannot be inserted into the database without the presence of other attributes.
  • 8. Insert Anomaly Course _no Tutor Room Room_size En_limit 353 Smith A532 45 40 351 Smith C320 100 60 355 Clark H940 400 300 456 Turner H940 400 45 e.g. we have built a new room (e.g. B123) but it has not yet been timetabled for any courses or members of staff.
  • 9. Delete Anomaly • A Delete Anomaly exists when certain attributes are lost because of the deletion of other attributes.
  • 10. Delete Anomaly Course_no Tutor Room Room_size En_limit 353 Smith A532 45 40 351 Smith C320 100 60 355 Clark H940 400 300 456 Turner H940 400 45 e.g. if we remove the entity, course_no:351 from the above table, the details of room C320 get deleted. Which implies the corresponding course will also get deleted.
  • 11. Update Anomaly • An Update Anomaly exists when one or more instances of duplicated data is updated, but not all.
  • 12. Update Anomaly Course_no Tutor Room Room_size En_limit 353 Smith A532 45 40 351 Smith C320 100 60 355 Clark H940 400 300 456 Turner H940 400 45 e.g. Room H940 has been improved, it is now of RSize = 500. For updating a single entity, we have to update all other columns where room=H940.
  • 13. A conceptual model • Consider the following ‘simple’ conceptual data model: Staff( Staff-id, Name,address, scale_point, Rate_of_pay, DOB..) Student(Enroll-no, Name, Address, Olevelpoints..) Course(Course-code, Name, Duration..) Course StudentStaff M M1N
  • 14. The ‘Translation’ process • Entities become relations. • Attributes become attributes. • Entity identifier (s) become primary key(s) • Relationships are represented by additional foreign keys attributes in those relation that are at the ‘M’ end of the 1:M relationship.
  • 15. The ‘Staff’ and ‘Student’ relations • Staff(Staff-id, Name , Address, Rate-of-pay, DOB) • Student(Enrol-no, Name, Address, Olevelpoints, Tutor); NB: Foreign Key Tutor references Staff.Staff_id Staff_id Name Address Scale point Rate_of_pay DOB Enrol-no Name Address Olevelpoints Tutor
  • 16. The ‘Staff’ & ‘Course’ relations • Staff • Course NB: according to the conceptual model specified, both the above entities have M:M relationships at the end. We must create an artificial link in between these two entities. Staff_id Name Address Scalepoint Rate_of_pay DOB Course-code Name Duration
  • 17. The ‘Staff’, ‘Course’ and ‘Team’ relations • Staff • Team • Course Staff_id Name Address Scalepoint Rate_of_pay DOB Course_code Staff_id Course_code Name Duration
  • 18. The ‘Staff’, ‘Course’ and ‘Team’ relations • In our new relation ‘Team’: – Primary key is the combination of Course_code and Staff_id. – Foreign key Course_code references Course.Course_code. – Foreign key Staff_id references Staff.Staff_id.
  • 19. For 3 entities 4 relations • Student • Staff • Team • Course But these tables are not free from the above anomalies! Enrol_no Name Address Olevelpoints Tutor Staff_id Name Address Scalepoint RateofPay DOB Course_code Staff_id Course_code Name Duration
  • 20. Checking for anomalies • every tuple unique? • no hidden meaning from location? • data cells atomic? • For relations with single_attribute keys: – every attribute depends upon the primary key • For relations with composite keys: – Every attribute depends upon the whole key(the components of this key are prime attributes?)
  • 21. Relation fails • Especially when we check dependency between various attributes in a relationship. • So we must split that relation into two relations. • And we should create a foreign key in the new table which references the primary key in the old table.
  • 22. Problem arises • The attribute ‘Rate_of_pay’ does not depends on the ‘Staff_id’ but on ‘Scalepoint’ in the relation Staff. • So the next step will be splitting the relation Staff into relation Staff and relation Pay. Staff Pay Where in new relation Pay; Combination of Scalepoint and rate_of_pay is taken as primary key. Foreign key Scalepoint references Staff.Scalepoint. Staff_id Name Address Scalepoint DOB Scalepoint Rate_of_Pay
  • 23. For 3 entities 5 relations • Student • Staff • Team • Course • Pay Enrol_no Name Address Olevelpoints Tutor Staff_id Name Address Scalepoint DOB Course_code Staff_id Course_code Name Duration Scalepoint Rate_of_pay
  • 24. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com