SlideShare une entreprise Scribd logo
1  sur  18
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 DATABASES


            vishnu.padinjattedath@gmail.com
                             @Vishnu_Kishor
Database Anomalies
• Databases are designed to collect data and
  sort or present it in specific ways to the end
  user
• Database anomalies-unmatched or missing
  information caused by limitations or flaws
  within a given database
• Entering or deleting information cause issues
  if the database is limited or has ‘bugs’.
Modification/Update Anomalies
• They are the data inconsistencies that resulted
  from data redundancy or partial update.
• The Problems resulting from data redundancy in
  database table are known as update anomalies.
• If a modification is not carried out on all the
  relevant rows, the database will become
  inconsistent
• Any database insertion, deletion or modification
  that leaves the database in an inconsistent state
  is said to have caused an update anomaly.
Insertion Anomalies
• Issues that come about when you are inserting
  information into the database for the first time.
• To insert the information into the table
  – Must enter the correct details
  – Must be consistent with the values for the other rows.
  – Missing or incorrectly formatted entries are two of the
    more common insertion errors.
• Most developers acknowledge that this will
  happen and build in error codes that tell you
  exactly what went wrong.
Deletion Anomalies
• Issues with data being deleted either
   – when attempting to delete and being stopped by an
     error or
   – by the unseen drop off of data
• If we delete a row from the table that represents
  the last piece of data, the details about that piece
  are also lost from the Database.
• These are the least likely to be caught or to stop
  you from proceeding
• As many deletion errors go unnoticed for
  extended periods of time, they could be the most
  costly in terms of recovery
• Database anomalies are a fact
• we will all face them in one form or another in
  life.
• The importance of
  – backing up,
  – storing offsite and
  – data consistency checks
  come into full focus when you consider what
  could be lost.
Example
  To understand why we should be careful in
  designing databases, let's consider an example
  of a bad database design




• Here the cust ID and stock are the primary key.
• Insertion Anomalies
  – You may want to add information about a person with
    whom you want to do business.
  – The above table only allows information for customers that
    own a share of stock.
  – If the person does not own stock, then the last four
    columns in the table have to be empty
  – This is not allowed since stock is part of the primary
    identifier
• Deletion Anomalies
  – You may want to delete a record from the above table
    because a customer sold his stock.
  – Consider the second record.
  – If this record were deleted, then information would be lost
    about both Jones's address and the price of C stock.
• Update Anomalies
  – You may want to update a customer's address, the
    price of a stock, or its most recent dividend.
  – To accomplish this update, you would have to
    update several rows in the table.
  – If you miss one of the rows that should be
    updated, then at a later time you will get two
    different answers to a question you ask of the
    data.
  – This is not good. Generally, if there is only
    supposed to be one answer to a question, you
    want to get just that one answer.
How To Avoid Anomalies??
• The use of normalization
• The goal of the normalization process is to
  define relations
• So that each relation is about one kind of
  thing. Not two. Not three. One.
• This seems like a reasonable condition, given
  the problems that it prevents
How Normalization works??
• If you know a customer id, then you know the
  person's name and address.
• If you know a stock identifier, then you know
  its current price and most recent dividend.
• Finally, for any pairing of a customer id and a
  stock identifier, you know how many shares
  that person owns of that stock
QUESTIONS ARE GUARANTEED IN
LIFE BUT ANSWERS ARE NOT…!!
             .
             .


     ANY QUESTIONS????
THANK YOU
Did this presentation help you??? do visit our
  page facebook.com/baabtra, And don’t forget
  to like us.

             • www.baabtra.com
            • www.massbaab.com
              • www.baabte.com
Contact Us

Contenu connexe

Tendances (20)

Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Introduction to RDBMS
Introduction to RDBMSIntroduction to RDBMS
Introduction to RDBMS
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Dbms classification according to data models
Dbms classification according to data modelsDbms classification according to data models
Dbms classification according to data models
 
OLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSEOLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSE
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Object oriented database
Object oriented databaseObject oriented database
Object oriented database
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Database Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal GulatiDatabase Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal Gulati
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
 

Similaire à Database anomalies

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptxAshokRachapalli1
 
