I have these three tables on my database:
There is a one-to-one relationship between Code
and Aggregation
table (an AggregationId
is always a CodeId
. And of course, a CodeId
is unique). Note: A Code.CodeId
doesn't need to be in Aggregation
table.
There is a one-to-many relationship between Aggregation
and AggregationChildren
table (an aggregation will have one or more children).
I think I'm wasting a lot of space repeating a NVARCHAR(20)
data in three tables Code.CodeId
, Aggregation.AggregationId
and AggregationChildren.AggregationId
.
By the way, `AggregationChildren.
What do you think?
I think I can delete Aggregation
and AggregationChildren
tables.Then, add two new columns to Code
table:
One to indicate to replace Aggregation.AggregationId
.
Another one to replace AggregationChildren.Position
.