0

I have a teacher who doesn't like to explain to the class but loves putting up review questions for upcoming tests. Can anyone explain the image above? My main concern in the red underline which shows that supplier and supplierPhone are repeated values. I thought that repeated values occurred when there were many occurrences of the same item in a column.

Another question I have is that if the Supplier is a repeating value, why isnt Part_Name a repeating value because they both have 2 items with same names in their columns.

Example:

enter image description here

Andronicus
  • 25,419
  • 17
  • 47
  • 88
john sal
  • 15
  • 5
  • 2
    We prefer to see the text of questions written out rather than in images. That way others can search for your question when they have similar questions. – O. Jones Mar 21 '19 at 11:19
  • Does this answer your question? [Normalization: What does "repeating groups" mean?](https://stackoverflow.com/questions/23194292/normalization-what-does-repeating-groups-mean) – philipxy Feb 17 '21 at 19:07

2 Answers2

0

It's repeated because the result of the tuple is always the same. E.g. ABC Plastics will always have the same phone number, therefore having 2 rows with ABC Plastics means that we have redundant information in the phone number.

Part1 Company1 12341234
Part2 Company1 12341234

We could represent the same information with:

Part1 Company1
Part2 Company1

And

Company1 12341234.

Therefore having two rows with the same phone number is redundant.

This should answer your second question as well.

Essentially you're looking for tuples such that given the tuple (X, Y) exists, if there exists another tuple (X, Y') then Y' = Y

winnie
  • 109
  • 6
  • So essentially, the repeated values kind of have to exist in a couple? Like they should be repeated across at least 2 columns? – john sal Mar 21 '19 at 11:31
  • Yes, this is why in the 3NF/2NF form, we remove this redundancy by creating a new table with just the companies and the phone numbers. It means if there is three columns, let's say Products, Companies and Phone Numbers, where every Company always has the same Phone Number, but the Product is sometimes different, this means that you have redundancy and you are not normalised. – winnie Mar 21 '19 at 11:33
  • What about the first 2 columns in which the Part_ID has 2 Id's called "MT123" and both of those Id's have a 120v power unit? – john sal Mar 21 '19 at 11:37
  • If I was to guess, your lecturer underlined a single example of data redundancy, rather than all the examples. We can see that you are correct in saying that this is redundant, as in the 3NF we separate out these into a table. – winnie Mar 21 '19 at 11:39
-2

Looks like five tables to me.

model   (entity)
modelid  description price
 1        Laserjet    423.56 
 1        256 Colour   89.99
part   (entity)
partid  name
PF123   Paper Spool
LC423   Laserjet cartridge
MT123   Power supply
etc
bill_of_materials    (many to many relationship  model >--< part )
modelid  partid     qty
1        PF123       2
1        LC423       4
1        MT123       1
2        MT123       2
supplier  (entity)
supplier_id phone         name
1           416-234-2342  ABC Plastics
2           905..         Jetson Carbons
3           767...        ACME Power Supply
etc.
part_supplier  (many to many relationship  part >--< supplier )
part_id    supplier_id      
PF123       1
LC423       2
MT123       3
etc.

You have one row in model, part, supplier for each distinct entity

You have rows in bill_of_materials for each part that goes into each model.

You have a row in part_supplier for each supplier that can furnish each part. Notice that more than one part can come from one supplier, and more than one supplier can furnish each part. That's a many-to-many relationship.

The trick: Figure out what physical things you have in your application domain. Then make a table for each one. Then figure out how they relate to each other (that's what makes it relational.)

O. Jones
  • 103,626
  • 17
  • 118
  • 172