当前位置:网站首页>Database design of simple voting system
Database design of simple voting system
2022-04-23 11:27:00 【BreezAm】
Introduce
Database design of simple voting system .
If you find any mistakes in the design, please point them out in the comment area , thank you !

One 、 Screenshot
Project table

List of options

The ballot form

Two 、 Code
Ticket list
CREATE TABLE `as_ticket` (
`id` varchar(64) NOT NULL COMMENT ' Primary key ',
`title` varchar(100) DEFAULT NULL COMMENT ' The title of the vote ',
`description` text COMMENT ' describe ',
`rate` int(11) DEFAULT '1' COMMENT ' Number of votes per person per day :-1 Means unlimited ',
`multi` int(11) NOT NULL DEFAULT '0' COMMENT ' Support multiple choices :1 Support 、0 I won't support it ',
`min` int(11) NOT NULL DEFAULT '1' COMMENT ' In multi-select mode : Minimum number of choices , Default :1 individual ',
`max` int(11) NOT NULL DEFAULT '4' COMMENT ' In multi-select mode : Maximum number of choices , Default : unlimited ',
`anonymous` int(11) NOT NULL DEFAULT '1' COMMENT '1: anonymous 、0: Not anonymous ',
`img_url` varchar(255) DEFAULT NULL COMMENT ' Picture address ',
`create_by` varchar(255) DEFAULT NULL COMMENT ' The creator ',
`remark` varchar(255) DEFAULT NULL COMMENT ' remarks ',
`update_by` varchar(255) DEFAULT NULL COMMENT ' Reviser ',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' Update time ',
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' Start date ',
`end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' Closing date ',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' Creation time ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Ticket option table
CREATE TABLE `as_ticket_option` (
`id` varchar(64) NOT NULL COMMENT ' Primary key ',
`vote_id` varchar(64) DEFAULT NULL COMMENT ' The ticket belongs to ID',
`name` varchar(100) DEFAULT NULL COMMENT ' Option name ',
`description` text COMMENT ' describe ',
`img_url` varchar(255) DEFAULT NULL COMMENT ' Picture address ',
`num` int(11) DEFAULT NULL COMMENT ' Number of people voted ',
`update_by` varchar(255) DEFAULT NULL COMMENT ' Update time ',
`create_by` varchar(255) DEFAULT NULL COMMENT ' The creator ',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' Creation time ',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ' Update time ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
The ballot form
CREATE TABLE `as_vote` (
`id` varchar(64) NOT NULL COMMENT ' Voted ID',
`username` varchar(64) DEFAULT NULL COMMENT ' Voters : user name 、IP Address 、 Unknown ',
`option_id` varchar(64) DEFAULT NULL COMMENT ' The options cast ',
`vote_id` varchar(64) DEFAULT NULL COMMENT ' The votes cast ',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
版权声明
本文为[BreezAm]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231124085042.html
边栏推荐
- Explain in detail the pitfalls encountered in DTS due to the time zone problems of timestamp and datetime in MySQL
- On the integration of steam education in early childhood education
- 分享两个实用的shell脚本
- Advanced file IO of system programming (13) -- IO multiplexing - Select
- GPU, CUDA,cuDNN三者的關系總結
- 微型机器人的认知和研发技术
- mysql分表之后如何平滑上线详解
- 详解MySQL中timestamp和datetime时区问题导致做DTS遇到的坑
- 实践数据湖iceberg 第三十课 mysql->iceberg,不同客户端有时区问题
- Oracle连通性测试小工具
猜你喜欢

MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题

On lambda powertools typescript

Redis学习之五---高并发分布式锁实战

解读2022机器人教育产业分析报告

怎么进行固定资产盘点,资产盘点报告如何一键生成

laravel编写Console脚本

nacos基础(7):配置管理

微型机器人的认知和研发技术

解决由于找不到amd_ags_x64.dll,无法继续执行代码。重新安装程序可能会解决此问题,地平线(Forza Horizon 5)

On the integration of steam education in early childhood education
随机推荐
MySQL failed to insert the datetime type field without single quotation marks
TclError: no display name and no $DISPLAY environment variable
用curl库压缩成发送字符串为utf8并用curl库发送
谁说抠图要会 PS?这个开源神器还能批量抠,效果拔群!
laravel-admin表单验证
Nacos Foundation (7): Configuration Management
R-drop: a more powerful dropout regularization method
map<QString, bool> 的使用记录
mysql插入datetime类型字段不加单引号插入不成功
升级cpolar内网穿透能获得的功能
解读机器人创造出来的艺术
Mysql database transaction example tutorial
Learn go language 0x05: the exercise code of map in go language journey
Learning go language 0x02: understanding slice
Learn go language 0x06: Fibonacci closure exercise code in go language journey
解读机器人编程课程的生物认知度
Significance of actively participating in middle school robot competition
Golang Pen & interview 01
讯飞2021年营收183亿:同比增41% 净利为15.56亿
On lambda powertools typescript