Hi All,
When I try the example:
CREATE TABLE favorite_food
(person_id SMALLINT UNSIGNED,
food VARCHAR(20),
CONSTRAINT pk_favorite_food PRIMARY KEY (person_id, food),
CONSTRAINT fk_person_id FOREIGN KEY (person_id)
REFERENCES person (person_id)
);
From the book I get the error ERROR 1005 (HY000): Can't create table '.\bank\favorite_food.frm' (errno: 150)
From the searching I've done I see its related to the foreign key, but since I'm a newb I can't make much sense of whats going on. Is there something wrong with the syntax or what? If someone could put it in simple terms and explain what needs to be changed I'd really appreciate it.
I've tried on two seperate machines with dif versions of MySQL installed to play it safe, I get the same error on both.
Thanks!