CREATE TABLE Class (
ClassNo varchar(6) not null PRIMARY KEY,
ClassName varchar(15) not null,
institute varchar(10) not null,
grade int not null,
ClassNum int not null
);
CREATE TABLE Student (
StudentNo varchar(7) not null PRIMARY KEY,
StudentName varchar(5) not null,
sex varchar(1) not null,
birthday DATE not null,
native varchar(5) not null,
nation varchar(5) not null,
ClassNo varchar(6) not null,
FOREIGN KEY(ClassNo) REFERENCES Class(ClassNo)
);
会出现如下报错:
3734 - Failed to add the foreign key constraint. Missing column 'ClassNo' for constraint 'student_ibfk_1' in the referenced table 'class'
请问这个怎么解决