CHAPTER 12
Joining Tables
Up to this point, all of our SELECT statements have used the Contacts table. This may seem thrilling enough, but we’re about to take the octane level up to Jason Statham movie territory. The Contacts table we’ve been looking at doesn’t offer us much information—really, just the name and date of birth. If we wanted to phone a contact, how would we identify that contact’s phone number? Based on the approach we’ve used so far, we could write a SELECT to find a record in the Contacts table using FirstName and LastName. From there, we could make a note of the ContactId and then use this to write a SELECT against the ContactPhoneNumbers ...
Get Introducing SQL Server 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.