[SQL] 纯文本查看 复制代码
CREATE TABLE `orders` ( `oid` varchar(32) NOT NULL, `ordertime` datetime DEFAULT NULL, `total` double DEFAULT NULL, `state` int(11) DEFAULT NULL, `address` varchar(30) DEFAULT NULL, `name` varchar(20) DEFAULT NULL, `telephone` varchar(20) DEFAULT NULL, `uid` varchar(32) DEFAULT NULL, PRIMARY KEY (`oid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
[SQL] 纯文本查看 复制代码
CREATE TABLE `orderitem` ( `itemid` varchar(32) NOT NULL, `count` int(11) DEFAULT NULL, `subtotal` double DEFAULT NULL, `pid` varchar(32) DEFAULT NULL, `oid` varchar(32) DEFAULT NULL, PRIMARY KEY (`itemid`), KEY `fk_0001` (`pid`), KEY `fk_0002` (`oid`), CONSTRAINT `fk_0001` FOREIGN KEY (`pid`) REFERENCES `product` (`pid`), CONSTRAINT `fk_0002` FOREIGN KEY (`oid`) REFERENCES `orders` (`oid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;