CREATE TABLE Suppliers (
supplier_id INT PRIMARY KEY,
name VARCHAR(100) NOT NULL
);
INSERT INTO Suppliers VALUES (1, 'Aurora Parts');
SELECT * FROM Suppliers;
| supplier_id | name |
|---|---|
| 1 | Aurora Parts |
● 1 row · produced by running this query on the sample database
Common mistake
Choosing a key that can change, such as an email address. When it changes, every row that referenced it must change too. An id that means nothing on its own is the safer choice.