in 'many' table: what's difference 'required' vs 'composition'?
In my fairly long experience, every RDBMS's implementation of relationality has been a little different, so it's not a big deal to me that Ninox's approach is a bit different. But as a new Ninox-er, I am not sure I understand these terms: 'Required' and 'Composition'.
For example, I have a two-table database. Tables are Firms and Employees. Of course, an employee must be linked to a firm. A firm record, on the other hand, may be created (at least initially) without any linked employees.
So, over in the table reference definition for the link from the employee record to the firm record: It's my understanding that the 'Composition' setting (with its options Yes or No) basically answers the question, "If the parent of this record is deleted, should this child record be deleted too?" Please correct me if I'm wrong about that. And it was explained to me that this is to prevent the creation of orphans.
So what's the point in this case of the 'Required' setting? Or rather, if I select "Yes" for 'Composition', shouldn't Required automatically be set to "Yes" as well? Are there any circumstances in which it should be possible to create an employee record that is NOT linked to a firm record?
Now, I can think of one possible answer to my question, and that's when records are created by import. In that situation — especially if the records are coming from another database and you intend to link them in a moment to their parents but of course haven't done that yet — I can see that it might make sense to allow the Firm reference to remain empty. Is that it? Or is there some other reason?
I would view them as separate things.
Composition just tells Ninox that a table is a child of another. That is all. You can create a record in the child table and not have it linked to anything.
That is where the Required comes in. If you do create a child record in the child table then it will force you to pick a record in the Parent table.