How to properly create composite primary keys – MYSQL

0
96

I would use a composite (multi-column) key.

CREATE TABLE INFO (
    t1ID INT,
    t2ID INT,
    PRIMARY KEY (t1ID, t2ID)
) 

This way you can have t1ID and t2ID as foreign keys pointing to their respective tables as well.

LEAVE A REPLY

Please enter your comment!
Please enter your name here