mysql只建成五个中的两个表,谁能帮我看看
为什么我的只建成了五个表中的两个,谁有写好的让我参考下,或者帮我看看
mysql> CREATE DATABASE IF NOT EXISTS `shopImooc`;
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> USE `shopImooc`;
Database changed
mysql>
mysql> -- 管理员表
mysql>
mysql> DROP TABLAE IF EXISTS `imooc_admin`;
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 'TABLA
E IF EXISTS `imooc_admin`' at line 1
mysql> CREATE TABLE `imooc_admin`(
-> `id` tinyint unsigned auto_increment key,
-> `username` varchar(20) not null unqiue,
-> `password` char(32) not null,
-> `email` varchar(50) not null
-> );
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 'unqiu
e,
`password` char(32) not null,
`email` varchar(50) not null
)' at line 3
mysql>
mysql> -- 分类表
mysql>
mysql> DROP TABLE IF EXISTS `imooc_cate`;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> CREATE TABLE `imooc_cate`(
-> `id` smallint unsigned auto_increment,
-> `cName` varchar(50) not null unique
-> );
ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum
n and it must be defined as a key
mysql> -- 商品表
mysql>
mysql> DROP TABALE IF EXISTS `imooc_pro`;
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 'TABAL
E IF EXISTS `imooc_pro`' at line 1
mysql> CREATE TABLE `imooc_pro`(
-> `id` int unsigned auto_increment key,
-> `pName` varchar(50) not null unique,
-> `pSn` varchar(50) not null,
-> `pNum` int unsigned default 1,
-> `mPrice` decimal(10,2) not null,
-> `iPrice` decimal(10,2) not null,
-> `pDesc` text,
-> `pImg` varchar(50) not null,
-> `pubTime` int unsigned not null,
-> `isShow` tinyint(1) default 1,
-> `isHot` tinyint(1) default 0,
-> `cId` smallint unsigned not null
-> );
ERROR 1050 (42S01): Table 'imooc_pro' already exists
mysql> -- 用户表
mysql>
mysql> DROP TABLE IF EXISTS `imooc_user`;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> CREATE TABLE `imooc_user`(
-> `id` int unsigned auto_increment key,
-> `username` varchar(20) not null unique,
-> `password` char(32) not null,
-> `sex` enum ("男","女","保密") not null default "保密",
-> `face` varchar(50) not null,
-> `regTime` int unsigned not null,
-> );
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 8
mysql> -- 相册表
mysql>
mysql> DROP TABLE IF EXISTS `imooc_album`;
Query OK, 0 rows affected (0.04 sec)
mysql> CREATE TABLE `imooc_album`(
-> `id` int unsigned auto_increment key,
-> `pid` int unsigned not null,
-> `albumPath` varchar(50) not null
-> );
Query OK, 0 rows affected (0.07 sec)
mysql>
mysql> show tables;
+---------------------+
| Tables_in_shopimooc |
+---------------------+
| imooc_album |
| imooc_pro |
+---------------------+
2 rows in set (0.00 sec)