I have the following problem. These are my tables:
CREATE TABLE Author
(
author_fName VARCHAR(256) NOT NULL,
author_lName VARCHAR(256) NOT NULL,
author_dob DATE,
PRIMARY KEY (author_fName, author_lName)
# author_age INT
);
CREATE TABLE Director
(
director_fName VARCHAR(256) NOT NULL,
director_lName VARCHAR(256) NOT NULL,
director_dob DATE,
PRIMARY KEY (director_fName, director_lName)
);
CREATE TABLE Award
(
award_Name VARCHAR(256) NOT NULL PRIMARY KEY,
a_fName VARCHAR(256),
a_lName VARCHAR(256),
d_fName VARCHAR(256),
d_lName VARCHAR(256),
FOREIGN KEY (a_fName) REFERENCES Author(author_fName),
FOREIGN KEY (a_lName) REFERENCES Author(author_lName),
FOREIGN KEY (d_fName) REFERENCES Director(director_fName),
FOREIGN KEY (d_lName) REFERENCES Director(director_lName)
);
Sadly when I try to create the last table I receive a lovely ERROR NO 150. I investigated a little bit and found out that the error comes when I try to set the FOREIGN KEY for the a_lName and d_lName.
I'm not sure why this is happening.