• +49-(0)721-402485-12
Ihre Experten für XML, XQuery und XML-Datenbanken

Join variants

While the semantics of a left or right outer join can be structurally integrated into the hierarchical concept of the XML data model without any problems, the definition of a two-sided outer or full outer join requires an auxiliary construction.

The principle of a full outer join shall be illustrated by the ongoing example of the emergency doctors by discussing the four possible different join semantics. The following image additionally shows the semantics in a symbolic manner:

illustration of the different join semantics in XQuery

Image: Illustration of the different join semantics

  • Inner join
    In an inner join, only combinations of patients and doctors are intregrated into the result in case both live in the same city. This means that patients without emergency doctor as well as doctors without patients living in the same city drop out.
  • Left or right outer join concerning patients
    In a left or right outer join with regard to the patients, all patients are generally integrated into the result. In case one or more emergency doctors exist, these are assigned to the patient.
  • Left or right outer join concerning doctors
    In a left or right outer join with regard to doctors, all doctors are returned whereby patients living in the same city are assigned to the doctor. Obviously, the set of patients can also be empty.
  • Full outer join
    The full outer join corresponds to a combination of the left and the right outer join. This means that all patients (with and without an emergency doctor) and all doctors (with and without patients) appear in the result.

 

Source: "XQuery – Grundlagen und fortgeschrittene Methoden", dpunkt-Verlag, Heidelberg (2004)

<< backnext >>