The short answer
A uniquely identifies each row.
CREATE TABLE customer (
id INT PRIMARY KEY
);Properties:
- Unique
- Cannot be NULL
- Usually indexed
Free. Runs in your browser, no install.
SQL · Keys, Schema & CTEs
What is a primary key?
The short answer
A uniquely identifies each row.
CREATE TABLE customer (
id INT PRIMARY KEY
);Properties:
Lock it in with a real drill
You remember an answer longer once you have used it. Try a hands-on problem on this concept.