which is much more bulky. In essence, table aliases make the entire SQL
statement easier to understand, especially when multiple tables are included.
Next, we turn our attention to line 3, the WHERE statement. This is where the
condition of the join is specified. In this case, we want to make sure that the
content in "store_name" in table Geography matches that in table
Store_Information, and the way to do it is to set them equal. This WHERE
statement is essential in making sure you get the correct output. Without the
correct WHERE statement, a Cartesian Join will result. Cartesian joins will
result in the query returning every possible combination of the two (or whatever
the number of tables in the FROM statement) tables. In this case, a Cartesian
join would result in a total of 4 x 4 = 16 rows being returned.
|