Inside Microsoft SQL Server 2005: The Storage Engine (Solid Quality Learning)

Prior to SQL Server 2005, the installation program automatically installed sample databases so you would have some actual data for exploring SQL Server functionality. As part of Microsoft's efforts to tighten security, SQL Server 2005 does not automatically install any sample databases. However, three sample databases are widely available.

AdventureWorks

The AdventureWorks database was created by the Microsoft User Education group as an example of what a "real" database might look like. It is an optional component that you can choose to install during the installation process. The database was designed to showcase SQL Server 2005 features, in particular the organization of objects into different schemas. The design is also highly normalized. While normalized data and many separate schemas might closely map to a real production database's design, they can make it quite difficult to write and test simple queries and to learn basic SQL.

Database design is not a major focus of this book, so most of my examples will use simple tables that I create; if more than a few rows of data are needed, I'll copy data from one or more AdventureWorks tables into tables of my own. It's a good idea to become familiar with the design of the AdventureWorks database because many of the examples in Books Online and in white papers published on the Microsoft Web site use data from this database. Note that it is also possible to install an AdventureWorksDW database, which includes data and features relevant to a data warehouse as well as SQL Server 2005 data warehousing features. I will not discuss that database in this book.

pubs

The pubs database is a sample database that was used extensively in earlier versions of SQL Server. Many older publications with SQL Server examples assume that you have this database because it was automatically installed on versions of SQL Server prior to SQL Server 2005. You can download a script for building this database from Microsoft's Web site, and I have also included the script with this book's companion content.

The pubs database is admittedly simple, but that's a feature, not a drawback. It provides good examples without a lot of peripheral issues to obscure the central points. You shouldn't worry about making modifications in the pubs database as you experiment with SQL Server features. You can completely rebuild the pubs database from scratch by running the supplied script. In a query window, open the file named Instpubs.sql and execute it. Make sure there are no current connections to pubs, because the current pubs database is dropped before the new one is created.

Northwind

The Northwind database is a sample database that was originally developed for use with Microsoft Access. Much of the preSQL Server 2005 documentation dealing with APIs uses Northwind. Northwind is a bit more complex than pubs, and, at almost 4 MB, it is slightly larger. As with pubs, you can download a script from the Microsoft Web site to build it, or you can use the script provided with the companion content. The file is called Instnwnd.sql.

Категории