Skip to main content

Joining Tables

  • Chapter
Introducing SQL Server
  • 2714 Accesses

Abstract

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 table, to list that particular contact’s phone numbers.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Mike McQuillan

About this chapter

Cite this chapter

McQuillan, M. (2015). Joining Tables. In: Introducing SQL Server. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1419-0_12

Download citation

Publish with us

Policies and ethics