Alternate Key

An alternate key is any Candidate Key that is not chosen as the Primary Key. It is still unique and minimal, but serves as a secondary unique identifier. Enforced with a UNIQUE constraint.

CREATE TABLE users (
    id SERIAL PRIMARY KEY,              -- Primary key (surrogate)
    email VARCHAR(255) UNIQUE NOT NULL,  -- Alternate key
    username VARCHAR(50) UNIQUE NOT NULL -- Alternate key
);

Both email and username are candidate keys — unique and minimal. Since id was chosen as the Primary Key, the other two become alternate keys.