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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:15:59+00:00 2026-06-05T01:15:59+00:00

I’m looking for some advice as to which direction to head in re the

  • 0

I’m looking for some advice as to which direction to head in re the design of a product database and the best methods for storing / retrieving data from it. The block I’m hitting is in how to best represent the various (valid) options that a product may have.

The basic structure is (not actual table definitions):

PRODUCT_TABLE {
ID(int),
NAME(varchar),
AVAILABLEOPTIONS(varchar),
etc...
}

COLOROPTIONS_TABLE {
ID(int),
COLORNAME(varchare),
etc...
}

BODYOPTIONS_TABLE {
ID,
BODYNAME,
etc...
}

What would be the best way to store a value in the AVAILABLEOPTIONS field that would allow me to specify the OPTIONS tables and the ID’s within those tables that the product is available in. (i.e. A product might not be available with all the options in a particular option table)

I’ve done a bunch of research (mainly on this great site) and looked at JSON, serialising values, multidimensional arrays etc, but I’m not sure the best way to go.

In the end, the AVAILABLEOPTIONS value will be used to display the options on a product page or used to construct a form for a user to generate a valid product code. I’ll also be trying to setup an input form that allows an admin to generate the availableoptions value for storage in the DB.

Any tips or thoughts would be greatly appreciated!


I’m not sure if this is the right place to put this update, but here goes.

Have done more research and it seems the storage of multiple values in a single field is a definite no-no. I’m not sure the EAV model is right for my needs either. But when it comes to normalising the database requirements I have, I’m not sure I’ve got it figured out yet. I’ve come up with this:

Image Here: http://dev.aqualux.com.au/images/1.png
(Wouldn’t let me post an image in the edit because I’m too new here…)

Where pid/oid in the orange tables are foreign keys. The issue I’m not grasping is that any given product can have multiple options of a given type, or none at all….

Thanks

  • 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-06-05T01:16:00+00:00Added an answer on June 5, 2026 at 1:16 am

    Have you thought of creating an additional table to act like a bridge? Recently, I built a database to store Adobe Captivate results in MSSQL. One of the requirements was to create a unique student based off the employee and their department. This alone, was three tables where I used the bridge as my identifier for the individual assessments.

    I’ve posted snippets from my blog below. Mind you that this is pulled directly from MSSQL.

    CREATE TABLE [dbo].[division](
        [id] [INT] IDENTITY(1,1) NOT NULL,
        [divisionName] [VARCHAR](50)
    
    CREATE TABLE [dbo].[employee](
        [id] [INT] IDENTITY(1,1) NOT NULL,
        [personName] [VARCHAR](50)
    
    CREATE TABLE [dbo].[student](
        [id] [INT] IDENTITY(1,1) NOT NULL,
        [employee_id] [INT] NOT NULL,
        [division_id] [INT] NOT NULL
    
    CREATE TABLE [dbo].[core](
        [id] [INT] IDENTITY(1,1) NOT NULL,
        [assessment_id] [INT] NOT NULL,
        [status_id] [INT] NOT NULL,
        [rawScore] [INT] NOT NULL,
        [maxScore] [INT] NOT NULL,
        [minScore] [INT] NOT NULL,
        [accuracy] [INT] NOT NULL,
        [TIME] [datetime] NOT NULL,
        [student_id] [INT] NOT NULL, /****** My unique record ******/
        [DATE] [datetime] NOT NULL
    

    So in your case, you would have an Options table

    CREATE TABLE options(
        id INT AUTO_INCREMENT PRIMARY KEY,
        color SMALLINT,
        body SMALLINT
    );
    

    And modify your PRODUCT table so that your AVAILABLEOPTIONS is SMALLINT and the foreign key, similarly like https://stackoverflow.com/a/1545264.

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

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.