Reputation: 39
This is an example from class, and for the most part i can turn these into 1NF, 2NF and 3NF. What I don't understand is the question that asks what form is this in to begin with. The instructor didn't explain it and from what I understan, the initial shorthand notation would not be in any normalized form at all. The shorthand notation I am examining is the one in bold. The question that I am having trouble with is the one in bold as well.
Staff(employeeID,employeeName, salesOffice, officePhone, (customerID, name, address, city, state, zip))
Functional Dependencies
employeeId → employeeName, salesOffice, officePhone
salesOffice → officePhone
customerID → name, address, city, state, zip
zip → state, city
What normal form is it currently in? if not in 3NF show 1NF, 2NF, and 3NF
1NF
Staff(employeeID,employeeName, salesOffice, officePhone, customerID, name, address, city, state, zip)
2NF
Staff(employeeID,employeeName, salesOffice, officePhone)
customer(customerID, name, address, city, state, zip)
saleCust(employeeID, customerID)
3NF
Staff(employeeID,employeeName, salesOffice, officePhone)
customer(customerID, name, address,zip)
saleCust(employeeID, customerID)
zip(city, state,
zip)
Would I be correct in stating that the initial shorthand form provided (the one in bold) would be in no normalized form at all?
Upvotes: 1
Views: 6477
Reputation: 1704
Yes it is totally correct to say that. You don't have to just say it. You have facts to prove as well.
You can write:
As 1NF states:
The table must have all atomic values.
Staff(employeeID,employeeName, salesOffice, officePhone, (customerID, name, address, city, state, zip))
In the above Staff table, Customer information is not atomic so it is not in 1NF.
Solution in 1NF:
Staff(employeeID,employeeName, salesOffice, officePhone, customerID, name, address, city, state, zip)
Then comes the 2NF which states:
There should not be any partial dependencies in your table or each non-key attribute must be fully dependent on key attribute value.
Staff(employeeID,employeeName, salesOffice, officePhone, customerID, name, address, city, state, zip)
In the above relation, employeeName, salesOffice, officePhone are dependent on employeeID while address, city, state, zip on CustomerID.
Solution in 2NF:
Staff(employeeID,employeeName, salesOffice, officePhone)
customer(customerID, name, address, city, state, zip)
saleCust(employeeID, customerID)
And in the last, 3NF comes which states:
There should not be any transitive dependencies in your table.
Staff(employeeID,employeeName, salesOffice, officePhone)
customer(customerID, name, address, city, state, zip)
saleCust(employeeID, customerID)
Now from above relations, state and city depends on zip while zip in turn depends on customerID.
Solution in 3NF:
Staff(employeeID,employeeName, salesOffice, officePhone)
customer(customerID, name, address,zip)
saleCust(employeeID, customerID)
zip(city, state,
zip)
In this way you will not only say but prove as well that the question was not even in 1NF.
Upvotes: 3