Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Location
    italy
    Posts
    1

    Unanswered: database design helping

    Hi all, this my first post here, I have so many categories with three sub-levels, what strategy do you recommend for the structure? I attach a gif to give a better idea, thanks



    P.S.
    .... maybe for my case since many of the categories defined with 3 sub-levels each formed by a maximum of six elements, I adopt the technique Adjacency List Model
    Attached Thumbnails Attached Thumbnails db_nestedset.gif  
    Last edited by gandalf75; 03-23-11 at 14:04.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'd use a self referencing FK.
    eg

    table categories
    ID
    Description
    ParentID references ID in the same table

    see Ask the Expert

    or do a google on SQL categor r937
    Google
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    healdem, thanks for the props

    i think this is what you had in mind... Categories and Subcategories

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by r937 View Post
    healdem, thanks for the props

    i think this is what you had in mind... Categories and Subcategories

    I knew it was out there, somewhere.. but could I find it....
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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