为了账号安全,请及时绑定邮箱和手机立即绑定

正在回答

2 回答

CREATE DATABASE IF NOT EXISTS`shop`;

USE`shop`;


DROP TABLE IF EXISTS `admin`;

CREATE TABLE `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 `cate`;

CREATE TABLE `cate`(

`id` smallint unsigned auto_increment key,

`cName` varchar(50) unique

);



DROP TABLE IF EXISTS `pro`;

CREATE TABLE `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 `user`;

CREATE TABLE `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 `album`;

CREATE TABLE `album`(

`id` int unsigned auto_increment key,

`pid` int unsigned not null,

`albumPath` varchar(50) not null

)


1 回复 有任何疑惑可以回复我~
#1

mengniu 提问者

非常感谢!
2018-01-13 回复 有任何疑惑可以回复我~

CREATE DATABASE IF NOT EXISTS`shopImooc`;

USE`shopImooc`;


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

);



DROP TABLE IF EXISTS `imooc_cate`;

CREATE TABLE `imooc_cate`(

`id` smallint unsigned auto_increment key,

`cName` varchar(50) unique

);



DROP TABLE IF EXISTS `imooc_pro`;

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

);



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

)charset='utf8';



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

)


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
手把手教你实现电商网站后台开发
  • 参与学习       117285    人
  • 解答问题       1999    个

手把手教你用PHP搭建电子商务平台,由浅入深教你搭建电商系统

进入课程

老师写的sql文件,全是错误,怎么改

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信