Redundancy and Inconsistence in Relational DB

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Db
Click For Summary

Discussion Overview

The discussion revolves around the concept of redundancy and inconsistency in relational databases, specifically focusing on a given relational table structure for rooms in buildings. Participants explore examples of how repeated entries can lead to inconsistencies and the implications of primary keys on data integrity.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks an example of redundancy leading to inconsistency in a relational table, specifically regarding room entries.
  • Another participant questions whether the number of floors is dependent on the primary key, suggesting ambiguity in the relationship between room and building attributes.
  • A participant discusses the potential for entering different primary key entries for identical records, leading to inconsistencies in the number of floors associated with different rooms.
  • One reply emphasizes that the number of floors should be an attribute of the building rather than the room, indicating a design redundancy issue rather than an inconsistency issue.
  • Concerns are raised about the implications of redundancy, such as the need to update multiple records if a building's floor count changes, which could lead to future inconsistencies.
  • A participant inquires about the practice of referencing multiple copies of the same record or field, highlighting the importance of optimal primary key structure to avoid redundancy.

Areas of Agreement / Disagreement

Participants express differing views on the nature of redundancy and inconsistency, with some focusing on the design implications while others emphasize the potential for data entry errors. There is no consensus on the best approach to handle these issues.

Contextual Notes

Participants note that the normalization process is important for reducing redundancy, but there are practical considerations regarding how to manage inconsistencies when redundancies are present. The discussion reflects varying assumptions about the relationships between attributes in the database schema.

Who May Find This Useful

This discussion may be useful for database designers, students learning about relational database concepts, and professionals interested in data integrity and normalization practices.

WWGD
Science Advisor
Homework Helper
Messages
7,806
Reaction score
13,125
Hi All,
I am given this relational table

ROOM (RoomID, BuildingName, FloorNumber, NumberOfFloors).
The underline and bold mean that RoomID is the primary key.

And I am asked to show an example of how redundancies may result in inconsistencies.

This is a questions someone asked, hoping for my help, but I am stuck.

So I am not even sure of what to do. I am looking for an example, a "model" where one or more
entries are repeated which leads to inconsistencies. I am assuming for now that just one repetition
will do, so I set up a table with a repeated entry (please see attached file). I chose rooms in buildings
with the same number of rooms and same floor number.
Any ideas?
 

Attachments

  • Like
Likes   Reactions: Silicon Waffle
Computer science news on Phys.org
What do you think of numberoffloors ? Does it depend on the primary key ?
 
  • Like
Likes   Reactions: WWGD
Ah, thanks, I am not just clear on what we need to do. So we may have two identical records. Then we mistakenly enter different PK entries, which we can do, since, , as you pointed out, PK does not determine numberoffloors (I know this is ambiguous, what I mean is different rooms may be in different buildings with the same number of floors), and this gives us an inconsistency. So, if we mistakenly enter "Number of Floors" with a different value in the same copy, we have no way of automatically telling this is wrong?
 

Attachments

Hi WW,

Sorry, I didn't bother to look at the word file before replying to post #1: the table definition was enough to reply as I did.

My reply was triggered by the fact that #floors appears in every record for a given building, so in the normalization process it should turn out to be an attribute for the building, not for the room.
In the design of the table, it's more a redundancy issue than an inconsistency issue.
In a design redundancy is to be avoided, because inconsistency can arise easily when you add a record like (8, 1, 3, 4) (*)

For the word file in post #1, I would say adding record 2 will already be disallowed because the primary key must be unique. Same for the second word file in post #3.

(*) Which is what you pointed at in the second word file in post #3, but somewhat obfuscated because of the identical PK.

And yes, sometimes we do leave redundancies in and make sure inconsistencies are prevented by triggering checking procedures (which slows down the process, but less than splitting off a separate table with its own overhead). But in the learning process we don't ...:smile:

Redundancies are a sure recipe for future trouble: in your example, adding a floor to a building forces having to go through all records and fix them.
 
Last edited:
  • Like
Likes   Reactions: Silicon Waffle
Do you reference multiple copies of the same record and or field?

Redundancy means that you have more than the minimum required information to represent something. Do you store the same field twice or more and do you store more than the number of references you should (and is the choice of primary key structure optimal in that regard as well)?
 

Similar threads

Replies
17
Views
6K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 48 ·
2
Replies
48
Views
8K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 40 ·
2
Replies
40
Views
9K
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K