Size Question

mis

Registered User.
Local time
Today, 10:11
Joined
Dec 15, 2003
Messages
55
Hi,

I am developing a database which is holding information on product's, I will need a table for the sizes of the product. That is simple but Sizes available come in three main categories (Mens, Women, Kids) should I have a table for all three??

tbl_MenSize
ID
Size

tbl_WomSize
ID
Size

tbl_KidSize
ID
Size

Do these tables need to be linked as they are all part of size ? Do the tables need a primary key ??
 
Hi,

To me it would seem overkill to have three tables, why not have one table like this:

tblSizes
ID (primary key, autonumber)
Size
Type (i.e. man, woman etc)

All tables should have a primary key.

Also don't use underscores in your naming conventions, you will find it quite annoying when you refer to it in code.


Hope this helps

Of course if anyone disagrees with me.......then bring it on.....lol
 
SQL_Hell said:
Of course if anyone disagrees with me.......then bring it on.....lol

Not this time. :D
 
Thanks

Will implement the new table structure

Would it be better to replace the type field with mens womens and kids fileds and have them as check boxes ??
 
Last edited:
then you would have three fields as opposed to one?

no i don't think that would be a good idea, for example what happens if a user accidently ticks male and female, how would you know which one it is?

It would be better to have a drop down box on the form, so the user can select:

mens
womens
kids
 
Thank You

SQL_Hell,

Thanks will do it sounds good.
 
Keep reading up on normalisation, mis. :D
 
Type Field

Hi Mile-O-Phile,

Since there will be several records with mens, womens etc size would it not be better to put these into a separate table or there will be lots of records with duplicated data.

???
 
Technically yes because man, woman, etc. is a code so you can use a lookup table to obtain the values. When you do this though, you will still have what appears to be duplication because "men" will be replaced by 1, "woman" by 2, "children" by 3. So instead of seing a bunch of rows with the value "men" in the type column, you will see a bunch of 1's. You will also need to include the type code table in any queries where you want to display the text value. One thing that using a numeric code will do for you is make it easier to use an option group with option buttons on your forms if you want. Checkboxes are inappropriate because checkboxes are used when more than one choice can be made at the same time. Option groups are used when only ONE option may be chosen from a list.
 

Users who are viewing this thread

Back
Top Bottom