Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Build Your Own ASP.NET 2.0 Web Site Using CSharp And VB (2006) [eng]-1.pdf
Скачиваний:
142
Добавлен:
16.08.2013
Размер:
15.69 Mб
Скачать

Chapter 7: Database Design and Development

want to allow is the same pair of values to appear in the table twice (it wouldn’t 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 you’d 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 product’s 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. You’ve also learned how to implement and enforce table relationships, and you have a solid understanding 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