首页 > 代码库 > MySQL 建表

MySQL 建表

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `yunzhi_teacher`
-- ----------------------------
DROP TABLE IF EXISTS `yunzhi_teacher`;
CREATE TABLE `yunzhi_teacher` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT ‘‘ COMMENT ‘姓名‘,
  `sex` tinyint(1) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘0男,1女‘,
  `username` varchar(16) NOT NULL COMMENT ‘用户名‘,
  `email` varchar(30) DEFAULT ‘‘ COMMENT ‘邮箱‘,
  `create_time` int(11) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘创建时间‘,
  `update_time` int(11) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘更新时间‘,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `yunzhi_teacher`
-- ----------------------------
BEGIN;
INSERT INTO `yunzhi_teacher` VALUES (‘1‘, ‘张三‘, ‘0‘, ‘zhangsan‘, ‘zhangsan@mail.com‘, ‘123123‘, ‘123213‘), (‘2‘, ‘李四‘, ‘0‘, ‘lisi‘, ‘lisi@yunzhi.club‘, ‘123213‘, ‘1232‘);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;

MySQL 建表