復制進入aql后就出錯~不知道為什么
代碼(抄老師的):
CREATE DATABSE IF NOT EXISTS 'shopImooc';
USE 'shopImooc';
--管理員表
DROP TABLE IF EXISTS 'imooc_admin';
CREATE TABLE IF NOT EXISTS 'imooc_admin'(
'id' TINYINT unsigned auto_increment key,
'username' varchar(20) not null unique,
'password' char(32) not null,
'email' varchar(50) not null
);
--分列表
DROP TABLE IF EXISTS 'imooc_cate';
CREATE TABLE 'imooc_cate'(
'id' smallint UN50SIGNED auto_increment null key,
'cName' varchar() unique
);
--商品表
DROP TABLE IF EXISTS 'imooc_pro'(
'id' int unsigned auto_increment key,
'pName' varchar(50) not null unique,
'pSn' varchar(50) not null,
'pNum' int int unsigned default 1,
'mPrice' decimal(10,2) unsigned 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 1,
'cId' smallint unsigned not null
);
--用戶表
DROP TABLE IF EXISTS 'imooc_user'
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
);
--相冊表
DROP TABLE IF EXISTS'imooc_ablum';
CREATE TABLE 'imooc_ablum'(
'id' int unsigned auto_increment key,
'pid' int unsigned not null,
'ablumPath' varchar(20) unsigned not null
);
2017-04-12
商品表 ‘pNum’類型定義錯誤了 ?int或者 tinyint?