Relational Databases and SQL

Although one can certainly write an entire book on relational databases, and another on SQL, the essentials of these technologies aren’t hard to understand, and you’ll understand the chapter better if we spend a little time on the basics. A database is a repository of data. A relational database organizes your data into tables. In this chapter, we’ll use the Northwind database, which is available as a free download from Microsoft. It was originally intended for a much older version of SQL Server, but it works well for our examples in this chapter without requiring too much installation work on your part.

Installing the Northwind Database

The Northwind database is a database file that’s intended for testing and practice purposes. To use the database, you’ll need to make sure that you have SQL Server Express edition. If you’re using Visual Studio, it was installed by default. If you’re using C# Express, installing SQL Server was optional, and if you followed the instructions in Chapter 1, you already have it installed. If not, head back to Chapter 1 and check out the installation instructions there.

If you’re using Windows Vista, you’re going to need to do a bit of extra work (if not, you can skip the next few paragraphs). Vista requires that only an administrator can install and access databases, but your default user isn’t automatically added to the SQL Server Administrators group. Fortunately, there’s an easy fix for this problem:

  1. Go to C:\Program Files\Microsoft ...

Get Learning C# 3.0 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.