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 3958912
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:39:56+00:00 2026-05-20T02:39:56+00:00

Sorry i got myself a bit confused as to how to make the db

  • 0

Sorry i got myself a bit confused as to how to make the db for my questionnaire; Its gonna be one of those questionnaires where a few questions are picked out at randon, displayed with the possible answers next to them where each answer has a weight that is calculated at the end.

So i got 3 tables: Question, Answer and Weight

Weight has a one-to-many with answer because each answer will have a weight to be added to the final score.

The thing thats got me confused is how to get rid of the many to many relationship between question and answer as one question will have many possible answers, and the same answer i.e. yes/no will be used in many questions.

  • 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-20T02:39:57+00:00Added an answer on May 20, 2026 at 2:39 am

    I’d recommend the following structure:

    • Questions
      • has 0:n answers
      • attributes: id (int PK), question (text)
    • Answers
      • has 1 question
      • has 0:n responses
      • attributes: id (int PK), answer (text), question id (int FK)
    • Responses
      • has 1 answer
      • (has 1 question through answer)
      • has 1 responder (user)
      • attributes: id (int PK), answer id (int FK), user id (int FK)
    • Users
      • has 0:n responses
      • attributes: id (int PK) + anything else you need to store about users

    (PK = primary key, FK = foreign key)

    Store weight as an attribute of question or answer. You haven’t really described what weight is, so it’s hard to tell.


    Here’s the records for one question, and someone responding to that question. In this example, Jean Luc Picard is asked “How many lights?” with possible answers, “3”, “4”, and “5”. Of course, he picks “4”, for which is doesnt not receive any weight (“5” is the correct answer).

    Question: (QID=1, Question="How many lights?")
    Answer: (AID=1, QID=1, Answer="3", Weight=0)
    Answer: (AID=2, QID=1, Answer="4", Weight=0)
    Answer: (AID=3, QID=1, Answer="5", Weight=1)
    Response: (RID=1, AID=2, UID=1)
    User: (UID=1, Name="Jean Luc Picard", ...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for asking a basic question, I am learning C and I got confused
Heres my link ( BE WARNED, its got autoplay audio - sorry...!) link text
Sorry if my question was unclear. I got a bunch of elements and the
Sorry for vague question title. I've got a table containing huge list of, say,
I've got a WPF ListView with vertical lines using the following style: (sorry for
Sorry, newbie question I know, however I've currently got mySQL results only showing when
I'm trying to self-teach myself C++, and once again I got stuck on something
Sorry for the mega title... I was trying to be descriptive enough. I've got
i'm from poland so sorry for word mistakes. what's my problem? i've got array
I'm inexperienced with MATLAB, so sorry for the newbie question: I've got a large

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.