INTRODUCTION TO RDBMS
INTRODUCTION TO RDBMSINTRODUCTION TO RDBMS
INTRODUCTION TO RDBMSVidhya Balan
 
How Data Analysis can enhance your Business
How Data Analysis can enhance your BusinessHow Data Analysis can enhance your Business
How Data Analysis can enhance your BusinessNirav Trivedi
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Vijayananda Ratnam Ch
 
Data modeling tips from the trenches
Data modeling tips from the trenchesData modeling tips from the trenches
Data modeling tips from the trenchesTerry Bunio
 
10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot SolutionPardot
 
Doing Analytics Right - Building the Analytics Environment
Doing Analytics Right - Building the Analytics EnvironmentDoing Analytics Right - Building the Analytics Environment
Doing Analytics Right - Building the Analytics EnvironmentTasktop
 
Geek Sync | Why Did My Clever Index Change Backfire?
Geek Sync | Why Did My Clever Index Change Backfire?Geek Sync | Why Did My Clever Index Change Backfire?
Geek Sync | Why Did My Clever Index Change Backfire?IDERA Software
 
Sfsvsqlug june-2010
Sfsvsqlug june-2010Sfsvsqlug june-2010
Sfsvsqlug june-2010datamodeling
 
Microsoft SQL Server Seven Deadly Sins of Database Design
Microsoft SQL Server Seven Deadly Sins of Database DesignMicrosoft SQL Server Seven Deadly Sins of Database Design
Microsoft SQL Server Seven Deadly Sins of Database DesignMark Ginnebaugh
 
Declutter Your Database in 12 Steps.pdf
Declutter Your Database in 12 Steps.pdfDeclutter Your Database in 12 Steps.pdf
Declutter Your Database in 12 Steps.pdfJackiePotts5
 
Unit 3 part ii Data mining
Unit 3 part ii Data miningUnit 3 part ii Data mining
Unit 3 part ii Data miningDhilsath Fathima
 
Database and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business IntelligenceDatabase and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business IntelligenceYeng Ferraris Portes
 
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...Omid Vahdaty
 
Usability and Salesforce - Dallas Salesforce.com User Group September 2011
Usability and Salesforce - Dallas Salesforce.com User Group September 2011Usability and Salesforce - Dallas Salesforce.com User Group September 2011
Usability and Salesforce - Dallas Salesforce.com User Group September 2011Shell Black
 

Similaire à Database anomalies (20)

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
 
INTRODUCTION TO RDBMS
INTRODUCTION TO RDBMSINTRODUCTION TO RDBMS
INTRODUCTION TO RDBMS
 
How Data Analysis can enhance your Business
How Data Analysis can enhance your BusinessHow Data Analysis can enhance your Business
How Data Analysis can enhance your Business
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)
 
Data modeling tips from the trenches
Data modeling tips from the trenchesData modeling tips from the trenches
Data modeling tips from the trenches
 
Root cause analysis
Root cause analysisRoot cause analysis
Root cause analysis
 
10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution
 
Root cause analysis
Root cause analysis Root cause analysis
Root cause analysis
 
Doing Analytics Right - Building the Analytics Environment
Doing Analytics Right - Building the Analytics EnvironmentDoing Analytics Right - Building the Analytics Environment
Doing Analytics Right - Building the Analytics Environment
 
CaseStudy.pptx
CaseStudy.pptxCaseStudy.pptx
CaseStudy.pptx
 
Geek Sync | Why Did My Clever Index Change Backfire?
Geek Sync | Why Did My Clever Index Change Backfire?Geek Sync | Why Did My Clever Index Change Backfire?
Geek Sync | Why Did My Clever Index Change Backfire?
 
Sfsvsqlug june-2010
Sfsvsqlug june-2010Sfsvsqlug june-2010
Sfsvsqlug june-2010
 
Microsoft SQL Server Seven Deadly Sins of Database Design
Microsoft SQL Server Seven Deadly Sins of Database DesignMicrosoft SQL Server Seven Deadly Sins of Database Design
Microsoft SQL Server Seven Deadly Sins of Database Design
 
