PRIMARY KEY Constraint

The PRIMARY KEY constraint uniquely identifies each record in a table. A table can only have one primary key, which can consist of one or multiple columns.

Example: Creating a Table with PRIMARY KEY

CREATE TABLE FreedomFighters (
    FighterID INT PRIMARY KEY,
    Name VARCHAR(50) NOT NULL,
    City VARCHAR(50)
);

Explanation: The FighterID column is set as the primary key, ensuring each fighter has a unique ID.