我收到此错误:
错误 1452 (23000):无法添加或更新子行:外键约束失败 (
university
.registration
, CONSTRAINTregistration_ibfk_2
FOREIGN KEY (section_id
) REFERENCESSection
(section_id
))
这是我的代码
INSERT INTO Registration VALUES (24766, 1102, 'B', 'B');
CREATE TABLE Registration (
student_id INT,
section_id INT,
midterm_grade VARCHAR(5),
final_grade VARCHAR(5),
PRIMARY KEY (student_id, section_id),
FOREIGN KEY (student_id)
REFERENCES Student (student_id),
FOREIGN KEY (section_id)
REFERENCES Section (section_id)
);
任何帮助将不胜感激解决这个问题。