当前位置:网站首页>简易投票系统数据库设计
简易投票系统数据库设计
2022-04-23 11:24:00 【BreezAm】
介绍
简易版的投票系统数据库设计.
发现设计有误请在评论区指出,谢谢!

一、截图
项目表

选项表

投票表

二、代码
票表
CREATE TABLE `as_ticket` (
`id` varchar(64) NOT NULL COMMENT '主键',
`title` varchar(100) DEFAULT NULL COMMENT '投票标题',
`description` text COMMENT '描述',
`rate` int(11) DEFAULT '1' COMMENT '每人每天可投票的次数:-1表示无限制',
`multi` int(11) NOT NULL DEFAULT '0' COMMENT '支持多选:1支持、0不支持',
`min` int(11) NOT NULL DEFAULT '1' COMMENT '多选模式下:最少选择个数,默认:1个',
`max` int(11) NOT NULL DEFAULT '4' COMMENT '多选模式下:最多选择个数,默认:无限制',
`anonymous` int(11) NOT NULL DEFAULT '1' COMMENT '1:匿名、0:不匿名',
`img_url` varchar(255) DEFAULT NULL COMMENT '图片地址',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`update_by` varchar(255) DEFAULT NULL COMMENT '修改者',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始日期',
`end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '截止日期',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
票选项表
CREATE TABLE `as_ticket_option` (
`id` varchar(64) NOT NULL COMMENT '主键',
`vote_id` varchar(64) DEFAULT NULL COMMENT '所属票ID',
`name` varchar(100) DEFAULT NULL COMMENT '选项名称',
`description` text COMMENT '描述',
`img_url` varchar(255) DEFAULT NULL COMMENT '图片地址',
`num` int(11) DEFAULT NULL COMMENT '被投数量',
`update_by` varchar(255) DEFAULT NULL COMMENT '更新时间',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
投票表
CREATE TABLE `as_vote` (
`id` varchar(64) NOT NULL COMMENT '投票的ID',
`username` varchar(64) DEFAULT NULL COMMENT '投票人:用户名、IP地址、未知',
`option_id` varchar(64) DEFAULT NULL COMMENT '所投的选项',
`vote_id` varchar(64) DEFAULT NULL COMMENT '所投的票',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
版权声明
本文为[BreezAm]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_43073558/article/details/120477841
边栏推荐
- Usage of rename in cygwin
- After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
- 小程序 支付
- 学习 Go 语言 0x03:理解变量之间的依赖以及初始化顺序
- Get things technology network optimization - CDN resource request Optimization Practice
- 解决由于找不到amd_ags_x64.dll,无法继续执行代码。重新安装程序可能会解决此问题,地平线(Forza Horizon 5)
- 解读机器人创造出来的艺术
- Learn go language 0x05: the exercise code of map in go language journey
- 学习 Go 语言 0x07:《Go 语言之旅》中 Stringer 练习题代码
- Learning go language 0x01: start from the official website
猜你喜欢

Redis optimization series (II) redis master-slave principle and master-slave common configuration

进程间通信 -- 消息队列

Interprocess communication -- message queue

实践数据湖iceberg 第三十课 mysql->iceberg,不同客户端有时区问题

Jupyter lab top ten high productivity plug-ins

laravel编写Console脚本

redis优化系列(二)Redis主从原理、主从常用配置

The songbird document editor will be open source: starting with but not limited to markdown

初探 Lambda Powertools TypeScript

qt5. 8. You want to use SQLite in the 64 bit static library, but the static library has no method to compile the supporting library
随机推荐
分享两个实用的shell脚本
Difference between pregnancy box and delivery box
Database management software sqlpro for SQLite for Mac 2022.30
MySQL failed to insert the datetime type field without single quotation marks
MySQL8.0升级的踩坑历险记
小程序 支付
GPU, CUDA,cuDNN三者的关系总结
@Valid, @ validated learning notes
MySQL索引优化之分页探索详细介绍
MySQL interview questions explain how to set hash index
Usage of rename in cygwin
活动进行时! 点击链接加入直播间参与“AI真的能节能吗?”的讨论吧!
MySQL对数据表已有表进行分区表的实现
Mysql database transaction example tutorial
Redis optimization series (II) redis master-slave principle and master-slave common configuration
Study notes of C [8] SQL [1]
nacos基础(5):nacos配置入门
Understanding of MQ
PDMS soft lithography process
Facing the global market, platefarm today logs in to four major global platforms such as Huobi