11.1. What Is a Database?

By its simplest definition, a database is a collection of data that is arranged so it can easily be accessed, managed, and updated. For the purpose of this book, and the web sites you will build, it's also safe to assume that the data in the database is stored in an electronic format.

The most popular type of database is the relational database. It's the type of database that is frequently used in web sites and is also the type of database that is used in the remainder of the book. However, the relational database is not the only one. Other types exist, including flat-file, object-relational, and object-oriented databases, but these are less common in Internet applications.

A relational database has the notion of tables where data is stored in rows and columns, rather like a spreadsheet. Each row in a table contains the complete information about an item that is stored in the table. Each column, on the other hand, contains information about a specific property of that record.

The term relational refers to the way the different tables in the database can be related to each other. Instead of duplicating the same data over and over again, you store repeating data in its own table and then create a relationship to that data from other tables. Consider the simple table called Review in Figure 11-1. This table could store the CD or concert reviews that are presented on the Planet Wrox web site.

As you can see in Figure 11-1, each review is assigned to a musical ...

Get Beginning ASP.NET 3.5: In C# and VB 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.