为什么会这样呢
........
........
2015-05-05
CREATE DATABASE IF NOT EXISTS 'e-shop';
USE'e-shop';
--GUANLIYUAN
DROP TABLE IF EXISTS 'e-shop_admin';
CREATE TABLE 'e-shop_admin'(
'id' tinyint unsigned auto_increment key,
'username' varchar(20)not null unique,
'password' char(32)not null,
'email'varchar(50)not null
);
--FENLIE
DROP TABLE IF EXISTS 'e-shop_cate';
CREATE TABLE 'e-shop_cate'(
'id'smallint unsigned auto_increment key,
'cName' varchar(50)unique);
--SHANGPING
DROP TABLE IF EXISTS 'e-shop_pro';
CREATE TABLE'e-shop_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);
--YONGHU
DROP TABLE IF EXISTS 'e-shop_user';
CREATE TABLE 'e-shop_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);
--XIANGCHE
DROP TABLE IF EXISTS 'e-shop_album';
CREATE TABLE 'e-shop_album'(
'id' int unsigned auto_increment key,
'pid' int unsigned not null,
'albumPath'varchar(50)not null);
CREATE database IF NOT EXISTS'e-shop';
USE'e-shop';
--管理员表
DROP TABLE IF EXISTS 'e-shop_admin';
CREATE TABLE 'e-shop_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 'e-shop_cate';
CREATE TABLE 'e-shop_cate'(
'id' smallint unsigned auto_increment key,
'cName' varchar(50) unique);
--商品
DROP TABLE IF EXISTS'e-shop_pro';
CREATE TABLE 'e-shop_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);
--用户表
DROP TABLE IF EXISTS 'e-shop_user';
CREAT TABLE 'e-shop_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 'e-shop_album';
CREATE TABLE 'e-shop_album'(
'id'int unsigned auto_increment key,
'pid'int unsigned not null;
'albumPath'varchar(50)not null);
CREATE database IF NOT EXISTS'e-shop'; USE'e-shop'; --管理员表 DROP TABLE IF EXISTS 'e-shop_admin'; CREATE TABLE 'e-shop_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 'e-shop_cate'; CREATE TABLE 'e-shop_cate'( id smallint unsigned auto_increment key, cName varchar(50) unique); --商品 DROP TABLE IF EXISTS'e-shop_pro'; CREATE TABLE 'e-shop_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); --用户表 DROP TABLE IF EXISTS 'e-shop_user'; CREAT TABLE 'e-shop_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 'e-shop_album'; CREATE TABLE 'e-shop_album'( 'id' int unsigned auto_increment key, 'pid' int unsigned not null, 'albumPath' varchar(50) not null;)
举报