Results 1 to 2 of 2

Thread: Category tables

  1. #1
    Join Date
    Feb 2004
    Posts
    134

    Unanswered: Category tables

    What are the thoughts on using a categoy table? What I mean by this is to have a table used to hold simply a category identifier for other table(s).

    Eg:
    Code:
    Hardware Table
    Hadware (PK) | Category (FK) | Description        | Finish     | etc....
    ------------------------------------------------------------------------------
    P1                 | Plate              | 4"x4"x1/4 plate  | Painted   |
    
    HardwareCategories
    Category (PK)
    -----------------
    Plate
    Channel
    Angle
    Should this be done or simply provide a category field in the hardware table? I like the extra table because it kind of ensures that a user doens't add a plate with a category value "Plate", another user adds "plate", and another user adds "Plates", etc....

    What are your thoughts if any?

    Mike B

  2. #2
    Join Date
    Jan 2004
    Location
    Columbia, MD USA
    Posts
    8
    Make Category -> CategoryID, still a FK in your Hardware table (tbHardware)

    Make tbCategory have:

    CategoryID PK
    CategoryName

    If your products can have multiple categories, pull CategoryID out of tbHardware and make a new table called tbHardwareCategory

    This will have:

    HardwareID
    CategoryID

    Make sense?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •