【急】关于Mysql创建表!

来源:百度知道 编辑:UC知道 时间:2024/09/24 08:34:49
我是初学者,刚装的Mysql。
根据视频写了如下语句
create table emp
(
int id primary key,
);
总是不成功,其他的表照这种格式也不行,总是提示
ERROR 1064 (42000): 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 ')' at
line 6
查了资料不知道是怎么回事,重装了也没有用!!
哪位高手知道怎么回事啊?
先谢谢了!

别这么弄 下一个可视化的工具在研究 方便的多

create table product(productid char(5)
not null primary key,
productname varchar(20) not null,
unitprice number(10,2) not null,
category varchar(20),provider varchar(20),startdate date)
提示
ERROR 1064 (42000): 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 'constraint p_pk primary key,
productname varchar(20) not null,
unitprice number(' at line 2

当然不会成功!
应该这样:
create table emp
(
id int primary key,
);

create table emp
(
int id primary key
);
不要那个“,”号

你的那个最后一个 ) 是用英文的吗??不能用汉语的那个