I created two tables which are customer_tbl
and pick_up_tbl
and im trying to create the third table that its field with reference from the first table, but end up with this:
errno: 150 "Foreign key constraint is incorrectly formed"
CREATE TABLE pic_rooster_tbl (
pic_ros_id int not null,
pic_id int not null,
c_id int not null,
name varchar(255) not null,
dat date,
PRIMARY KEY (pic_ros_id),
FOREIGN KEY (pic_id) REFERENCES Pickup_tbl (pic_id),
FOREIGN KEY (c_id) REFERENCES customer_tbl (c_id),
FOREIGN KEY (dat) REFERENCES Pickup_tbl (dat)
);