Subject:
|
A heirarchical database question
|
Newsgroups:
|
lugnet.off-topic.geek
|
Date:
|
Wed, 15 Nov 2000 04:29:21 GMT
|
Viewed:
|
343 times
|
| |
 | |
Hi:
Here is a question for the DB experts:
Say you had some data that was heirarchical, e.g. a list of Lego Themes:
-- System
----- Aquazone
---------- Aquasharks
What would be the best way to describe it in a DB table? Would this work OK:
-----------------------------------
Big table of Themes
theme_parent (varchar)
theme_name (varchar)
theme_child(varchar)
-----------------------------------
or is there a better way to do this?
Thanks
--Jim
|
|
Message has 3 Replies:  | | Re: A heirarchical database question
|
| (...) What you've basically got there is a linked list. Although this works well when running through memory, I've found that it's costly if dealing with SQL queries. Imagine something that's nested ten levels deep -- you'll have to make 10 (...) (25 years ago, 15-Nov-00, to lugnet.off-topic.geek)
|  | | Re: A heirarchical database question
|
| (...) I'm assuming you mean that your table would have three columns, named theme_parent, theme_name, theme_child. Your table would have data like: System Aquazone Aquanauts System Aquazone Aquasharks System Space Blacktron DUPLO Disney Winnie the (...) (25 years ago, 15-Nov-00, to lugnet.off-topic.geek)
|  | | Re: A heirarchical database question
|
| In lugnet.off-topic.geek, Jim Hughes writes: would be the best way to describe it in a DB table? Would this work OK: (...) You don't want to use both parent and (grand) child in the same table. It won't work, or it will introduce unneeded (...) (25 years ago, 16-Nov-00, to lugnet.off-topic.geek)
|
6 Messages in This Thread:   
  
      
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|