3rd normal form for user account, salts and hashes

I understand the importance of salts, hashes and all the good stuff for passwords. My question is related to the theory of relational databases.

My understanding of the third normal form is that each element should provide information about the key, keyword and nothing but the key (so help me Codd. Thanks, Wikipedia). So I was looking through some of my tables, and I came across this.

-- Users
CREATE TABLE accounts(
    player_id mediumint NOT NULL AUTO_INCREMENT, -- Surrogate Key
    username VARCHAR(32) UNIQUE NOT NULL, -- True primary key
    salt char(29), -- Passwords are stored in bcrypt hash
    hash char(60), -- Salt + Hash stored
    created DATETIME,
    lastlogin DATETIME,
    PRIMARY KEY (player_id)
  ) ENGINE = InnoDB;

Question: Is this table in 3rd normal form? My understanding ... "Hash" depends on player_id and salt. IE: hash → (username, salt).

I just don't see the real benefits of splitting this table. But I am concerned that there is a possible update anomaly or something that I do not see.

+3
3

"" player_id . IE: hash → ( , ).

.

.

, . , , (, , ). , , 3NF .

( ). . , - - , 3NF.

, .. , , .

+1

, ,

+1

Please do not split the table. This table is in 3rd normal form. As far as I can see, all columns depend on player_id, with the caveat that the salt depends, for example, on the username or player_id.

0
source

All Articles