II.6.2. Relationship Types

In this section, we look at each of the relationship types that you're likely to encounter in SQL Server, along with the purpose of each relationship. Before we get started, it's useful to have a real-world example to help illustrate each type of relationship. We use this scenario when we create the relationships with SQL Server's tools.

After years working for The Man, you've decided that it's time to take control of your destiny and go into business for yourself. After a bit of soul-searching, you decide to follow your heart and open an extreme sports training school. However, without proper IT infrastructure, you know that you, your bungee cord, and your street luge gear will be back at The Man's doorstep before too long. Because you know that relational databases do an outstanding job of keeping track of vital information, you decide to use SQL Server as the core of your IT environment.

In examining the type of information you're likely to need to store in support of your new business, you identify the following major objects:

  • Student

  • Student classroom feedback

  • Class

  • Payment

  • Instructor

You decide that each of these objects needs its own table. For the purpose of this example, don't worry about adhering to relational database design principles to the letter.

Now that you've established a new business, look at how each type of relationship affects this example.

II.6.2.1. One-to-one

In this type of relationship, two given objects are bound at the hip: ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.