I'm running the following SQL:
create table group(groupID varchar(15) primary key,
group_name varchar(30),
name_of_member varchar(100),
studentID varchar(15),
foreign key(studentID) references student(studentID))engine=innodb;
Bu开发者_Go百科t it's not working. I'm getting the error:
ERROR 1064 (42000) : You have an error in your SQL syntax.... near group(groupID varchar(15) primary key, group_name varchar(30),name_of_member va' at line 1
PLEASE HELP ME... :(
group
is a keyword [think select sum(column) from sometable group by name
]. You'll need to name your table something different.
Some DBMSes will let you use keywords as table/column names, but they need to be escaped. i.e. in MSSQL, you'd use create table [group](...)
.
精彩评论