Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 599875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:32:45+00:00 2026-05-13T16:32:45+00:00

What is the best database schema for polls? Is one-to-many relationship good for this?

  • 0

What is the best database schema for polls? Is one-to-many relationship good for this? I’m thinking about having two tables:

poll_questions
    int id
    varchar body
    datetime created_at
    datetime updated_at

poll_answers
    int id
    varchar body
    int votes default 0
    int question_id (foreign key to poll_questions.id)
    datetime created_at
    datetime updated_at

Then there would also be third table for tracking who voted for an answer so users are able to vote only once:

poll_voting_history
    int id
    int question_id (foreign key to poll_questions.id)
    int answer_id (foreign key to poll_answers.id)
    int user_id (foreign key to the id in the users table)
    datetime created_at
    datetime updated_at

What are your thoughts? Am I thinking about it right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:32:46+00:00Added an answer on May 13, 2026 at 4:32 pm

    The schema looks good, and yes, you’d need to track the user votes as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand how to design a database schema that has simple one-to-many relationships between
I am thinking about providing a version of say, the database schema and the
Intro I am trying to decide how best to set up my database schema
Well, this is a question about best practise with Android SQL Lite DB's. I
I have a question about a database schema for a certain website where people
What are the best practices to build an app's database schema on first execution?
I'm designing a database schema using PostgreSQL. I have some doubts about which design
My problem is this: sometimes changes to database schema invalidate the SQL statements in
What is the best database schema to track role-based access controls for a web
Greetings stackers, I'm trying to come up with the best database schema for an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.