Datasheet

Building the Case Study Databases
In the rest of this book, you use some sample databases to work through the exercises in the chapters.
These sample databases should be available to you either on your machine or another machine on your
network and depend on whether you have SQL Server and/or Oracle installed.
Starting in Chapter 4, you use an Access database that you either create or download from the Wrox Web
site for this book. In Chapter 9 you start using either a SQL Server or Oracle database to complete the
rest of the exercises in this book. You can choose which database you want to use or you can use both
and create two sets of applications, one for each database.
This section covers the schemas for these databases and provides instructions for creating the databases.
In order to create these databases, you will need to download the database scripts for this book from the
Wrox Web site or manually enter the scripts as shown in the Try It Out exercises.
The application that you build starting in Chapter 4 will be a Project Time Tracker application. This
application enables employees to enter the amount of time that they spend on a variety of projects and
enables managers to view various reports to track the amount of time employees enter. Additionally, this
application provides administrative functions that enable you to manage the data for projects, groups,
and users.
As you progress through the chapters in this book, you enhance the application by adding functionality
and features. The application starts out using a Microsoft Access database so that you can learn how to
access and manage data in this type of database and using one type of ADO.NET provider. An
ADO.NET provider is a software component that exposes data and connection information from a
database to ADO.NET.
In Chapter 9 you switch over to either a SQL Server or Oracle database, depending on what you choose.
Examples from that point on are shown using both SQL Server and Oracle. This exposes you to another
type of ADO.NET provider and shows you how to access and manage data in relational databases.
Access schema
The schema shown in Figure 1-6 lists the tables that need to be created in your Access database along
with the column attributes and the primary and foreign key relationships. There are two main tables in
this schema: Groups and Projects.
Ultimately, users will be assigned to groups; thus, a Groups table has been defined. This table contains
group names, such as Finance and Human Resources. The Projects table will contain various projects
defined to be worked on. These projects will be ultimately displayed in a user’s timesheet so that they
can enter the amount of time they spend on each project.
Some projects may be applicable to multiple groups; thus, a GroupProjects table has been defined with
foreign keys pointing to the Groups and Projects tables. As you get further along in your development,
you’ll be retrieving a list of all projects assigned to a specific group from this table.
The primary keys in this schema as well as the schemas for SQL Server and Oracle will all use Guids.
This will enable you to port the data from one database to another and ensure that the primary keys
across all databases remain unique. A Guid contains a combination of 32 characters and numbers
grouped together and separated by four dashes.
15
Databases
04_58894x ch01.qxd 10/13/05 5:54 PM Page 15