If I add an id column to a table, and set id as the primary key, will the table be in 2NF?
No. Just because you have a primary key doesn't mean your schema is 2NF.
Using the formal logic, this statement is FALSE
.
There are tables having id
as a PRIMARY KEY
not being in 2NF
.
You've already got the answer, but I'm going to call attention to the following, from the article on second normal form:
" A table for which there are no partial functional dependencies on the primary key is typically, but not always, in 2NF. In addition to the primary key, the table may contain other candidate keys; it is necessary to establish that no non-prime attributes have part-key dependencies on any of these candidate keys.
Multiple candidate keys occur in the following table: "
Adding an id field doesn't make any other cnadidate keys go away, even if you make id the primary key.