DROP TABLE IF EXISTS `imooc_pro`;CREATE TABLE `imooc_pro`(`id` int unsigned auto_increment key,`pName` 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);
如同上面的一个建立一个数据列表, 应注意几点:
1:注意给id,pName这些元素,加的标点是·符号(与~在一个键);
2:设定一个主键;
3:最后一行语句后不要再加逗号了。