I was working on creating some tables in database foo, but every time I end up with errno 150 regarding the foreign key. Firstly, here\'s my code for creating t
The referenced field must be a "Key" in the referenced table, not necessarily a primary key. So the "car_id" should either be a primary key or be defined with NOT NULL and UNIQUE constraints in the "Cars" table.
And moreover, both fields must be of the same type and collation.