Skip to content

KEYS

CREATE TABLE Orders (
OrderID int,
CustomerID int,
OrderNumber int,
PRIMARY KEY (OrderID)
);
Query OK, 0 rows affected (0.20 sec)

The CREATE TABLE statement creates a table named ‘Orders’ with three columns: OrderID, CustomerID, and OrderNumber. The PRIMARY KEY keyword denotes that the OrderID is the primary key of the Orders table. A primary key is a unique identifier for records in the table. It cannot contain NULL values and must contain unique values.