Creating a Primary Key

suggest change
CREATE TABLE Employees (
    Id int NOT NULL,
    PRIMARY KEY (Id),
    ...
);

This will create the Employees table with ‘Id’ as its primary key. The primary key can be used to uniquely identify the rows of a table. Only one primary key is allowed per table.

A primary key can also be composed of one or more columns, called a composite key, with the following syntax:

CREATE TABLE EMPLOYEE (
    e1_id INT,
    e2_id INT,
    PRIMARY KEY (e1_id, e2_id)
)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents