Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Normalization Dependencies

Im just trying to make sure that im thinking of it the right way

1)full dependencies are when one or more primary keys determine another attribute

2)partial dependencies are when one of the primary keys determines another attribute or attributes

3)transitive dependencies are when a nonkey attribute determines another attribute

am i thinking of it right?

like image 900
user214577 Avatar asked Apr 22 '13 16:04

user214577


People also ask

What is dependency in normalization?

Functional Dependencies are fundamental to the process of Normalization Functional Dependency describes the relationship between attributes(columns) in a table. In other words, a dependency FD: X → Y means that the values of Y are determined by the values of X.

What are the 3 stages of Normalisation?

The database normalization process is further categorized into the following types: First Normal Form (1 NF) Second Normal Form (2 NF) Third Normal Form (3 NF)

What is normalization 1NF 2NF 3NF 4nf?

Following are the various types of Normal forms: A relation is in 1NF if it contains an atomic value. 2NF. A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional dependent on the primary key. 3NF. A relation will be in 3NF if it is in 2NF and no transition dependency exists.


1 Answers

This answer is directly from my CS course and obtained from the Connolly and Begg text book.

enter image description here

Full Functional Dependencies

Identify the candidate keys (here, propertyNo, iDate and pAddress). This is because any combination of those 3 can allow you to find what the other attributes are for a given tuple (I can find the staffNo that did the inspection given those three things, I can find the carReg the staffNo used given those 3 things etc.). But note, you need all of those 3 to find the other attributes, not just a subset. Full dependencies always relate to non-candidate keys depending on candidate keys, either depending on all or depending on some.

Partial Dependencies

Given those three candidate keys, look within the candidate keys. Is there any subset(s) of the candidate key which is dependent on the other? Yes, it is pAddress. Given a propertyNo, you can figure out what the address of the property. Then look outside of the candidate keys. Is there any of these keys that depend on only parts of the candidate key, not all components? In this case there are not. So partial dependencies are always dependencies within the candidate keys or dependencies of non-candidate keys on only parts of the candidate keys rather than all components

Transitive Dependencies

Now, look at the non-candidate keys (staffNo, comments, iTime (inspection time), sName, carReg). Within those, is there anything that is functionally dependent on the other? Yes, it is sName - given a staffNo, you can figure out the name of the staff member. But staffNo is functionally dependent on the 3 candidate keys. So by transitivity, propertyNo + iDate + pAddress -> staffNo -> sName, so sName is transitively dependent on staffNo. Transitive dependencies always relate to attributes outside of candidate keys.

like image 189
Dhruv Ghulati Avatar answered Oct 08 '22 14:10

Dhruv Ghulati