MySQL建表SQL语句
数据库结构:商城系统-优惠券表:https://open.yesapi.cn/tablelist/yesapi_yshopmall_yx_store_coupon.html
-- 数据库大全:商城系统-优惠券表
-- 来源:YesApi.cn
CREATE TABLE `yesapi_yshopmall_yx_store_coupon` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(64) NOT NULL COMMENT '优惠券名称',
`integral` int(10) NOT NULL DEFAULT '0' COMMENT '兑换消耗积分值',
`coupon_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '兑换的优惠券面值',
`use_min_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低消费多少金额可用优惠券',
`coupon_time` int(10) NOT NULL DEFAULT '0' COMMENT '优惠券有效期限(单位:天)',
`sort` int(10) NOT NULL DEFAULT '1' COMMENT '排序',
`yesapi_yshopmall_yx_store_coupon_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '状态(0:关闭,1:开启)',
`product_id` varchar(200) NOT NULL COMMENT '商品ids',
`yesapi_yshopmall_yx_store_coupon_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '优惠券类型 0-通用 1-商品券',
`create_time` datetime NOT NULL COMMENT '兑换项目添加时间',
`is_del` tinyint(3) NOT NULL DEFAULT '0' COMMENT '是否删除',
KEY `coupon_time` (`coupon_time`),
KEY `yesapi_yshopmall_yx_store_coupon_status` (`yesapi_yshopmall_yx_store_coupon_status`),
KEY `create_time` (`create_time`),
KEY `is_del` (`is_del`),
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT '商城系统-优惠券表';
复制后,到数据库执行,即可创建此数据库表。
MySQL数据库表结构设计
第 1-11 条, 共 11 条.
字段名称 | 字段类型 | 字段默认值 | 是否允许为空 | 字段描述 | 索引 | 字段数据示例 |
---|---|---|---|---|---|---|
title | varchar(64) | 否 | 优惠券名称 | 无索引 | ||
integral | int(10) | 0 | 否 | 兑换消耗积分值 | 无索引 | 0 |
coupon_price | decimal(8,2) unsigned | 0.00 | 否 | 兑换的优惠券面值 | 无索引 | 0.00 |
use_min_price | decimal(8,2) unsigned | 0.00 | 否 | 最低消费多少金额可用优惠券 | 无索引 | 0.00 |
coupon_time | int(10) | 0 | 否 | 优惠券有效期限(单位:天) | 普通索引 | 0 |
sort | int(10) | 1 | 否 | 排序 | 无索引 | 1 |
yesapi_yshopmall_yx_store_coupon_status | tinyint(3) | 0 | 否 | 状态(0:关闭,1:开启) | 普通索引 | 0 |
product_id | varchar(200) | 是 | 商品ids | 无索引 | ||
yesapi_yshopmall_yx_store_coupon_type | tinyint(4) | 0 | 是 | 优惠券类型 0-通用 1-商品券 | 无索引 | 0 |
create_time | datetime | 否 | 兑换项目添加时间 | 普通索引 | ||
is_del | tinyint(3) | 0 | 否 | 是否删除 | 普通索引 | 0 |