您好我正在尝试在 Mysql 中使用 SQL 创建一个表,但我不断收到错误消息。这是我的代码:
USE e-commerce
CREATE TABLE `categories` (
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`category` VARCHAR( 30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `category` (`category`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
当我尝试在 phpmyadmin SQL 控制台中运行它时,我收到此错误:
#1064 - 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 'CREATE TABLE `categories` ( `id` SMALLINT NOT NULL AUTO_INCREMENT, `category` ' at line 2
我究竟做错了什么?