MySQL 建表
Posted qiqideya
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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‘, ‘[email protected]‘, ‘123123‘, ‘123213‘), (‘2‘, ‘李四‘, ‘0‘, ‘lisi‘, ‘[email protected]‘, ‘123213‘, ‘1232‘);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
以上是关于MySQL 建表的主要内容,如果未能解决你的问题,请参考以下文章