我正在尝试在MySQL工作台中设置MySQL模型。
到目前为止,我已经定义了三个表:studentTerm、studentTermCourse和courseTerm。表studentTermCourse有3个主键:{studentId, courseCode and termCode,其中studentId和courseCode是studentTerm表的主键,courseCode和termCode是courseTerm表的主键。
我正在尝试定义StudentTermCourse中的外键,但无法在与courseTerm表相关的外键名称中选择termCode,因为我已经将其定义为与studentTerm表相关的外键。
我希望下面的截图能让它变得更清楚:
您能建议一下定义主键/外键的正确方法吗?
谢谢。


发布于 2015-02-16 11:51:14
确保两个表中的列具有完全相同的数据类型(例如无符号)
https://stackoverflow.com/questions/28533314
复制相似问题