- 论坛徽章:
- 0
|
命令:show create table 表名
topic:
CREATE TABLE `topic` (
`TopicId` int(50) NOT NULL auto_increment,
`Topic_BoardId` int(10) NOT NULL,
`Topic_StudentId` int(10) NOT NULL,
`TopicTitle` varchar(1000) NOT NULL,
`TopicContent` varchar(6000) NOT NULL,
`TopicSendTime` varchar(30) NOT NULL,
PRIMARY KEY (`TopicId`),
KEY `topic_ibfk_1` (`Topic_BoardId`),
KEY `topic_ibfk_2` (`Topic_StudentId`),
CONSTRAINT `topic_ibfk_1` FOREIGN KEY (`Topic_BoardId`) REFERENCES `board` (`BoardId`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `topic_ibfk_2` FOREIGN KEY (`Topic_StudentId`) REFERENCES `student` (`StudentId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=gb2312
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/76927/showart_1316384.html |
|