databaseentity-relationshipnotation

Unidirectional ER relation


I have 2 tables: A and B. A sees B and for each item in A we have N items in B (one-to-many). B doesn't see A (no reference at all).

How do I represent this with (any) ER notation?

I have the nasty feeling that this cannot really be represented as it's an implementation detail more than a modeling one, but maybe someone can help me overcome the doubt.


Solution

  • I'm not sure what you mean by "B doesn't see A"

    Anyhoo

    Entity relationship diagrams are entirely logical, and it is not necessary for entity B to possess any attribute of entity in order to model a 1:M relationship like this

    +-----------+
    |           |
    |     A     |
    |           |
    +-----------+
          |
          |
         /|\
    +-----------+
    |           |
    |     B     |
    |           |
    +-----------+
    

    However, once you move to a physical data model, the projection of table B will need to include the primary key of table A, in order to represent the relationship (and enforce a foreign key constraint)