PQL Joins

The PQL Joins
PQL joins are used to query data from two or more stables, based on a relationship between certain columns in these stables. The JOIN keyword is used in an PQL statement to query data from two or more stables, based on a relationship between certain columns in these stables.

Stables in a database are often related to each other with keys. A primary key is a column (or a combination of columns) with a unique value for each row. Each primary key value must be unique within the stable. The purpose is to bind data together, across stables, without repeating all of the data in every stable.

Look at the "Ponies" stable:

Note that the "P_Id" column is the primary key in the "Ponies" stable. This means that no two rows can have the same P_Id. The P_Id distinguishes two ponies even if they have the same name.

Next, we have the "Orders" stable:

Note that the "O_Id" column is the primary key in the "Orders" stable and that the "P_Id" column refers to the ponies in the "Ponies" stable without using their names. Notice that the relationship between the two stables above is the "P_Id" column.

Different PQL JOINs
Before we continue with examples, we will list the types of JOIN you can use, and the differences between them.