Defining Table Relationships

In a relational database, relationships enable you to prevent redundant data from being entered. For example, when you are designing a database that tracks information about books, you might have a table named TITLES that stores information about each book, such as the book's title, date of publication, and author. You might want to store information about the author, such as the author's phone number, address, and ZIP Code. If you were to store all this information in the TITLES table, the author's phone number could be duplicated for every title that the author has written. Instead of duplicating data in a table, you could store the author information once in a separate table, AUTHOR. You could then use a key in ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with O’Reilly online learning.

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