-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathe100scores.sql
110 lines (90 loc) · 3.38 KB
/
e100scores.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2016-05-05 14:30:12
-- 服务器版本: 5.6.17
-- PHP Version: 5.5.12
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 utf8 */;
--
-- Database: `e100scores`
--
-- --------------------------------------------------------
--
-- 表的结构 `course`
--
CREATE TABLE IF NOT EXISTS `course` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`alias` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `alias` (`alias`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `question`
--
CREATE TABLE IF NOT EXISTS `question` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`bank_id` int(11) NOT NULL,
`number` int(11) NOT NULL COMMENT '题号',
`title` text COLLATE utf8_unicode_ci NOT NULL,
`type` int(5) NOT NULL DEFAULT '0',
`options` text COLLATE utf8_unicode_ci NOT NULL COMMENT '用json存储,每个包括选项和正确与否',
`point` int(11) DEFAULT NULL COMMENT '分值',
`analysis` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `bank_id` (`bank_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `question_bank`
--
CREATE TABLE IF NOT EXISTS `question_bank` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`course_id` int(11) NOT NULL,
`name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`alias` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`priority` int(11) DEFAULT '0',
`publish` tinyint(1) DEFAULT '0',
`amount` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `alias_2` (`alias`),
KEY `course_id` (`course_id`),
KEY `course_id_2` (`course_id`),
KEY `alias` (`alias`),
KEY `priority` (`priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `result`
--
CREATE TABLE IF NOT EXISTS `result` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`bank_id` int(11) NOT NULL,
`answer` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'json存储,包括答案及对错',
`completed` int(11) NOT NULL DEFAULT '0' COMMENT '已完成题数',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `open_id` (`user_id`,`bank_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`register_time` datetime NOT NULL COMMENT '注册时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!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 */;