[摘要]1.创建表及记录用于测试CREATE TABLE `product` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 产品id, `n... 1.创建表及记录用于测试CREATE TABLE `product` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '产品id', `name` varchar(50) NOT NULL COMMENT '产品名称', `original_price` decimal(5,2) unsigned NOT NULL COMMENT '原价', `price` decimal(5,2) unsigned NOT NULL COMMENT '现价', PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;INSERT INTO `product` (`id`, `name`, `original_price`, `price`) VALUES (NULL, '雪糕', '5', '3.5'),
(NULL, '鲜花', '18', '15'),
(NULL, '甜点', '25', '12.5'),
(NULL, '玩具', '55', '45'),
(NULL, '钱包', '285', '195'); mysql> select * from product;
+----+--------+----------------+--------+ |