text: -- phpMyAdmin SQL Dump
  -- version 4.5.2
  -- http://www.phpmyadmin.net
  --
  -- Host: 127.0.0.1
  -- Generation Time: 2018-07-27 05:54:38
  -- 服务器版本： 5.7.9
  -- PHP Version: 5.6.16
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Database: `test`
  --
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `admin`
  --
  
  DROP TABLE IF EXISTS `admin`;
  CREATE TABLE IF NOT EXISTS `admin` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `password` varchar(200) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  --
  -- 转存表中的数据 `admin`
  --
  
  INSERT INTO `admin` (`id`, `name`, `password`) VALUES
  (1, 'admin', '202cb962ac59075b964b07152d234b70');
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `department`
  --
  
  DROP TABLE IF EXISTS `department`;
  CREATE TABLE IF NOT EXISTS `department` (
    `did` int(11) NOT NULL AUTO_INCREMENT,
    `department` varchar(200) NOT NULL,
    PRIMARY KEY (`did`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  
  --
  -- 转存表中的数据 `department`
  --
  
  INSERT INTO `department` (`did`, `department`) VALUES
  (1, 'PHP部门'),
  (2, 'JAVA部门'),
  (3, '大数据部门');
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `hobby`
  --
  
  DROP TABLE IF EXISTS `hobby`;
  CREATE TABLE IF NOT EXISTS `hobby` (
    `hid` int(11) NOT NULL AUTO_INCREMENT,
    `hobby` varchar(50) NOT NULL,
    PRIMARY KEY (`hid`)
  ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  
  --
  -- 转存表中的数据 `hobby`
  --
  
  INSERT INTO `hobby` (`hid`, `hobby`) VALUES
  (1, '跑步'),
  (2, '游泳'),
  (3, '骑行'),
  (4, '编程'),
  (5, '游戏');
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `role`
  --
  
  DROP TABLE IF EXISTS `role`;
  CREATE TABLE IF NOT EXISTS `role` (
    `rid` int(11) NOT NULL AUTO_INCREMENT,
    `rolename` varchar(100) NOT NULL,
    PRIMARY KEY (`rid`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
  
  --
  -- 转存表中的数据 `role`
  --
  
  INSERT INTO `role` (`rid`, `rolename`) VALUES
  (1, '组长'),
  (2, '队长');
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `user`
  --
  
  DROP TABLE IF EXISTS `user`;
  CREATE TABLE IF NOT EXISTS `user` (
    `uid` int(11) NOT NULL AUTO_INCREMENT,
    `uname` varchar(50) NOT NULL,
    `password` varchar(200) NOT NULL,
    `did` int(11) NOT NULL,
    `rid` int(11) NOT NULL,
    `hobby` varchar(200) NOT NULL,
    `create_at` datetime NOT NULL,
    `update_at` datetime NOT NULL,
    `delete_time` datetime DEFAULT NULL,
    PRIMARY KEY (`uid`),
    KEY `department` (`did`),
    KEY `role` (`rid`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  
  --
  -- 转存表中的数据 `user`
  --
  
  INSERT INTO `user` (`uid`, `uname`, `password`, `did`, `rid`, `hobby`, `create_at`, `update_at`, `delete_time`) VALUES
  (1, 'lee', '202cb962ac59075b964b07152d234b70', 2, 2, '1,2', '2018-07-26 00:00:00', '2018-07-26 00:00:00', NULL),
  (2, 'sam', '202cb962ac59075b964b07152d234b70', 3, 1, '3,4', '2018-07-26 00:00:00', '2018-07-26 00:00:00', NULL),
  (3, '波比', '12312312', 1, 2, '1,2,5', '2018-07-26 00:00:00', '2018-07-26 00:00:00', NULL);
  
  --
  -- 限制导出的表
  --
  
  --
  -- 限制表 `user`
  --
  ALTER TABLE `user`
    ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`did`) REFERENCES `department` (`did`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `user_ibfk_2` FOREIGN KEY (`rid`) REFERENCES `role` (`rid`);
  
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  