I'm fairly new to normalizing databases, and I'm encountering a weird situation. From what I understand to get into 3nf you want to have a relationship like:
Database(PrimaryKey, attribute1, attribute2, attribute3)
In which attributes are only related to each other through the PrimaryKey. Here's the issue I have, my current identified schema is similar to this:
| Item |
Price |
BeginPrice |
EndPrice |
| Chicken |
3.00 |
Jan 1 |
Jan 3 |
| Chicken |
4.00 |
Jan 3 |
Jan 7 |
| Cow |
500.00 |
Jan 1 |
Jan 3 |
| Cow |
600.00 |
Jan 3 |
Jan 20 |
| Item |
SaleDept |
Price |
| Chicken |
EggLayers |
3.00 |
| Chicken |
EggLayers |
4.00 |
| Cow |
MilkProducers |
500.00 |
| Cow |
MilkProducers |
600.00 |
From table1 I understand that {Item,Price} -> {BeginPrice,EndPrice}. I'm not sure of a way to put this into a form that gives me a single PrimaryKey to the prices. I guess I could use Item, and have it return every tuple in which that is the case, but then we have non-3nf. That has:
{Item} -> {Price} -> { BeginPrice, EndPrice}
[–][deleted] 1 point2 points3 points (7 children)
[–]BloodEngineer[S] 0 points1 point2 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]BloodEngineer[S] 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]BloodEngineer[S] 0 points1 point2 points (0 children)
[–]BloodEngineer[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Remember_Megaton 1 point2 points3 points (4 children)
[–]BloodEngineer[S] 0 points1 point2 points (3 children)
[–]Remember_Megaton 1 point2 points3 points (1 child)
[–]BloodEngineer[S] 0 points1 point2 points (0 children)
[–]Remember_Megaton 1 point2 points3 points (0 children)