want to allow is the same pair of values to appear in the table twice (it wouldnt
make sense to associate a particular employee with a particular department more
than once). For this reason, we usually create mapping tables with a multi-column
primary key.
In this example, the primary key for the EmployeeDepartment table would consist
of the EmployeeID and DepartmentID columns. This enforces the uniqueness
that is appropriate to a look-up table, and prevents a particular employee from
being assigned to a particular department more than once.
If youd like to learn more about many-to-many relationships, or about anything
else related to SQL Server programming, I recommend you download and use
the products excellent documentation, SQL Server Books Online.
3
Summary
This chapter has introduced the fundamental concepts of relational databases.
You learned about the underlying structure of a modern relational database,
which is composed of tables, columns, and rows, and about crucial concepts that
can aid in database performance, maintenance, and efficiency. Youve also learned
how to implement and enforce table relationships, and you have a solid under-
standing of good relational database design.
Chapter 8 goes beyond data storage and introduces you to the language used to
access and manipulate the data you hold in your tables. That language is the
Structured Query Language, or SQL.
3
http://msdn2.microsoft.com/en-us/library/ms130214.aspx
292
Chapter 7: Database Design and Development

Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, 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.