Create table: foreign key
Drop table Orders;
CREATE TABLE Orders
(
ID SMALLINT UNSIGNED NOT NULL PRIMARY KEY,
ModelID SMALLINT UNSIGNED NOT NULL,
Desciption VARCHAR(40),
FOREIGN KEY (ModelID) REFERENCES Models (ModelID)
ON DELETE CASCADE ON UPDATE CASCADE
);
Describe Orders;
Related examples in the same category