Reputation: 43
I have question about H2 database.
I have one table contain the relation between members in a family called Family table.
In this table, I have three level like this. GrandPa --> Parent --> Child Sometime Child is the parent of other child and grandpa of the other generation. So, I need to get all the data in this table and put into another tables with the constrain integrity (GrandPa, Parent, Child).
So, I have two options to do, but I'm thinking which one is better. 1> load all the data and add to three table and then add the constrain integrity. (Foreign Key..) 2> setup the integrity first, and then go one by one , select and add granpa first, then papa, then child....
Upvotes: 0
Views: 77
Reputation: 6694
If you know that your data is clean. (It is very important) then the first way is the better way. Because of the performance.
But if you are not sure about your data, you should prefer the second way. You can detect the problems in your data during loading your data..
Upvotes: 1