Declutter Your Database in 12 Steps.pdf
Declutter Your Database in 12 Steps.pdfDeclutter Your Database in 12 Steps.pdf
Declutter Your Database in 12 Steps.pdf
 
Unit 3 part ii Data mining
Unit 3 part ii Data miningUnit 3 part ii Data mining
Unit 3 part ii Data mining
 
Database and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business IntelligenceDatabase and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business Intelligence
 
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
 
Exception & Database
Exception & DatabaseException & Database
Exception & Database
 
Usability and Salesforce - Dallas Salesforce.com User Group September 2011
Usability and Salesforce - Dallas Salesforce.com User Group September 2011Usability and Salesforce - Dallas Salesforce.com User Group September 2011
Usability and Salesforce - Dallas Salesforce.com User Group September 2011
 
Database Testing
Database TestingDatabase Testing
Database Testing
 

Plus de baabtra.com - No. 1 supplier of quality freshers

Plus de 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
 

Database anomalies

  • 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 DATABASES vishnu.padinjattedath@gmail.com @Vishnu_Kishor
  • 4. Database Anomalies • Databases are designed to collect data and sort or present it in specific ways to the end user • Database anomalies-unmatched or missing information caused by limitations or flaws within a given database • Entering or deleting information cause issues if the database is limited or has ‘bugs’.
  • 5. Modification/Update Anomalies • They are the data inconsistencies that resulted from data redundancy or partial update. • The Problems resulting from data redundancy in database table are known as update anomalies. • If a modification is not carried out on all the relevant rows, the database will become inconsistent • Any database insertion, deletion or modification that leaves the database in an inconsistent state is said to have caused an update anomaly.
  • 6. Insertion Anomalies • Issues that come about when you are inserting information into the database for the first time. • To insert the information into the table – Must enter the correct details – Must be consistent with the values for the other rows. – Missing or incorrectly formatted entries are two of the more common insertion errors. • Most developers acknowledge that this will happen and build in error codes that tell you exactly what went wrong.
  • 7. Deletion Anomalies • Issues with data being deleted either – when attempting to delete and being stopped by an error or – by the unseen drop off of data • If we delete a row from the table that represents the last piece of data, the details about that piece are also lost from the Database. • These are the least likely to be caught or to stop you from proceeding • As many deletion errors go unnoticed for extended periods of time, they could be the most costly in terms of recovery
  • 8. • Database anomalies are a fact • we will all face them in one form or another in life. • The importance of – backing up, – storing offsite and – data consistency checks come into full focus when you consider what could be lost.
  • 9. Example To understand why we should be careful in designing databases, let's consider an example of a bad database design • Here the cust ID and stock are the primary key.
  • 10. • Insertion Anomalies – You may want to add information about a person with whom you want to do business. – The above table only allows information for customers that own a share of stock. – If the person does not own stock, then the last four columns in the table have to be empty – This is not allowed since stock is part of the primary identifier • Deletion Anomalies – You may want to delete a record from the above table because a customer sold his stock. – Consider the second record. – If this record were deleted, then information would be lost about both Jones's address and the price of C stock.
  • 11. • Update Anomalies – You may want to update a customer's address, the price of a stock, or its most recent dividend. – To accomplish this update, you would have to update several rows in the table. – If you miss one of the rows that should be updated, then at a later time you will get two different answers to a question you ask of the data. – This is not good. Generally, if there is only supposed to be one answer to a question, you want to get just that one answer.
  • 12. How To Avoid Anomalies?? • The use of normalization • The goal of the normalization process is to define relations • So that each relation is about one kind of thing. Not two. Not three. One. • This seems like a reasonable condition, given the problems that it prevents
  • 13.
  • 14. How Normalization works?? • If you know a customer id, then you know the person's name and address. • If you know a stock identifier, then you know its current price and most recent dividend. • Finally, for any pairing of a customer id and a stock identifier, you know how many shares that person owns of that stock
  • 15. QUESTIONS ARE GUARANTEED IN LIFE BUT ANSWERS ARE NOT…!! . . ANY QUESTIONS????
  • 17. Did this presentation help you??? do visit our page facebook.com/baabtra, And don’t forget to like us. • www.baabtra.com • www.massbaab.com • www.baabte.com