In order to understand what is second normal form I was reading some articles and there are some things that I don't understand .
In the article here
in the customer table it says it is not in 2NF because there are several attributes which don’t completely rely on the entire Customer table primary key
.Here by primary key I think it has meant {customerId,EmployeeId}
If we select {customerId,employeeId} as the candidate key then it is true that Customername,customerCity,PostalCode depends only partly on candidate key and hence not in 2NF. But if we consider the candidate key to be customerId alone then all columns in Customer table are fully dependent on customerId right?(Because employeeId is dependent on customerId ).
Also as CustomerId alone can be a candidate key can we have {CustomerId,EmployeeId} as a candidate key because a candidate key can't contain another candidate key as a part of it.
Therefore if we take the customerId alone to be candidate key isn't this table in 2NF form?
but then in the article it says the a table in 2NF form should serve one purpose and here this customer table serves two purposes.
To indicate which customers are called upon by each employee
To identify customers and their locations.
Then I feel like this table is not in 2NF.
So what is the candidate key in this table?
My second question is in this article
these table are in 3NF. In the table TABLE_BOOK the candidate key is bookId right?We can't select {bookId,genereId} as the candidate key right?If selected so it wouldn't be in 2NF as price doesn't depend on genreId.
Can someone please help me to better understand this theory behind normalization