Convert table to sub-table

Ninox Profile

Is this possible? If so, how?

Ninox Profile

Generally speaking .. make a composit relationship. 

Ninox Profile

Hum, I don't know what that means, could you explain further? 

Ninox Profile

Sure..  Assume  you have two tables.. Parent and Child.. and there is a relationship from Child back to parent.

relatedNotSubtable

This is current "composition = no"

notComposite

Flip it to YES

makecomposit

subtable

 

If your starting point is that you have rows in Parent .. and rows in Child... and NO relationship at all... You can still make the relationship.. make it composite ... and then have a script that scans the child and populates the parent .. exactly what that scan looks like will depend on your foreign key relationship(s)

Ninox Profile

Sure..  Assume  you have two tables.. Parent and Child.. and there is a relationship from Child back to parent.

relatedNotSubtable

This is current "composition = no"

notComposite

Flip it to YES

makecomposit

subtable

 

If your starting point is that you have rows in Parent .. and rows in Child... and NO relationship at all... You can still make the relationship.. make it composite ... and then have a script that scans the child and populates the parent .. exactly what that scan looks like will depend on your foreign key relationship(s)

Ninox Profile

Thanks. I see how it's done. I have to work on my database. So far it's working backward. I'll play with it and report back.

Ninox Profile

I see my problem. I have a "House" database. I have these tables; Tile, Mortar, Grout, Caulk. All are related to tile. I keep thinking the Tile table should be the parent, but it's not since a mortar, grout, and caulk can be used with many different tiles. I also have a "Paint" table with a "Primer" sub-table, and I think that is wrong too because a primer can be used on many different paints. So I think the "Primer" table should be the parent. Does this make sense?

This is how it looks now in the data model:

Screen Shot 2019-09-05 at 7.40.10 PM

Ninox Profile

@Mr K.. I agree.. Your Primer and Mortar tables should just be associations.. LIke your Thinset Mortar .. Grout.. etc.   

Ninox Profile

I'm experimenting with a test database. I see that with sub-tables the common element needs to be the parent. In my case that is not what I want to see, so for this database sub-tables are not the way to go.

Reply