Review the joins presented in the previous videos, and get some hands-on practice.
You might be thinking, “What on earth is a Cross Join?” We didn’t cover Cross Joins because they are not very common, but they do serve a purpose. And being able to recognize a Cross Join can actually help you if you’re troubleshooting sometimes.
A Cross Join takes each row from the first table and matches it with every row in the second table. This can be useful if you ever need to select all possible combinations of rows from two tables. For instance, if I had two tables with 10 rows each and I cross joined them, I would get a 100 row result set back.
Where this knowledge really comes in handy is if you ever see data that is being duplicated many times over unexpectedly in a query result, you may have done something wrong in your Inner Join that caused the matching criteria to be ignored. It’s a sign to go back and double check that you have the proper equality statement in the ON portion of the Inner Join section.
See all of the SQL used in Querying Relational Databases in the Querying Relational Databases Cheat Sheet.
You need to sign up for Treehouse in order to download course files.Sign up