Design a simple database to track people and who they voted for. The database should have...

80.2K

Verified Solution

Question

Programming

Design a simple database to track people and who they votedfor. The database should have 3 tables:

A table of candidates
A table of registered voters
A table of votes
The candidate table should provide a listing of all candidatesand information about the candidates.
The registered voter table should hold all registered votersand any pertinent information about them
The vote table should hold vote records for each candidatemade by the voters

Requirements:

The system should not allow duplicate voters to be added tothe registered voter table based on a voter_id number field
The system should reject duplicate votes by the samevoter
Pick the relevant fields needed for each table to make thesystem useful
Provide:

SQL code to create the three tables
SQL code to insert test data into the database
A SQL query to retrieve the vote of record of a particularindividual

Answer & Explanation Solved by verified expert
3.9 Ratings (537 Votes)
1Table Namecandidatescreate table candidatescandidateID int Primary keycandidateName varchar100netWorth decimal102DOB dateMobile varchar10inserting records into candidatestableinsert into candidates values 1SamRam2356987198605128855663322insert into candidates values2MrLoko78963197609104567891230insert into candidates values    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students