Mark a column as the main row identifier.
Section: Constraints and Indexes
Define primary key
sql
sql
CREATE TABLE departments (
department_id INTEGER PRIMARY KEY,
name VARCHAR(100) NOT NULL
);Explanation
Primary keys uniquely identify each row.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Constraints and Indexes