下面的MySQL create语句有什么问题?
我正在努力在MySQL中创建这个简单的表:下面的MySQL create语句有什么问题?,mysql,Mysql,我正在努力在MySQL中创建这个简单的表: create table events ( id int, when timestamp not null, summary varchar(256) not null, description varchar(500) not null, owner int not null, attendee int not null, PRIMARY KEY(id), FOREIGN KEY(own
create table events (
id int,
when timestamp not null,
summary varchar(256) not null,
description varchar(500) not null,
owner int not null,
attendee int not null,
PRIMARY KEY(id),
FOREIGN KEY(owner) REFERENCES calendar_users(id),
FOREIGN KEY(attendee) REFERENCES calendar_users(id)
);
FKs的描述很好,PK语句。然而,出于某种原因,MySQL似乎在第三行出现了问题。谁能帮我一下吗。谢谢。
是保留字时
若要将其用作名称,请在其周围加上反勾。为保留字()
最好只是更改字段标题。例如,当是保留字时,我会使用datetime。你的问题的标题有什么问题?或者更好的是,使用另一个标识符。它是保留字。有几个关键字没有保留!当然,datetime正是将来可能成为“保留”的关键字