我试图在MySQL中用3个外键创建一个表

时间:2017-03-31 17:45:23

标签: mysql sql java-ee heidisql

CREATE TABLE IF NOT EXISTS `formationnote` (
    `IdEvaluation` int(11) NOT NULL AUTO_INCREMENT,
    `IdF` int(11),  
    `IdC` int(11),
    `user_id` int(11),
    `note` int(11) DEFAULT NULL, 
    PRIMARY KEY (`IdEvaluation`),
    FOREIGN KEY (`IdF`) REFERENCES formations(`IdF`),
    FOREIGN KEY (`IdC`) REFERENCES competences(`IdC`),
    FOREIGN KEY (`user_id`) REFERENCES users(`user_id``)
)

0 个答案:

没有答案