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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Design Question related to Parent/Child
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

35 Posts

Posted - 08/21/2014 :  18:46:48  Show Profile  Reply with Quote
Thank you in advance for your consideration.

Imagine a company that makes thousands of products. Those products can be sold across multiple brand relationships. A specific brand can appear multiple times as different "branding categories".

Table: Brand
BrandId INT
Description VARCHAR

Example Data:

Table: BrandType
BrandTypeId INT
BrandTypeDescription VARCHAR
1:Super Brand
2:Normal Brand

I want to create an association table between the brands:
Table: BrandAssoc
BrandAssocId INT
ParentBrandId INT
ChildBrandId INT
BrandTypeId INT


It is a graph not a tree because a child can have multiple parents...if I understand the Celko book correctly.

A brand can be sold in multiple places in the organization. Think of it
as selling Widgets as your local grocery store as Brand A but you can
also sell them at CostCo or Sams Club as Brand B and Brand C.

I want to store the "organization" of the branding relationship on the invoicing so I can say, "I sold 50 XYZ in Super Brand 1" this month. The problem is that if the BrandId is in multiple association rows, how do you know what "organization" the item was sold in?

Do I store the BrandAssocId on the invoice? That works great except that if the "organization" changes, like moving Normal Brand 2 below Super Brand 3, I lose that history. Or do I store the multiple columns of ParentBrandId, ChildBrandId, and BrandTypeId on the other tables for things like invoices and such.

Again, I appreciate your consideration and time with this.


  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000