For Voting App
Need MySQL queries for the following:
- Statement: create voter. Register a unique username of reasonable lengths (3-64 characters, such as "tonypujals" and password to be able to vote. Password field will store bcrypt-encrypted strings, specifically:
CHAR(60)
CHARACTER SET latin1
COLLATE latin1_bin
-
Query: fetch encrypted password for voter username. Will be used to compare encrypted strings for login.
-
Statement: create a poll. A poll is a unique name, such as "cats_vs_dogs" and identifies the names of the available choices to vote for (eg, "cats", "dogs"). The choices should have a simple incrementing unique ID (1, 2, 3, etc.)
-
Statement: cast ballot. A ballot has a voter, a poll, and vote.
-
Query: fetch voter's vote for a particular poll (ex: "cats").
-
Query: fetch vote results for a particular poll (ex: cats: 5, dogs: 3)
Run on Aurora.