Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are over-thinking the linkage between optionality and identity. Until the whole thing comes more naturally to you, it's best to think of them as being <strong>completely unrelated</strong>.</p> <p>About optionality, it is important to remember that the optionality is directional. To use your example of <code>employee_equipment</code>: Sure, employees don't need equipment. The one-to-many relationship from <code>employee</code> to <code>employee_equipment</code> is optional. At the same time, looking at it from the opposite perspective, the relationship is mandatory. You can't have a record in <code>employee_equipment</code> unless there is an <code>employee</code> to associate it with.</p> <p>Identity has nothing to do with optionality, except <em>coincidentally</em> an identifying relationship is mandatory from the child to the parent. Whether it is also mandatory from the parent to the child is neither here nor there as far as identity is concerned.</p> <p>What makes a relationship identifying is that you have to know what parent you are talking about (as well as some other things) in order to know what child you are talking about. That is, the primary key of the child must include a foreign key to the parent. </p> <p>Pure intersection tables (e.g. <code>employee_equipment</code>) are good examples of this. The primary key of a pure intersection is the combination of the foreign keys to both parent tables. Note that some people may also add a surrogate key to these kinds of tables. It doesn't matter so much from an identity perspective if there are multiple candidate keys. What is important in determining identity is whether the foreign key is part of a candidate key, whether or not that candidate key happens to be the primary key.</p> <p>Another good example would be something like a database's metadata catalog, where a column is identified by the table to which it belongs, just as the table is identified by the schema it is in, and so on. Knowing that a column is called <code>NAME</code> doesn't tell you which column it is. Knowing that it is the <code>NAME</code> column in the <code>CUSTOMER</code> table helps. (You'll also have to know which schema <code>CUSTOMER</code> is in, and so forth).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload