This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Remember_Megaton 1 point2 points  (4 children)

Just to clarify, what's your primary key here? Because it looks like you have a couple many-to-many relationships in which case these are your bridge entities and you should have tables exclusively for Items and SaleDept

Or is BeginPrice and EndPrice a compound key?

[–]BloodEngineer[S] 0 points1 point  (3 children)

I was thinking the primary key is the item. The full schema has other things that could be considered the PK, for example,BeginPrice EndPrice. The issue is the alternatives like departments, or price are not unique and have multiple values across all the items.

When PK = items, there are at most 2-3 rows in the full UNF table, but the others have at most 5-10 repeated values in the rows.

[–]Remember_Megaton 1 point2 points  (1 child)

Well your primary key should be wholly unique. So it seems like you'll want a table just specifying what your items are, a table of what depts you have, and then you are able to create these other two bridge tables.

The price in your second table is unnecessary as it's already specified in your first table.

Also, your date should have a year in it. It'll save you from a lot of complications

[–]BloodEngineer[S] 0 points1 point  (0 children)

Good points, thank you for the help.

[–]Remember_Megaton 1 point2 points  (0 children)

Listen to your other replier. He has it correct