题库Mysql表设计案例
题库中单选题表设计:
CREATE TABLE IF NOT EXISTS `des_study_item_1` (
`tid` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT ‘单选试题ID号’,
`uid` int(11) NOT NULL DEFAULT ‘1’,
`title` text NOT NULL COMMENT ‘试题标题’,
`cat_id` tinyint(2) NOT NULL DEFAULT ‘1’ COMMENT ‘题型的分类ID, 固定1’,
`item_content` text NOT NULL COMMENT ‘试题内容’,
`daan` varchar(500) DEFAULT NULL,
`fenxi` varchar(1000) DEFAULT NULL COMMENT ‘试题分析’,
`jieda` text NOT NULL COMMENT ‘试题解答’,
`fen` int(2) NOT NULL DEFAULT ‘0’ COMMENT ‘试题分值’,
`title_image` varchar(200) DEFAULT NULL,
`comments` varchar(1000) DEFAULT NULL COMMENT ‘点评’,
`image` varchar(255) DEFAULT ” COMMENT ‘是否有图片’,
`class_id` tinyint(2) NOT NULL DEFAULT ‘0’ COMMENT ‘年级分类ID’,
`course_id` tinyint(2) NOT NULL DEFAULT ‘0’ COMMENT ‘课程分类ID’,
`difficulty` tinyint(1) NOT NULL DEFAULT ‘3’ COMMENT ‘试题难度1:较易,2:容易,3:普通,4:难,5:较难’,
`is_bikao` tinyint(1) NOT NULL DEFAULT ‘1’ COMMENT ‘是否为必考题型1:必考,2:普通,3:两者都可’,
`is_open` tinyint(1) NOT NULL DEFAULT ‘0’,
`kid` varchar(100) NOT NULL COMMENT ‘章节ID号,多个用;格开’,
`zid` varchar(500) NOT NULL DEFAULT ”,
`time` int(11) unsigned NOT NULL DEFAULT ‘0’ COMMENT ‘试题录入时间’,
`is_check` int(1) DEFAULT ‘0’ COMMENT ‘0为未审核,1审核通过’,
PRIMARY KEY (`tid`),
KEY `class_id` (`class_id`),
KEY `course_id` (`course_id`),
KEY `difficulty` (`difficulty`),
KEY `cat_id` (`cat_id`),
KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=’单选题数据表’ AUTO_INCREMENT=1000000;
题库附属表设计:
CREATE TABLE IF NOT EXISTS `des_study_know_union_item` (
`uid` int(11) NOT NULL DEFAULT ‘0’ COMMENT ‘用户ID号’,
`zid_1` int(11) DEFAULT ‘0’,
`zid_2` int(11) DEFAULT ‘0’,
`zid_3` int(11) DEFAULT ‘0’,
`zid_4` int(11) DEFAULT ‘0’,
`tid` int(11) unsigned NOT NULL COMMENT ‘试题ID号’,
`table_id` int(2) NOT NULL DEFAULT ‘0’ COMMENT ‘对应的试题表名数字 1,2,3,4,5’,
`is_open` tinyint(1) DEFAULT ‘0’,
`ext` varchar(100) NOT NULL DEFAULT ” COMMENT ‘备注’,
`diffic` tinyint(1) DEFAULT ‘3’ COMMENT ‘难易度’,
`views` mediumint(8) DEFAULT ‘0’ COMMENT ‘查看计数’,
`downloads` mediumint(8) DEFAULT ‘0’ COMMENT ‘下载计数’,
`is_check` int(1) DEFAULT ‘0’ COMMENT ‘0为未审核,1审核通过’,
`price` decimal(3,1) DEFAULT ‘0.0’ COMMENT ‘价格’,
`vip` int(1) DEFAULT ‘0’ COMMENT ‘是否vip标识,1为是’,
`favorite` int(11) DEFAULT ‘0’ COMMENT ‘试题收藏数’,
`model` varchar(15) DEFAULT ‘0’ COMMENT ‘多个类型用|线分开,中考题(23),常考题(22),易错题(21),好题(20)’,
`rgf_file` varchar(255) DEFAULT ‘0’ COMMENT ‘rgf文件地址’,
`buycount` mediumint(8) DEFAULT ‘0’,
`tixing` int(2) DEFAULT ‘0’ COMMENT ‘试卷类型1:同步练习,2:单元测验,3:专题检测,4:月考试题,5:仿真模拟,6:期中期末,7:竞赛相关,8:高考相关,9:中考相关’,
`chapter_1` int(10) DEFAULT ‘0’ COMMENT ‘单元’,
`chapter_2` int(10) DEFAULT ‘0’ COMMENT ‘章节’,
KEY `tid` (`tid`),
KEY `table_id` (`table_id`),
KEY `zid_1` (`zid_1`),
KEY `zid_2` (`zid_2`),
KEY `chapter_1` (`chapter_1`),
KEY `chapter_2` (`chapter_2`),
KEY `uid` (`uid`),
KEY `tixing` (`tixing`),
KEY `zid_3` (`zid_3`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=’试题关联单元章节数据表’;
需要mysql数据库格式中小学题库请联系QQ1090930740,销售地址:http://www.xuekubao.com/tiku/