I'm using two online sources for gaining an understanding of the 5NF, without any rigor of Math and proofs.
- A Simple Guide to Five Normal Forms in Relational Database Theory (by Kent. This one seems to have been reviewed and endorsed in one of his writings by none other than CJ Date himself)
- Fifth Normal Form (Wikipedia article)
However, I'm unable to understand either of these references!
Let's first examine Reference #1 (Kent's).
It says: "But suppose that a certain rule was in effect: if an agent sells a certain product, and he represents a company making that product, then he sells that product for that company."
and, then, goes on to break up the original table (all table names have been given by me)...
acp(agent, company, product)
-----------------------------
| AGENT | COMPANY | PRODUCT |
|-------+---------+---------|
| Smith | Ford | car |
| Smith | Ford | truck |
| Smith | GM | car |
| Smith | GM | truck |
| Jones | Ford | car |
-----------------------------
... into 3 tables:
ac(agent, company)
cp(company, product)
ap(agent, product)
------------------- --------------------- -------------------
| AGENT | COMPANY | | COMPANY | PRODUCT | | AGENT | PRODUCT |
|-------+---------| |---------+---------| |-------+---------|
| Smith | Ford | | Ford | car | | Smith | car |
| Smith | GM | | Ford | truck | | Smith | truck |
| Jones | Ford | | GM | car | | Jones | car |
------------------- | GM | truck | -------------------
---------------------
But I'm not even sure if I understand the English-language meaning of the above rule. My understanding of the above rule is that its 'then' clause is totally redundant! For,
IF an agent is selling a product
AND
IF this agent is representing a company making that product,
THEN, OBVIOUSLY, this agent is selling that product for that company.
So, where is the 'rule' in this statement? It, in fact, seems to be a non-statement to me!
Working backwards from the three tables -- ac, cp, and ap -- it seems the rule really is: "A company may make 1 or more products, an agent may represent 1 or more companies, and when representing a company he may or may not sell all its products."
But the original table acp was already capturing this rule. So, I'm not sure what is going on here with the explanation of 5NF.
Let's now examine Reference #2 (Wikipedia).
It says: Suppose, however, that the following rule applies: "A Traveling Salesman has certain Brands and certain Product Types in his repertoire. If Brand B1 and Brand B2 are in his repertoire, and Product Type P is in his repertoire, then (assuming Brand B1 and Brand B2 both make Product Type P), the Traveling Salesman must offer products of Product Type P those made by Brand B1 and those made by Brand B2."
Once again, going just by the English-language meaning of this rule and nothing else,
IF a salesman has brands B1 and B2, and product P with him,
AND
IF product P is made by both brands B1 and B2,
THEN, why on earth wouldn't he be able to offer product P of brands B1 and B2 just as he could in the original 3-column table 'sbp(salesman, brand, product)' which was serving well even before this new 'rule' came into effect?
Could somebody please clarify?