• google plus

How to Use Natural Joins

A natural join is a join operation that matches values from columns that have the same name on each of the tables participating in the join For example. if we code a natural join using the Countries and Regions tables in the HR schema, the join column would be region_id. In general, the natural join will perform the join on all columns that have identical names.

To learn how to use natural joins, follow these steps:

  1. You'll need to download and install Oracle 12c. The instructions for the setup can be found in How to use sample schemas. Follow steps 1 through 4 before proceeding to the next step.
  2. Let's display country name and its region name using a natural join. Execute the following select:
    Display country name and region name using natural join
    Note that I have displayed the first part of the output that contains 25 countries overall. The natural join will select region_id as the join column because the column appears in both tables with the same name.
Author: Stephen Withrow

Stephen has over 30 years' experience in training, development, and consulting in a variety of technology areas including Java, C, C++, XML, JavaScript, AJAX, Tomcat, JBoss, Oracle, and DB2. His background includes design and implementation of business solutions on client/server, Web, and enterprise platforms. Stephen is a published writer in both technical and non-technical endeavors. Stephen received an undergraduate degree in Computer Science and Physics from Florida State University.

About Webucator

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, XML, Windows, Java, Adobe, HTML5, JavaScript, Angular, and much more. Check out our complete course catalog.