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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:22:58+00:00 2026-05-28T14:22:58+00:00

I am building the underlying database for a shop. There are 2 tables, one

  • 0

I am building the underlying database for a shop. There are 2 tables, one for garments and one which holds standard size charts. Garments are available in one or more sizes and the size charts contain several measurements for each size garment.

Example size chart table

id  size    waist   chest   hips    height
0   6       56      76      82      160
0   8       60      80      86      162
0   10      64      84      90      164
0   12      68      88      94      166 
1   6       57      75      82      160
1   8       61      79      86      162
1   10      62      83      90      164
1   12      63      87      94      166

Example garments table

garment_id  garment_name    garment_type    size_chart  available_sizes
0           Boating Jacket  jacket          0           8,10,12      
1           Polka Dot Skirt skirt           1           10,12

What I want to do is join them so that I have

    garment_id ...  size_chart  available_sizes  size_chart.id  size_chart.size       size_chart.(...)
    0          ...   0          8,10,12      0                  8
    0          ...   0          8,10,12      0                  10
    0          ...   0          8,10,12      0                  12
    1          ...   1          10,12        1                  10
    1          ...   1          10,12        1                  12

The problem I am having is how to join so that I get every number in the set (available_size) to have a corresponding entry for measurements….

Any ideas/suggestions/advice on how I am best to do this would be really useful!

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-05-28T14:22:59+00:00Added an answer on May 28, 2026 at 2:22 pm

    Example garments table

    garment_id  garment_name    garment_type    size_chart  available_sizes
    0           Boating Jacket  jacket          0           8,10,12      
    1           Polka Dot Skirt skirt           1           10,12
    

    Is the root of all evil – so, speak after me:

    I will never ever store more than one information in a single db field, if I want to access them seperately. Never.

    On a more serious note, you would want to drop the available_sizes field from the garments table, instead do something like

    CREATE TABLE available_sizes (
      id INT PRIMARY KEY AUTO_INCREMENT,
      garment_id INT NOT NULL,
      INDEX(garment_id),
      size_id INT NOT NULL,
      INDEX(size_id)
    )
    

    and populate it. This makes it easy to mark one size as sold out, maybe even add a qty_in_stock INT to the table, search for all garments of same type, which are available in a specific size, etc.

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

Sidebar

Related Questions

I'm building an application with an underlying database that looks like a text-book example
I am building a database that contains public, private(limited to internal) and confidential data
I'm building a generic UI that can hook into a range of underlying object
I have a query using LINQ-to-SQL. It queries an underlying database table Rooms. It
I have a big VS2010 solution, which contains a bunch of C# projects. One
I'm building a public website which has its own domain name with pop/smtp mail
I am planning on building a 2D game library for XNA, and one of
I'm building a database application using django. Much of the data recorded requires supporting
I'm building an application using EF 4.1 and I was wondering if the underlying
I'm working on building a MySQL database and I'm thinking that rather than encode

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.