运行不了..

create database if NOT EXISTS 'shopImooc';

USE 'shopImooc';

--gliyaungbiao

DROP TABLE IF EXISTS 'imooc_admin';

create table 'imooc_admin'(

'id' tinyint unsigned auto_increment key,

'username' varchar(20) not null unique,

'password' char(32) not null,

'email' varchar(50) not null

);

--fenleibiao

DROP table IF EXISTS 'imooc_cate';

create table 'imooc_cate'(

'id' smallint unsigned auto_increment key,

'cName' varchar(50) unique

);

--shangpingbiao

drop table if exists 'imooc_por';

create table 'imooc_por'(

'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

);

--yonghubiao

DROP table if exists 'imooc_user';

create table 'imooc_user'(

'id' int unsigned auto_increment key,

'username' varchar(20) not null unique,

'password' char(30) not null,

'sex' enum("男","女","保密") not null default "保密",

'face' varchar(50) not null,

'regTime' int unsigned not null

);

--xiancbiao

DROP table if exists 'imooc_album';

create table 'imooc_album'(

'id' int unsigned auto_increment key,

'pid' int unsigned not null,

'albumPath' varchar(50) not null

);


xiemioc
浏览 1909回答 1
1回答

qq_大寒_2

有设置主键吗?
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

MySQL