导入学习用的数据库

阅读量: 531 编辑

导入学习用的数据库

这个系列Wiki中的所有表的操作都来自于下方的SQL,大家可以将此SQL导入到自己数据库中,然后学习后面的SQL的基本操作

/*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50525
Source Host           : 127.0.0.1:3306
Source Database       : learnmysql

Target Server Type    : MYSQL
Target Server Version : 50525
File Encoding         : 65001

Date: 2021-09-26 23:04:37
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for classify
-- ----------------------------
DROP TABLE IF EXISTS `classify`;
CREATE TABLE `classify` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL DEFAULT '' COMMENT '名称',
  `code` varchar(50) NOT NULL DEFAULT '',
  `parent_code` varchar(50) NOT NULL DEFAULT '0' COMMENT '父级别code',
  `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
  `createAt` datetime DEFAULT NULL,
  `updateAt` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8 COMMENT='课程类别表';

-- ----------------------------
-- Records of classify
-- ----------------------------
INSERT INTO `classify` VALUES ('43', '设计创意', 'shejichuangyi', '0', '47', '2021-04-25 17:21:45', '2021-04-25 17:21:45');
INSERT INTO `classify` VALUES ('44', '编程开发', 'bianchengkaifa', '0', '44', '2021-04-25 17:44:13', '2021-04-25 17:44:13');
INSERT INTO `classify` VALUES ('45', '职场提升', 'zhichangtisheng', '0', '43', '2021-04-25 17:44:34', '2021-04-25 17:44:34');
INSERT INTO `classify` VALUES ('46', '电商营销', 'dianshangyingxiao', '0', '45', '2021-04-25 17:45:00', '2021-04-25 17:45:00');
INSERT INTO `classify` VALUES ('47', '职业考试', 'zhiyekaoshi', '0', '46', '2021-04-25 17:23:16', '2021-04-25 17:23:16');
INSERT INTO `classify` VALUES ('48', '兴趣技能', 'xingqujineng', '0', '50', '2021-04-25 17:23:40', '2021-04-25 17:23:40');
INSERT INTO `classify` VALUES ('49', '大学考试', 'daxuekaoshi', '0', '49', '2021-04-25 17:23:50', '2021-04-25 17:23:50');
INSERT INTO `classify` VALUES ('50', '产品运营', 'chanpinyunying', '0', '48', '2021-04-25 17:24:39', '2021-04-25 17:24:39');
INSERT INTO `classify` VALUES ('51', '语言学习', 'yuyanxuexi', '0', '51', '2021-04-25 17:24:58', '2021-04-25 17:24:58');
INSERT INTO `classify` VALUES ('52', '手绘插画', 'shouhuichahua', 'shejichuangyi', '52', '2021-04-25 17:25:47', '2021-04-25 17:25:47');
INSERT INTO `classify` VALUES ('53', '视频制作', 'shipinzhizuo', 'shejichuangyi', '53', '2021-04-25 17:26:17', '2021-04-25 17:26:17');
INSERT INTO `classify` VALUES ('54', '摄影修片', 'sheyingxiupian', 'shejichuangyi', '54', '2021-04-25 17:26:47', '2021-04-25 17:26:47');
INSERT INTO `classify` VALUES ('55', '平面设计', 'pingmiansheji', 'shejichuangyi', '55', '2021-04-25 17:27:08', '2021-04-25 17:27:08');
INSERT INTO `classify` VALUES ('56', '电商美工', 'dianshangmeigong', 'shejichuangyi', '56', '2021-04-25 17:27:23', '2021-04-25 17:27:23');
INSERT INTO `classify` VALUES ('57', '热门软件', 'remenruanjian', 'shejichuangyi', '57', '2021-04-25 17:27:47', '2021-04-25 17:27:47');
INSERT INTO `classify` VALUES ('58', '职场英语', 'zhichangyingyu', 'yuyanxuexi', '58', '2021-04-25 17:28:33', '2021-04-25 17:28:33');
INSERT INTO `classify` VALUES ('59', '英语考试', 'yingyukaoshi', 'yuyanxuexi', '59', '2021-04-25 17:28:44', '2021-04-25 17:28:44');
INSERT INTO `classify` VALUES ('60', '生活英语', 'shenghuoyingyu', 'yuyanxuexi', '60', '2021-04-25 17:28:58', '2021-04-25 17:28:58');

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '课程名称',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '课程类型:0-录播课;1-直播课',
  `classify` varchar(50) NOT NULL DEFAULT '' COMMENT '课程分类',
  `sub_classify` varchar(50) NOT NULL DEFAULT '' COMMENT '课程二级分类',
  `level` tinyint(1) NOT NULL DEFAULT '1' COMMENT '课程级别:1-初级,2-中级,3-高级',
  `free` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否免费:0-否,1-是',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '课程价格',
  `time` varchar(50) NOT NULL DEFAULT '' COMMENT '时长',
  `onsale` tinyint(1) NOT NULL DEFAULT '0' COMMENT '未上架(0)、上架(1)',
  `brief` text COMMENT '课程描述',
  `recommend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '未推荐(0)、推荐(1)',
  `weight` int(11) NOT NULL DEFAULT '0' COMMENT '权重',
  `study_count` int(11) NOT NULL DEFAULT '0' COMMENT '学习人数',
  `livetime` varchar(100) DEFAULT NULL,
  `createAt` datetime DEFAULT NULL,
  `updateAt` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8 COMMENT='课程表';

-- ----------------------------
-- Records of course
-- ----------------------------
INSERT INTO `course` VALUES ('2', '3D建模/3DMAX MAYA ZBrush零基础建模/角色/场景', '0', 'shejichuangyi', 'shipinzhizuo', '1', '1', '0.00', '1小时0分', '1', '3D建模/3DMAX MAYA ZBrush零基础建模/角色/场景', '0', '0', '1300', '', '1900-01-01 12:10:00', '2021-04-13 15:48:01');
INSERT INTO `course` VALUES ('3', 'Java实战课程算法分析与设计', '0', 'bianchengkaifa', 'java1', '2', '0', '99.00', '1小时0分', '1', 'Java实战课程算法分析与设计', '0', '0', '1452', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('4', '产品经理训练营,30天成为产品大神', '0', 'chanpinyunying', 'chanpinjingli', '2', '1', '199.00', '1小时0分', '1', '产品经理训练营,30天成为产品大神', '0', '0', '1452', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('5', 'ps板绘商业插画/插画设计/插画/板绘/手绘/CG插画/设计', '0', 'xingqujineng', 'shipjianji', '1', '1', '0.00', '1小时0分', '1', 'ps板绘商业插画/插画设计/插画/板绘/手绘/CG插画/设计', '0', '100', '1452', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('6', '金三银四面试突击-Java性能调优', '0', 'bianchengkaifa', 'java2', '2', '0', '100.00', '1小时0分', '1', '金三银四面试突击-Java性能调优', '0', '0', '2000', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('7', '大数据分析就业指北', '0', 'bianchengkaifa', 'dashuju', '1', '0', '89.00', '1小时0分', '1', '大数据分析就业指北', '0', '0', '1452', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('8', '电商美工实战课程,好就业', '0', 'chanpinyunying', 'chanpinjiaohusheji', '3', '1', '0.00', '1小时0分', '1', '电商美工实战课程,好就业', '0', '2', '1452', '2021-04-26 18:20:32', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('9', '学手机摄影,拍出国际大片', '0', 'shejichuangyi', 'sheyingxiupian', '3', '1', '0.00', '1小时0分', '1', '学手机摄影,拍出国际大片', '0', '110', '1300', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('10', 'Python基础编程', '0', 'bianchengkaifa', 'python0', '1', '1', '0.00', '1小时0分', '1', 'Python基础编程', '0', '3', '3000', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('11', '法语小语种30天训练营', '0', 'daxuekaoshi', 'kaoyan', '2', '1', '0.00', '1小时0分', '1', '法语小语种30天训练营', '0', '0', '1552', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');
INSERT INTO `course` VALUES ('12', 'Linux零基础入门,玩转服务器', '0', 'daxuekaoshi', 'jisuanjierji', '1', '1', '0.00', '1小时0分', '1', 'Linux零基础入门,玩转服务器', '0', '5', '1300', '', '1900-01-01 12:10:00', '2017-05-06 16:12:35');

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `realname` varchar(50) DEFAULT '' COMMENT '登录用户名',
  `username` varchar(50) NOT NULL DEFAULT '' COMMENT '真实姓名',
  `password` varchar(100) NOT NULL DEFAULT '' COMMENT '密码',
  `gender` tinyint(1) DEFAULT '1' COMMENT '性别',
  `header` varchar(512) DEFAULT '' COMMENT '头像',
  `mobile` varchar(15) DEFAULT '' COMMENT '手机号码',
  `status` tinyint(1) NOT NULL DEFAULT '2' COMMENT '状态:待审核(0),有效(1),无效(3)',
  `birthday` date DEFAULT '1900-01-01',
  `education` varchar(50) DEFAULT '' COMMENT '学历:大专、本科、硕士、博士、博士后',
  `createAt` datetime DEFAULT NULL,
  `updateAt` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `T_AUTH_USER_USERNAME_UNIQUE` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES ('1', '王阳明', 'wangyangming', '96E79218965EB72C92A549DD5A330112', '0', '', '18001584130', '2', '1900-01-01', '博士后', '1900-01-01 12:10:00', '2021-04-13 19:55:42');
INSERT INTO `student` VALUES ('2', '李四', 'lisi', '96E79218965EB72C92A549DD5A330112', '1', '', '18001584131', '0', '1900-01-01', '本科', '1900-01-01 12:10:00', '2017-03-27 22:28:21');
INSERT INTO `student` VALUES ('3', '赵六', 'zhaoliu', '96E79218965EB72C92A549DD5A330112', '1', '', '18001584132', '2', '1900-01-01', '本科', '1900-01-01 12:10:00', '2017-03-27 22:28:21');
INSERT INTO `student` VALUES ('4', '张三', 'zhangsan', 'facaaf91b6a5e81a21099d6a8b5a0fdf1ec224e7b7caa82aceee442d4bea9c9d', '1', '', '', '2', '1900-01-01', '', '2021-04-16 00:00:00', '2021-04-16 12:17:37');
INSERT INTO `student` VALUES ('5', '祁聪', 'admin', 'fc07872c52586b8454c91318618728407b9edecc23329552aba61ba644334ebd', '1', '', '18001584138', '2', '1900-01-01', '本科', '2021-04-16 00:00:00', '2021-04-16 00:00:00');
INSERT INTO `student` VALUES ('6', '王五', 'wangwu', '73976582557d382a57ab0c97a721fb6f5913b99e0c9064990a07ecc77e013f64', '1', '', '', '2', '1900-01-01', '', '2021-04-17 00:00:00', '2021-04-17 20:33:12');