Re: Simple question (probably)

From: ivo <ivo_willemsen_at_hotmail.com>
Date: 2000/04/17
Message-ID: <8df8ka$j3v$1_at_enterprise.cistron.net>#1/1


Yes David,

You have to create an extra table that relates the table shirts to the sizes !

Table shirt:

Shirt_id
Shirt_name
.
.

Table size_shirt

Shirt_id fk to shirt
Size_id
Number_in_stock

So:

Table shirt:

Shirt_id Shirt_name

1              Shirt A
2              Shirt B

Table size_shirt:

Shirt_id Size_id Number_in_stock

1                24        10
2                25        5
3                26        6

This way, maintaing the number of shirts is easier !!!

Greetings,

Ivo Willemsen
Oracle, Sybase and MSSqlserver DBA
Enixe Professional IT Services B.V.

David <david_at_ _%%NOSPAM_ fibre.a2000.nl> wrote in message news:8d49u9$osu$1_at_weber.a2000.nl...
> Hello, I have a simple question:
>
> How would you do the following:
> I have a database of shirts, and want to store the sizes of each of them
 in
> which they are available. So at first I created a field 'sizesfrom' and
> field 'sizestill'. And when I needed the sizes in which a shirt was
> available I simply let a counter run form 'sizesfrom' to 'sizestill' and
> present that (in ASP). But now, we have to be able to manipulate the
> available sizes. So, I really would like to explicitly store the available
> sizes. But should I do this in a field like 'availablesizes' with a value
> like '24,25,26,27' and then use some stringparsing function to retrieve
 the
> sizes? Or should I create a another table for the shirts and for each
> available size create a record?
>
> Thanks a lot.
>
> David
>
>
>
>
>
Received on Mon Apr 17 2000 - 00:00:00 CEST

Original text of this message