A Candidate Key is any column or set of columns that can be used as a database's unique key. In a single table, there might be numerous Candidate Keys. Each Candidate Key has the potential to be a Primary Key.
A primary key is a column or a set of columns that uniquely identifies a record in a database. There can only be one Candidate Key that is the primary key.
When choosing the Primary Key, one must be extremely cautious, since making the wrong choice might have a negative influence on the database architect and future normalisation. To qualify as a Primary Key, a Candidate Key must be non-NULL and unique across all domains.
Example:
create table customers (
customer_id int not null primary key,
firstname varchar(50) not null,
lastname varchar(50) not null,
gender char(1),
constraint uk_customers unique (customer_id)
);