Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

157


Chapter 7: Relational Database Design and Creating the Physical Database Schema


7


FIGURE 7-6
The many-to-many logical model shows multiple tuples on both ends of the relationship.

Product Special Offer

Many-to-many relationships are nearly always optional. For example, the many products-
to-many special offers relationship is optional because the product and the special offer are
each valid without the other.

The one-to-one and the one-to-many relationship can typically be constructed from items
within an organization that users can describe and understand. That’s not always the case
with many-to-many relationships.

To implement a many-to-many relationship in SQL DDL, a third table, called an associative
table (sometimes called a junction table) is used, which artifi cially creates two one-to-many
relationships between the two entities (see Figure 7-7).

FIGURE 7-7
The many-to-many implementation adds an associative table to create artifi cial one-to-many
relationships for both tables.

c07.indd 157c07.indd 157 7/30/2012 4:18:13 PM7/30/2012 4:18:13 PM


http://www.it-ebooks.info
Free download pdf