当前位置:网站首页>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
边栏推荐
- Understanding of MQ
- MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
- Applet payment
- Three web components (servlet, filter, listener)
- laravel编写Console脚本
- qt 64位静态版本显示gif
- 详解MySQL中timestamp和datetime时区问题导致做DTS遇到的坑
- 年度最尴尬的社死瞬间,是Siri给的
- Usage of rename in cygwin
- tensorflow常用的函数
猜你喜欢
Tensorflow使用keras创建神经网络的方法
Promise details
Interpretation of 2022 robot education industry analysis report
创客教育中的统筹方案管理模式
PDMS软光刻加工过程
Study notes of C [8] SQL [1]
MQ在laravel中简单使用
qt 64位静态版本显示gif
年度最尴尬的社死瞬间,是Siri给的
After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
随机推荐
The way to change children's programming structure
MySQL interview questions explain how to set hash index
简易投票系统数据库设计
积极参与中学机器人竞赛的意义
Implementation of inserting millions of data into MySQL database in 10 seconds
R-drop: a more powerful dropout regularization method
Interprocess communication -- message queue
QT信号量 无法解析的错误的总结
Interpretation of 2022 robot education industry analysis report
nacos基础(6):nacos配置管理模型
Promise details
VM set up static virtual machine
My creation anniversary
MQ在laravel中简单使用
Nacos Foundation (6): Nacos configuration management model
Who said you should know PS? This open-source artifact can also be pulled in batch, and the effect is outstanding!
rebbitMQ的简单搭建
Learning go language 0x08: practice using error in go language journey
解读机器人编程课程的生物认知度
Mysql中一千万条数据怎么快速查询