Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 A Good Design?

Author  Topic 

Johnhamman
Starting Member

37 Posts

Posted - 2002-08-02 : 21:21:46
This is something that has pondered me. Im looking for a good design for a storefront. I need to have multi categories and sub cats that are fully editible. I am looking to do this programing in asp.net. But my main problem when im designing this is the categorys and products under it. For example under one category it may have 2 subcats and then the products but under another category it may only have products directly under the main cat. It seems very hard for me to figure out a dynamic way of doing this. Is there anyone outthere that has a good blueprint or tutorial to do what im looking for?
john

r937
Posting Yak Master

112 Posts

Posted - 2002-08-02 : 23:31:30
you'll need a category hierarchy, where each category has a foreign key to its parent category, and where the categories at the top have a parent_id of null

create table category
( category_id primary key
, parent_id foreign key references category
)

linking products to categories is probably a many-to-many, so the intersection table simply contains the foreign keys of the product and the (sub)category it belongs to

create table product_category
( product_id foreign key references product
, category_id foreign key references category
)

let me know if that was too cryptic


rudy
http://rudy.ca/
Go to Top of Page

Johnhamman
Starting Member

37 Posts

Posted - 2002-08-02 : 23:53:40
unfortunatly im still new at all of this. So its a little confusing. Im looking atrobvolks article. I have used this for a structure but my problem is is its at the bottem of the category level how do i tell it to pull products.

Another Problem is that this seems to be the typical cart site structure. you have 3 things; Categories, Types, Products.
Below is an example from a sports apparel site.
Categories: MLB, NBA, NFL, World Series , Chicago Bulls, Atlanta Braves
Types: T-shirt, Hats, Jersey
Products : braves jersey, Chicago Bulls Hat,2002 World Series T-shirt

Now i have to figure out the best and most effecient way of keeping this data and returning it to the site in a efficient navigational way.

so thats my challenge and i seem to be failing.
Thanks for your help

Go to Top of Page
   

- Advertisement -