MySQL建表以及显示创建表的sql语句

DROP TABLE IF EXISTS `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`),
  FOREIGN KEY (`Topic_BoardId`) REFERENCES `board` (`BoardId`) ON DELETE CASCADE ON UPDATE CASCADE,
  FOREIGN KEY (`Topic_StudentId`) REFERENCES `student` (`StudentId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=gb2312 


展开阅读全文

没有更多推荐了,返回首页