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

  • Home
  • SEARCH
  • 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 7062859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:38:41+00:00 2026-05-28T04:38:41+00:00

What are the different ways for storing multiple choices values in table? In a

  • 0

What are the different ways for storing multiple choices values in table? In a form i am having around 30 to 50 sub division in which each subdivision has around 5- 10 checkboxes. how do i design the database, one way to do it, store each field in the table set it to true or false but the thing i am finding it difficult to design is that if i design it this way, i will end up have around hundred columns. any insight about optimizing. how about using xml for the values in the checkbox instead using database.

  • 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-28T04:38:41+00:00Added an answer on May 28, 2026 at 4:38 am

    there are a few ways to solve this. the most common approach would be to store the selected value in table.

    create table division
        id (pk)
        name
    
    create table option
        id (pk)
        name
    
    create table divisionoption
       division id (pk)
       option id (pk)
    

    with this model you can add additional options and selected options are stored in the divisionoption table.

    another approach would be to assign binary values to each option and then sum the options and store the value in a single field

    create table division
        id (pk)
        name 
        options
    
    create table option
        id (pk) [examples: 1,2,4,8,16...]
        name
    

    when it’s time to save add up the values and store them in the division table.
    example
    option 1 – 1
    option 2 – 2
    option 3 – 4
    option 4 – 8
    user selects options 1, 2 & 3.
    save the value 7 (1+2+4) to the division table.

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

Sidebar

Related Questions

What are all the different ways (in code and from the GUI) which SQL
I'm exploring different ways of storing user-uploaded files (all are MS Office documents or
I have been looking around, and there seems to be many different ways in
In another question I came across two different ways of doing a string replacement.
There are several different ways I can initialize complex objects (with injected dependencies and
why so many different ways to include Java classes into JRuby? What are the
I tried 3 different ways of displaying Page numbers, OnCloseDocument content is not displaying
In struts I notice there are two different ways to access variables. I am
I define HttpClient in 2 different ways: 1. Plain vanilla: client = new DefaultHttpClient();
I know this has been asked different ways several times, but I'm just not

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.