You are here: Visual LANSA Logical Modeler > 1. Introduction to Data Modeling > 1.1 What is Data Modeling? > 1.1.7 Identifying the Type of Relationship

1.1.7 Identifying the Type of Relationship

How do you know if a parent/child or join/from relationship should be used?


One entity is said to be the Parent of another if the data of the Child entity belongs to (is contained within) the parent. Parent/child relationships can be identified by asking "Is the entity identifier unique?" or "Can the entity exist on its own?"

If the relating entity's identifying attribute is unique, i.e. you can identify an occurrence in the entity solely by its identifying attribute, then the entity probably has no parents. If you require other information to identify an occurrence, i.e. another entity must exist before it can exist, then the entity probably has a parent.

For example, an Order Line entity is identified by its Line Number. Line Number is not sufficient to uniquely identify an occurrence within the entity. There can be several Order Lines with a Line Number of 001. You need an Order Number and the Line Number to identify a specific occurrence in Order Line. Order Line is a child of Order.

Also note that the parent entity, Order, is required or the Order Line cannot exist. You cannot have an Order Line without an Order.


One entity is said to be joined (or to refer) to another if a data (i.e. non key) attribute or group of attributes from the first entity can be used to access an occurrence of the second. Again ask, "Is the entity identifier unique?" or "Can the entity exist on its own?"

The join relationship differs from the parent relationship, in that the attribute(s) used to "look up" the referenced entity is not necessary to identify the primary (or referencing) entity.

For example, in the order processing example, an Order Line refers to a Product. You would expect the Order Line to contain some reference to Product such as a product number. However, the Order Line Number and the Order Number are sufficient to uniquely identify the Order Line. The reference to Product is not required to identify an occurrence in Order Line. The relationship is simply a join.

Also note that a Product Code does not have to exist in order to have an Order Line. A valid value may be required for the product code (i.e. you refer to the other file), but the Order Line Entity could exist without having a Product entity. A parent 'gives birth' or contains a child. The Order contains the Order Lines. The Product does not contain the Order Lines.