I have a database 'STUDENT'. There are 4 table 'INFO','STREAM','GRADE' & 'MARKS'.
- INFO has 3 columns ID, NAME, STR_NO.
- STREAM has 2 columns STR_NO, STR_NAME.
- GRADE has 2 columns PERCENT, GRADE.
- MARKS has 3 columns ID, STR_NO, TOTAL_MARK, FULL_MARK
I have declared a composite primary key on info table i.e
PRIMARY KEY(ID, STR_NO)
But when I declare a foreign key on STREAM i.e
FOREIGN KEY(STR_NO) REFERENCES INFO(ID,STR_NO)
It gives error
Why and how to solve this