关于mysql的问题,请高手帮忙.

来源:百度知道 编辑:UC知道 时间:2024/05/13 02:16:59
--数据库
create database auction;

--用户表
CREATE TABLE buyer (
bid INT NOT NULL AUTO_INCREMENT ,
name varchar(50) NOT NULL,
password varchar(50) NOT NULL,
email varchar(50) NOT NULL,
PRIMARY KEY (bid),
);

高手看这段程序,为什么用户表创建总是不成功,问题在哪呀?请高手帮忙呀,谢谢!!!
错误提示:
ERROR 1064 (42000);you have an error in your SQL syntax; check the manual that corresponds to you MySQL server version for the right syntax to use near ')'at line 7
请问一下我的问题出在哪了,帮忙说一下好吗?谢谢!!

CREATE TABLE `buyer` (
`bid` INT( 9 ) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 50 ) NOT NULL ,
`password` VARCHAR( 50 ) NOT NULL ,
`email` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `bid` )
);

if exists (select * from sysobjects where name='buyer')
drop table buyer
go
create table buyer(
examno varchar (10) not null,--考号--
stuno varchar (10) not null,--学号--
writtenexam int ,--笔试--
tabexam int--机试-

)
alter table li2 drop constraint pk_stuno
---栓除 主外键约素 - ------如上----------