Here's my code:
So the both PKs and FKs come from 2 different tables, everything is working until the foreign key, the part where we have to reference. How do you reference the 2 different tables where the FKs are found? I tried using JOIN but it doesn't work.
Help please, I'm new to SQL.
P.S.
I've made both tables already so this is a new table under the same database. Thanks!
Code:
CREATE TABLE SALARY ( JOB_ID INT NOT NULL, MP_ID INT NOT NULL, SALARY_AMOUNT MONEY, CONSTRAINT pk_SALARY PRIMARY KEY (JOB_ID, MP_ID), FOREIGN KEY (JOB_ID, MP_ID) REFERENCES JOB JOIN MP ON UPDATE CASCADE );
Help please, I'm new to SQL.
P.S.
I've made both tables already so this is a new table under the same database. Thanks!
Comment