I'm trying to link two tables together via a foreign key in MySQL. The CLIENTS table should be linked to another table (BIDS) with the Client ID attribute.
CREATE TABLE CLIENTS (
CLIENTID NUMERIC(3) NOT NULL,
FOREIGN KEY(CLIENTID) REFERENCES BIDS(CLIENTID),
PRIMARY KEY(CLIENTID, EMAILADDRESSES,PHONENUMBERS,CONTACTS)
);
However, MySQL returns this error when I try to execute the code.
#1005 - Can't create table 'CLIENTS' (errno: 150)
It doesn't seem to be a syntax error, so does anyone know what's causing the issue or how can I fix it?