Summary

In this chapter, we thoroughly discussed how to link two or more tables or result sets on matching values. We began by defining the concept of a JOIN, and then we went into the details about forming an INNER JOIN. We discussed what is “legal” to use as the criteria for a JOIN but cautioned you about making nonsensical JOINs.

We started out simply with examples joining two tables. We next showed how to assign correlation (alias) names to tables within your FROM clause. You might want to do this for convenience—or you might be required to assign correlation names when you include the same table more than once or use an embedded SELECT statement.

We showed how to replace a reference to a table with a SELECT statement within your FROM clause. ...

Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.