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 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.