I have a database that has node & nodetype tables.
Nodes table
NodeID
ParentNodeID
NodeTypeID
NodeName
...
NodeType Table
NodeTypeID
ParentNodeTypeID
NodeTypeName
.....
Both tables have a relationship to itself.
There are different types of node i.e Node Site Building Office
These are hierarchical, so information (attributes) that is applied to i.e Nodes of type Site, should propagate down to, and be overridable by its children.
What is the best way to achieve this? Or am I looking to do to much in SQL and should this be handled in code?
UPDATE
NodeID ParentNodeID NodeName Address1 Address2 Address3 NodeType NodeTypeID
1 null Top null null MyTown Site 7
2 1 Level1 null HeadOffice MyTown Building 8
3 2 Level2 SalesFloor HeadOffice MyTown Floor 9