O'Reilly logo
  • Lokesh Singh thinks this is interesting:

The join between DEPARTMENTS and LOCATIONS creates an interim result set consisting of 27 rows. These tables provide the DEPARTMENT_NAME and CITY columns. This set is naturally joined to the COUNTRIES table. Since the interim set does not contain the COUNTRY_ID column, a Cartesian join is performed. The 27 interim rows are joined to the 25 rows in the COUNTRIES table, yielding a new interim results set with 675 (27 × 25) rows and three columns: DEPARTMENT_NAME, CITY, and COUNTRY_NAME. This set is naturally joined to the REGIONS table. Once again, a Cartesian join occurs because the REGION_ID column is absent from the interim set. The final result set contains 2700 (675 × 4) rows and four columns. Using pure natural joins wit...


Cover of OCA/OCP Oracle Database 11g All-in-One Exam Guide with CD-ROM : Exams 1Z0-051, 1Z0-052, 1Z0-053


Why pure natural joins should be avoided in some cases