Declaring Foreign Key Constraints
REFERENCES keyword...
CREATE TABLE ActedIn (
Name CHAR(30) PRIMARY KEY,
MovieName CHAR(30)
REFERENCES Movies(MovieName));
Or, summarize at end of CREATE TABLE
FOREIGN KEY MovieName REFERENCES Movies(MovieName)
MovieName must be a PRIMARY KEY
Previous slide
Next slide
Back to first slide
View graphic version