I've been learning about database Normalisation, and I have a question regarding a users table I have for my web app.
The table schema is as follows:
users (user_id, username, password, first_name, last_name, ver_code, verified)
I want to know if this is in 3NF. It is in 1NF (obviously) because the intersection of row-column contains single values. It is in 2NF automatically because the primary key is not composite. Is it 3NF?
As I understand it, a transitive dependency is when a non-prime attribute depends on other non-prime attributes rather than depending upon the prime attributes or primary key. So, user_id
is the primary key, and username isn't a primary key but is a prime attribute. So the table is in 3NF.
Is this right? Or am I missing something? Is the definition of transitive dependency above correct?
EDIT:
I thought Normalisation was objective, which is why I didn't bother stating my reference. I want to get my table in 3NF as per the Database Systems: A Practical Approach to Design, Implementation, and Management book by Connolly and Begg.
Here are the functional dependencies. Both the user_id
and the username
are unique fields, so they're both candidate keys.
fd1: user_id -> username, password, first_name, last_name, ver_code, verified
fd2: username -> user_id, password, first_name, last_name, ver_code, verified