Re: Relational Database Design Question - Category Tree

  • From: "Jeff - The Ultra Guy" <Jeff@xxxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 14 Sep 2007 20:35:10 -0700

Hi Jim,

If I understand your requirements correctly, I think you need just 3 
tables.

Your item/product table will contain a unique item number plus any 
other fields (name, description, etc.) pertaining to the item/product.

Your category table will contain a unique category number, a parent 
category number and the category name.  The parent category field 
contains the category number of the parent category.  If it's a top 
level category, the parent category field contains 0 or null.

The third table, call it the categorization table, contains an item 
number field and a category field.  These fields are not unique.  You 
can have an item in more than one category.

If you want to see a php script implementing categories, feel free to 
download my FAQ script from my website at:

http://www.AnoeticConcepts.com/

Regarding database books, I thought the SQL in 21 days which I got 
from your website was pretty good.

Good luck.

Jeff

----- Original Message ----- 
From: <james.homme@xxxxxxxxxxxx>
Sent: Thursday, September 13, 2007 4:27 AM


Hi,
Time to get an SQL book. Has anyone here read Database Design For Mere
Mortals? How did you like it? What other database design books are 
good?
One of my concerns is that they usually talk all about the stupid 
diagrams
you have to make and read and not about the concepts. I want to 
understand
the kinds of relationships you can make and how to query and get what 
I
want out of the database.

Thanks for any and all help.

Jim

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: