SQL Queries for Mere Mortals

Chapter 11 - Subqueries 
Sample files (C:\SQLQFMM\Chapter11) Read Me

This folder contains the sample databases for Chapter 11, Subqueries.  
See the Install Instructions in the ReadMe file in the root folder for instructions
about installing these files.


The files are as follows:

AttachChap11DB.SQL

If you have Microsoft SQL Server version 7 or later or have installed the trial 
edition of Microsoft SQL Server version 7 from this sample CD, you can use this 
file to attach the Chapter 11 samples to your server.  Open Query Analyzer and sign 
on to your database system (use Login Name "sa" and no password for the trial 
edition of SQL Server).  Load this file by clicking the Load SQL Script button or by 
choosing Open from the File menu.  Execute the commands by clicking the Execute 
Query button, by pressing F5, or by choosing Execute from the Query menu.  Executing 
this file attaches the files directly from this folder.  If you have Enterprise 
Manager open, you will need to click the Refresh button to see the databases.  The 
commands assume that you have copied the files to C:\SQLQFMM\Chapter11.  If you have 
installed them in a different folder or have copied them to your SQL Server DATA 
folder, you will need to edit this file in Query Analyzer or with any text editing 
program (Notepad or Wordpad work fine) to change the file locations in the commands.


Bowling League Database
-----------------------

BowlingLeagueData11.SQL

This file contains the INSERT commands to load the sample data for Chapter 11 to 
a database system other than Microsoft SQL Server or Microsoft Access 2000.  We 
used ANSI-Standard data types and syntax in all the commands.  You may need to 
edit this file to get it to work with your database system.  Consult your database
documentation for instructions about how to execute this command file.  Use the 
master BowlingLeagueTables.SQL file that you can find in the main folder to create
your tables.  See the ReadMe file in the main folder for details.


BowlingLeagueExample.mdb

This is the Microsoft Access 2000 version of the Bowling League sample database 
for Chapter 11.  It includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Queries.


BowlingLeagueExample11.mdf

This is the Microsoft SQL Server version of the database.  See the notes on 
AttachChap11DB.SQL above for instructions about how to attach this file to your 
server.  The database includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Views and Stored Procedures.


BowlingLeagueRequests11.SQL

This file contains the solutions for all the SQL requests presented as Sample 
Statements or Problems for You to Solve in Chapter 11.  Use this file to test 
the requests on a database system other than Microsoft Access 2000 or Microsoft 
SQL Server.



Entertainment Agency Database
-----------------------------

EntertainmentAgencyData11.SQL

This file contains the INSERT commands to load the sample data for Chapter 11 to 
a database system other than Microsoft SQL Server or Microsoft Access 2000.  We 
used ANSI-Standard data types and syntax in all the commands.  You may need to 
edit this file to get it to work with your database system.  Consult your database
documentation for instructions about how to execute this command file.  Use the 
master BowlingLeagueTables.SQL file that you can find in the main folder to create
your tables.  See the ReadMe file in the main folder for details.


EntertainmentAgencyExample.mdb

This is the Microsoft Access 2000 version of the Entertainment Agency sample 
database for Chapter 11.  It includes the tables loaded with sample data 
appropriate to the examples discussed in the chapter.  It also contains all the 
Sample Statements and Problems for You to Solve requests saved as Queries.


EntertainmentAgencyExample11.mdf

This is the Microsoft SQL Server version of the database.  See the notes on 
AttachChap11DB.SQL above for instructions about how to attach this file to your 
server.  The database includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Views and Stored Procedures.


EntertainmentAgencyRequests11.SQL

This file contains the solutions for all the SQL requests presented as Sample 
Statements or Problems for You to Solve in Chapter 11.  Use this file to test 
the requests on a database system other than Microsoft Access 2000 or Microsoft 
SQL Server.



Recipes Database
----------------

RecipesData11.SQL

This file contains the INSERT commands to load the sample data for Chapter 11 to 
a database system other than Microsoft SQL Server or Microsoft Access 2000.  We 
used ANSI-Standard data types and syntax in all the commands.  You may need to 
edit this file to get it to work with your database system.  Consult your database
documentation for instructions about how to execute this command file.  Use the 
master BowlingLeagueTables.SQL file that you can find in the main folder to create
your tables.  See the ReadMe file in the main folder for details.


RecipesExample.mdb

This is the Microsoft Access 2000 version of the Recipes sample database for 
Chapter 11.  It includes the tables loaded with sample data appropriate to the 
examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Queries.


RecipesExample11.mdf

This is the Microsoft SQL Server version of the database.  See the notes on 
AttachChap11DB.SQL above for instructions about how to attach this file to your 
server.  The database includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Views and Stored Procedures.


RecipesRequests11.SQL

This file contains the solutions for all the SQL requests presented as Sample 
Statements or Problems for You to Solve in Chapter 11.  Use this file to test 
the requests on a database system other than Microsoft Access 2000 or Microsoft 
SQL Server.



Sales Orders Database
---------------------

SalesOrdersData11.SQL

This file contains the INSERT commands to load the sample data for Chapter 11 to 
a database system other than Microsoft SQL Server or Microsoft Access 2000.  We 
used ANSI-Standard data types and syntax in all the commands.  You may need to 
edit this file to get it to work with your database system.  Consult your database
documentation for instructions about how to execute this command file.  Use the 
master BowlingLeagueTables.SQL file that you can find in the main folder to create
your tables.  See the ReadMe file in the main folder for details.


SalesOrdersExample.mdb

This is the Microsoft Access 2000 version of the Sales Orders sample database 
for Chapter 11.  It includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Queries.


SalesOrdersExample11.mdf

This is the Microsoft SQL Server version of the database.  See the notes on 
AttachChap11DB.SQL above for instructions about how to attach this file to your 
server.  The database includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Views and Stored Procedures.


SalesOrdersRequests11.SQL

This file contains the solutions for all the SQL requests presented as Sample 
Statements or Problems for You to Solve in Chapter 11.  Use this file to test 
the requests on a database system other than Microsoft Access 2000 or Microsoft 
SQL Server.



School Scheduling Database
--------------------------

SchoolSchedulingData11.SQL

This file contains the INSERT commands to load the sample data for Chapter 11 to 
a database system other than Microsoft SQL Server or Microsoft Access 2000.  We 
used ANSI-Standard data types and syntax in all the commands.  You may need to 
edit this file to get it to work with your database system.  Consult your database
documentation for instructions about how to execute this command file.  Use the 
master BowlingLeagueTables.SQL file that you can find in the main folder to create
your tables.  See the ReadMe file in the main folder for details.


SchoolSchedulingExample.mdb

This is the Microsoft Access 2000 version of the School Scheduling sample database 
for Chapter 11.  It includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Queries.


SchoolSchedulingExample11.mdf

This is the Microsoft SQL Server version of the database.  See the notes on 
AttachChap11DB.SQL above for instructions about how to attach this file to your 
server.  The database includes the tables loaded with sample data appropriate to 
the examples discussed in the chapter.  It also contains all the Sample Statements 
and Problems for You to Solve requests saved as Views and Stored Procedures.


SchoolSchedulingRequests11.SQL

This file contains the solutions for all the SQL requests presented as Sample 
Statements or Problems for You to Solve in Chapter 11.  Use this file to test 
the requests on a database system other than Microsoft Access 2000 or Microsoft 
SQL Server.