Analysis of the Result
The cardinality of this query result, 18,034 rows, reconciles with the expected number of returned rows. See “Single Table Cardinality Estimate” on page 266.
13,010 rows have values (non-nulls) for monthly_revenue.
The EXPLAIN shows that the system performs a left outer join.
The Optimizer selects the best join algorithm for this outer join (a Merge Join) and applies the conditions from the WHERE and ON clauses, respectively.
The left (outer) table is limited by the search conditions in the WHERE clause, and the search condition in the ON clause for the right (inner) table defines the nullable nonmatching rows.
The EXPLAIN text confirms that this is a true outer join (“...SAMPDB.c and SAMPDB2.b are left outer joined...”).
The result of the query, 18,034 rows, the correct answer to our business question.