| | A heirarchical database question
|
|
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: ---...--- (...) (24 years ago, 15-Nov-00, to lugnet.off-topic.geek)
|
|
| | 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 (...) (24 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 (...) (24 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 (...) (24 years ago, 16-Nov-00, to lugnet.off-topic.geek)
|
|
| | Re: A heirarchical database question
|
|
(...) Agreed. But sometimes, the price paid for normalization is too high. It depends on the level of adhoc querying against the data. And the skill level of the developer. Steve (24 years ago, 17-Nov-00, to lugnet.off-topic.geek)
|
|
| | Re: A heirarchical database question
|
|
(...) Agreed. But the original design was broken. I proposed two alternatives, both less redundant and both "more correct", although flaws could be found in either one by the determined examiner. ++Lar (24 years ago, 18-Nov-00, to lugnet.off-topic.geek)
|