Sample Header Ad - 728x90

How should I design my databas for online voting web app?

1 vote
1 answer
140 views
Currently I'm trying to build web app for online voting where registered user can create their own Election. For the database, every time user create an election should the system create new required table for the election or I could just some tables to hold everything ? 1. case 1 (create required table for each election ) : - user_table (id,name,email,etc) - election_table (user_id, election_id,etc) per election created by user above, below tables will be created in database with electionId is part of table name : - voter_electionId_table (voter_id,name,email,etc) - candidate_electionId_table (candidate_id,no,name) - ballot_electionId_table(vote_id,candidate_id) example expected result : enter image description here 1. case 2 ( same tables for every election) : 2. user_table (id,name,email,etc) 3. election_table (user_id, election_id,etc) 4. voter_table(voter_id,election_id,etc) 5. candidate_table (electionID,candidate_id,no,name,etc) 6. ballot_table(electionId,vote_id,candidate_id) expected result : enter image description here which from above is better ? or none of them is good (If yes, please share your thought).
Asked by xedox_za (11 rep)
Nov 29, 2023, 01:57 AM
Last activity: Aug 3, 2025, 06:07 AM