From the course: Microsoft SQL Server 2022 Essential Training

Unlock this course with a free trial

Join today to access over 24,100 courses taught by industry experts.

Joining related tables

Joining related tables

- [Josh Olenslager] No discussion of SQL SELECT Statements would be complete without talking about how to view information from across multiple tables. This involves adding a JOIN to our FROM clauses in the SQL SELECT query. To review, I'm going to startup a brand new query here. I'll just type out three SELECT queries to pull all the information from the customers, orders, and products tables. I'll type out all three SELECT statements and then without highlighting any of them I'll just execute all three at once. This will show me three different results windows down below. So here we have all of the customers, then if I scroll down, I'll see all of our orders in which case we only have the one there, as well as all of the products listed down below. Now because these three tables relate to one another, we can follow the thread between the records. If I return to this middle one, that represents the orders, we can…

Contents