Voter Registration Database Structure (MariaDB)

by matt392 in Circuits > Software

108 Views, 1 Favorites, 0 Comments

Voter Registration Database Structure (MariaDB)

Graphic-Table-Structure.png

A voter registration database designed for counties with smaller populations. Created using MX Linux, Firefox, MariaDB, Apache2, PHP and phpMyAdmin.

Files include SQL (change extension to ".sql"), OpenDocument Spreadsheet (change extension to ".ods"), CodeGen (change extension to ".cs), HTML (change extension to ".html"), Texty, Word, OpenDocument Text, Excel, and CSV (comma separated value).

The final field will allow the database administrator to upload a picture of the voter's signature. This field will only work when importing the SQL file into phpMyAdmin since it is a Blob type. If using this field, please be sure that the picture is less than 64 KB. An easy way to get a picture this size is to reduce the resolution of the smartphone camera to 800x600 and then tightly crop the final picture.

The SQL file is below and attached.

-- phpMyAdmin SQL Dump
-- version 5.0.4deb1~bpo10+1
-- https://www.phpmyadmin.net/


--
-- Host: localhost:3306
-- Generation Time: Jan 29, 2021 at 03:39 AM
-- Server version: 10.3.27-MariaDB-0+deb10u1
-- PHP Version: 7.3.19-1~deb10u1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `Voter Registration Database`
--

-- --------------------------------------------------------

--
-- Table structure for table `Voter Information`
--

CREATE TABLE `Voter Information` (
`Voter Number` int(11) NOT NULL COMMENT 'Max value is 2,147,483,648\r\nUnique field!',
`Driver's License Number/State ID` varchar(50) NOT NULL COMMENT 'Maximum length is 50 characters\r\nUnique field!',
`Social Security Number` varchar(11) NOT NULL DEFAULT '111-22-3333' COMMENT 'Varchar can be fully indexed\r\nUnique field!',
`First Name` varchar(100) NOT NULL DEFAULT 'Enter First Name!' COMMENT 'Maximum length is 100 characters',
`Last Name` varchar(100) NOT NULL DEFAULT 'Enter Last Name!' COMMENT 'Maximum length is 100 characters',
`Street Address` varchar(100) NOT NULL DEFAULT 'Enter Street here!' COMMENT 'Maximum number of characters is 100',
`Apt/Suite/Floor` varchar(25) NOT NULL DEFAULT 'Enter apt/suite/floor!' COMMENT 'Maximum number of characters is 25',
`City` varchar(25) NOT NULL DEFAULT 'Enter State Here!' COMMENT 'Maximum number of characters is 25',
`State` varchar(25) NOT NULL DEFAULT 'Enter State Here!' COMMENT 'Maximum 25 characters',
`Zip Code` varchar(15) NOT NULL DEFAULT 'Enter Zip Code' COMMENT 'Maximum number of characters is 15.',
`Politcal Party` varchar(50) NOT NULL DEFAULT 'Democrat/Republican/Democratic Socialist, etc.' COMMENT 'Maximum number of characters is 50!',
`City/Town Council District` varchar(50) NOT NULL DEFAULT 'Enter City Council District!' COMMENT 'Maximum number of characters is 50!',
`State Assembly District` varchar(50) NOT NULL DEFAULT 'Enter state assembly district' COMMENT 'Maximum number of characters is 50!',
`State Senate District` varchar(50) NOT NULL DEFAULT 'Enter State Senate District!' COMMENT 'Maximum number of characters is 50!',
`US House District` varchar(50) NOT NULL DEFAULT 'Enter US House Disctrict!' COMMENT 'Maximum number of characters is 50!',
`Signature Picture-Less Than 64KB!` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Main voter information table';

--
-- Indexes for dumped tables
--

--
-- Indexes for table `Voter Information`
--
ALTER TABLE `Voter Information`
ADD PRIMARY KEY (`Voter Number`) USING BTREE,
ADD UNIQUE KEY `Driver's License Number/State ID` (`Driver's License Number/State ID`),
ADD UNIQUE KEY `Voter Number` (`Voter Number`,`Driver's License Number/State ID`),
ADD UNIQUE KEY `Voter Number_2` (`Voter Number`,`Driver's License Number/State ID`,`Social Security Number`),
ADD UNIQUE KEY `Driver's License Number/State _2` (`Driver's License Number/State ID`,`Social Security Number`),
ADD UNIQUE KEY `Social Security Number` (`Social Security Number`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `Voter Information`
--
ALTER TABLE `Voter Information`
MODIFY `Voter Number` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Max value is 2,147,483,648\r\nUnique field!', AUTO_INCREMENT=17;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


Supplies

  1. Linux, ie: Debian, Ubuntu, MxLinux, etc.
  2. Firefox
  3. Apache2
  4. MariaDB
  5. PHP
  6. phpMyAdmin