Right Outer Joins

 

Right Outer Joins connect all of the rows of data in the table with the foreign key
with data in the related table that has the matching primary key.

 

All rows in the “related” (“right”) table are displayed,
regardless of whether there is a matching record in the “primary” table.

 

While it is quite possible for a customer to have no orders,
it is a problem when an order has no customer.

This is not really a problem, as in the case of the “Customer / Orders” example.

Who will pay for the item purchased ?

 

This is really a problem, as in the case of the “Customer / Orders” example.


A “Right Outer Join” could find orders which have no related customer, so that the store owner
might fix the database to prevent this from happening in the future (it’s too late now !)

 

Remember that “Referential Integrity” prevents records
that have a record in one table that has no matching record in the “primary” table.

 

These are called “orphaned” records because they have
no record in the table that should identify who “owns” them.

 

<Back>