You could also make a table in between that links the two which only contains ids. If you still want a one to one relationship, just put a constraint on the table so that you can’t have two with the same ids in the same position.
It is not recommended but it is not prohibited. It is usefull and makes things easier for you. Specially if you are talking about a hierarchy of not normalisable thing and not a literal ancestry.
You are assuming that each child has only one parent record. If these truly are people we’re talking about, they may actually need the ability to do many-to-many.
First, let me apologize. I seem to have implied that the project is about actual people.
The grandparent/parent/child relation is simply the relation of the tables. The contents could be anything.
Also, I have succeeded in getting the sql queries to work without having the “grandparentID” in the child table.
At least in my problem, a child has exactly one parent, and a parent has exactly one grandparent. The grandparent can have multiple rows in the parent table, and the parent can have multiple rows in the child table.
Finally, I’m always impressed at the responses and ideas on the forum. Thanks to everyone.
That is why I said “if you are talking about a hierarchy of not normalisable thing and not a literal ancestry.” instead of simply asume he was talking about people
Wrongly asumed you can mix the 3 entities.
And again. He simple talk about a Grandparent Parent and child TABLES, but those can represent MANY diverse not normalisable things.