hi all,
need help trying make this table and keep getting an error but cant see the problem any help be good.
Code:
create table Register
(StudentID varchar(5) not null,
ClassID varchar(5) not null,
WeekID varchar(10) not null,
LessonID varchar(10) not null,
foreign key (StudentID) references student(StudentID),
foreign key (ClassID) references Classes(ClassID),
foreign key (WeekID) references Week(WeekID),
foreign key (LessonID) references Lessons(LessonID)
)
engine = innodb;
I think the problem is with the line foreign key (WeekID) references Week(WeekID),
error
Command failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Week(WeekID), foreign key (LessonID) references Lessons(LessonI
Thanks
|