mysql 创建数据库和表的例子

create database php39;                   #创建数据库php39
use php39;
set names utf8;

drop table if exists p39_goods;
create table p39_goods
(
id mediumint unsigned not null auto_increment comment 'Id',
goods_name varchar(150) not null comment '商品名称',
market_price decimal(10,2) not null comment '市场价格',
shop_price decimal(10,2) not null comment '本店价格',
goods_desc longtext comment '商品描述',
is_on_sale enum('是','否') not null default '是' comment '是否上架',
is_delete enum('是','否') not null default '否' comment '是否放到回收站',
addtime datetime not null comment '添加时间',
logo varchar(150) not null default '' comment '原图',
sm_logo varchar(150) not null default '' comment '小图',
mid_logo varchar(150) not null default '' comment '中图',
big_logo varchar(150) not null default '' comment '大图',
mbig_logo varchar(150) not null default '' comment '更大图',
primary key (id),
key shop_price(shop_price),
key addtime(addtime),
key is_on_sale(is_on_sale)
)engine=InnoDB default charset=utf8 comment '商品';

drop table if exists p39_brand;
create table p39_brand
(
id mediumint unsigned not null auto_increment comment 'Id',
brand_name varchar(30) not null comment '品牌名称',
site_url varchar(150) not null default '' comment '官方网址',
logo varchar(150) not null default '' comment '品牌Logo图片',
primary key (id)
)engine=InnoDB default charset=utf8 comment '品牌';

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值