Teacher/Student表
CREATE TABLE `teacher` ( `id` INT NOT NULL, `name` VARCHAR(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4; INSERT INTO teacher(`id`, `name`) VALUES (1, '秦老师'); CREATE TABLE `student` ( `id` INT NOT NULL, `name` VARCHAR(30) DEFAULT NULL, `tid` INT DEFAULT NULL, PRIMARY KEY (`id`), KEY `fktid` (`tid`), CONSTRAINT `fktid` FOREIGN KEY (`tid`) REFERENCES `teacher` (`id`) ) ENGINE=INNODB DEFAULT CHARSET=UTF8MB4; INSERT INTO `student` (`id`, `name`, `tid`) VALUES ('1', '小明', '1'); INSERT INTO `student` (`id`, `name`, `tid`) VALUES ('2', '小红', '1'); INSERT INTO `student` (`id`, `name`, `tid`) VALUES ('3', '小张', '1'); INSERT INTO `student` (`id`, `name`, `tid`) VALUES ('4', '小李', '1'); INSERT INTO `student` (`id`, `name`, `tid`) VALUES ('5', '小王', '1');
博客表
CREATE TABLE `blog`( `id` VARCHAR(50) NOT NULL COMMENT '博客ID', `title` VARCHAR(100) NOT NULL COMMENT '博客标题', `auther` VARCHAR(30) NOT NULL COMMENT '博客作者', `creat_time` DATETIME NOT NULL COMMENT '创建时间', `views` INT(30) NOT NULL COMMENT '浏览量' )ENGINE=INNODB DEFAULT CHARSET=UTF8MB4
标签:INSERT,name,DEFAULT,id,SSM,tid,Mybatis,NULL,Example From: https://www.cnblogs.com/zjfun/p/17546555.html