~~~
DROP TABLE IF EXISTS `shop_cart`;
CREATE TABLE IF NOT EXISTS `shop_cart`(
`cartid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT "购物车id",
`productid` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT "商品的id",
`productnum` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT "商品的数量",
`price` DECIMAL(10,2) NOT NULL DEFAULT '0.00' COMMENT "商品的单价",
`userid` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT "用户的id",
`createtime` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT "创建时间",
KEY shop_cart_productid(`productid`),
KEY shop_cart_userid(`userid`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
~~~
了解购物车存储内容
分析数据表字段的设计
购物车
数据表