当前位置:网站首页>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
边栏推荐
- Link sorting of tutorials such as assembly language running environment setting
- PDMS软光刻加工过程
- Nacos Foundation (7): Configuration Management
- Explain in detail the pitfalls encountered in DTS due to the time zone problems of timestamp and datetime in MySQL
- 解析社交性机器人对基础科学的作用
- Tensorflow使用keras创建神经网络的方法
- Redis optimization series (II) redis master-slave principle and master-slave common configuration
- Applet payment
- golang之笔试题&面试题01
- Promise details
猜你喜欢

GPU, CUDA,cuDNN三者的关系总结

MQ的了解

Nacos Foundation (7): Configuration Management

RebbitMQ的初步了解

Summary of the relationship among GPU, CUDA and cudnn

VM set up static virtual machine

Laravel绑定钉钉群警报(php)

Advanced file IO of system programming (13) -- IO multiplexing - Select

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

Nacos Foundation (6): Nacos configuration management model
随机推荐
Detailed explanation of integer data type tinyint in MySQL
@Valid, @ validated learning notes
How does QT turn qwigdet into qdialog
Laravel always returns JSON response
When the activity is in progress! Click the link to join the live studio to participate in "can AI really save energy?" Let's have a discussion!
Learn go language 0x06: Fibonacci closure exercise code in go language journey
Nacos Foundation (8): login management
Learning go language 0x02: understanding slice
Analyze the rules for the use of robots with good performance
Detailed explanation of how to smoothly go online after MySQL table splitting
AcWing 1874. Moo encryption (enumeration, hash)
Structure of C language (Advanced)
nacos基础(7):配置管理
Redis optimization series (II) redis master-slave principle and master-slave common configuration
redis优化系列(二)Redis主从原理、主从常用配置
Compress the curl library into a sending string of utf8 and send it with curl library
Pytorch neural network trainer
nacos基础(5):nacos配置入门
用curl库压缩成发送字符串为utf8并用curl库发送
解析幼儿教育中steam教育的融合