Re: -> Database Relations for e commerce product catalogue

From: Kenneth Downs <firstinit.lastname_at_lastnameplusfam.net>
Date: Tue, 16 Nov 2004 13:06:50 -0500
Message-ID: <r6sp62-vll.ln1_at_pluto.downsfam.net>


Felix Becker wrote:

> Hi _at_ all,
>
> I hope I spot this in the right group.
>
> I am looking for some help to design my database.
> I don't know how to solve a m:n:o relation. I don't even know if the term
> m:n:o exists...
>
> For example:
>
> 1.) I have a shop that has different deparments for men and women.
>
> 2.) Each department hast categories. One category could exists in one or
> more departments.
>
> 3.) Every category has one product brand. But a brand can exist in one or
> more categories in order to this in one or more departments
>
> And one product has a brand, can exist in one or more categories and can
> also exist in one or more departments.
>
> I started to create tables that collects single departments, categories
> and brands.
>
> What is the best way for the relations?
>
>
> Thanks for any help in advance...
>
> Felix

It may be simpler than you think. You have an items table, and some of the properties of an item might be department, sex, and category/brand. If you simply set up the items table with foreign keys to each table, there is no problem. It can however get very confusing if instead you try to set up a chain of parent-child relationships, such as categories inside departments, departments inside of sex. That model is probably closer to the way the users would describe the situation in plain English, but close analysis reveals that it really does not model the situation.

Also, as stated by Laconic, that category/brand thing looks fishy, they are probably the same thing.

It sounds like this is apparel, no? Do you make use of the terms style, color, label, and dimension? How about sizes? If so, we can perhaps discuss the problem in those terms, which I have some familiarity with.

-- 
Kenneth Downs
Use first initial plus last name at last name plus literal "fam.net" to
email me
Received on Tue Nov 16 2004 - 19:06:50 CET

Original text of this message