SQL Cannot add foreign key? <p>Hey guys i am new to learning SQL, trying to make a simple movie database for school but getting cannot add foreign key constraint error on SQL fiddle any ideas would be very much appropriated thanks.</p> <pre><code>CREATE TABLE Actor ( ActorID INT AUTO_INCREMENT PRIMARY KEY, FName VARCHAR (255), LName VARCHAR (255) ); CREATE TABLE Genre ( GenreID INT AUTO_INCREMENT PRIMARY KEY, GenreType VARCHAR(255) ); CREATE TABLE Director ( DirectorID INT AUTO_INCREMENT PRIMARY KEY, FirstName VARCHAR (255), LastName VARCHAR (255), MovieID INT, FOREIGN KEY (MovieID) REFERENCES Movie(MovieID) ); CREATE TABLE Movie ( MovieID INT AUTO_INCREMENT PRIMARY KEY, MovieTittle VARCHAR (255) NOT NULL, ReleaseYear INT (4) NOT NULL, Watched BOOlEAN, StarRating INT (2), DirectorID INT, FOREIGN KEY (DirectorID) REFERENCES Director(DirectorID) ); CREATE TABLE JunctionMovieGenre ( GenreID INT, MovieID INT, FOREIGN KEY (GenreID) REFERENCES Genre(GenreID), FOREIGN KEY (MovieID) REFERENCES Movie(MovieID) ); CREATE TABLE JunctionMovieActor ( MovieID INT, ActorID INT, FOREIGN KEY (ActorID) REFERENCES Actor(ActorID), FOREIGN KEY (MovieID) REFERENCES Movie(MovieID) ); </code></pre>