CHA launches tours from multiple sites, or base camps, throughout the world.. Each base camp may be responsible for multiple tours.. Database design The database design uses typical one-
Trang 1B Using the Sample Databases
the easternmost point of North Carolina’s Outer Banks, known for incredible empty beaches and the
graveyard of the Atlantic
Cape Hatteras Adventures leads wild and sometimes exotic adventures for the rich and famous From
excursions down the gnarly Gauley River in West Virginia to diving for sunken treasure off the Outer
Banks to chopping through the Amazon jungle, Cape Hatteras Adventures gets its guests there and
brings them back, often alive and well
The staff and management of CHA are outdoors folks, and their inclination to avoid the indoors shows
in the effort that’s been put into IT The customer/prospect list is maintained in Access 2000 in a
single-table database It’s used primarily for mailings The real workhorse is an Excel spreadsheet that
tracks events, tours, and tour guides in a single flat-file format In the same page, a second list tracks
customers for each event Although the spreadsheet is not a proper normalized database, it does contain
the necessary information to run the business
QuickBooks handles all financial and billing activities, and both the company president and the
bookkeeper are very satisfied with that setup They foresee no need to improve the financial or billing
software
Application requirements
CHA has grown to the point that it realizes the need for a better scheduling application; however, it
desires to ‘‘keep the tough work in the rapids and not in the computer.’’ CHA has contracted for the
development and maintenance of the database
All scheduling and booking of tours takes place at the main office in Cape Hatteras, North Carolina
CHA launches tours from multiple sites, or base camps, throughout the world The base camps generally
have no computer access and sometimes no electricity Guides are dispatched to the base camp with
a printed guest list If it’s determined in the future that a base camp may need to be staffed and have
access to the schedule online, a web page will be developed at that time
Each base camp may be responsible for multiple tours A tour is a prearranged, repeatable experience
Each time the tour is offered, it’s referred to as an event An event will have one lead guide, who is
responsible for the safety and enjoyment of the guests Other guides may also come along as needed
As CHA brings on more guides with broader skills, the database must track the guides and which tours
each one is qualified to lead
Database design
The database design uses typical one-to-many relationships between customer type and customer, and
from guide to base camp to tour to event Many-to-many relationships exist between customer and
event, guide and tour, and guide and event
Concerning the development style, there is currently no need for multiple database sites, so identity
columns will be used for simplicity of design The primary means of access to the data is through views
and directSELECTstatements
Data conversion
TheCHA2_Create.sqlscript creates an empty database The data resides in the Access and Excel
spreadsheets Both theCHA_ConversionDTS package and theCHA_Convert.sqlscript can extract
the data from Access and Excel and load it into SQL Server
Trang 2Using the Sample Databases B
CHA2.adp front end
Because the Cape Hatteras Adventures staff is comfortable with Access forms and does not require the
robustness of a full Visual Basic or NET application, a simple front end has been developed using
Access.adp project technology
OBX Kites
OBX Kites is a high-quality kite retailer serving kite enthusiasts and vacationers around the Outer Banks,
where the winds are so steady the Wright brothers chose the area (Kill Devil Hills) for their historic
glider flights and their first powered flights OBX Kites operates a main store/warehouse and four remote
retail locations and is planning to launch an e-commerce website
Application requirements
OBX Kites needs a solid and useful order/inventory/purchase order system with a middle-of-the-road
set of features For simplicity, all contacts are merged into a single table, and the contact type is
signi-fied by flags A contact can be a customer, employee, or vendor Customers have a lookup for customer
type, which is referenced in determining the discount Full details are maintained on customers,
includ-ing both a summer location and the home location The product/inventory system must handle multiple
suppliers per product, price history, multiple inventory items per product, multiple locations, and
inven-tory transactions to track inveninven-tory movement
Database design
The database design uses standard one-to-many relationships throughout
The database construction must support replication and Unicode for international customers For
per-formance and flexibility, the database implements two filegroups — one for heavy transactions and the
other for static read-mostly data
The database design is a standard inventory, order-processing database
The Family
This small database demonstrates multiple hierarchical reflexive relationships for interesting queries and
both cursors and queries to navigate the genealogical hierarchy
Application requirements
The Family database must store every person in the family, along with genealogical information,
includ-ing both biological and marital relationships The database is populated with five generations of a
ficti-tious family for query purposes
Database design
The Family database consists of two tables and three relationships, as configured in the Database
Designer Each person has an optional reflexiveMotherIDandFatherIDforeign key back to the
PersonID Themarriagetable has a foreign key to thePersonIDfor the husband and the wife The
primary keys are integer columns for simplicity
Trang 3B Using the Sample Databases
Aesop’s Fables
Aesop’s collection of fables is an excellent test bed for string searches and full-text search The fables are
relatively short and familiar, and they’re in the public domain
Application requirements
The primary purpose of this database is to enable you to experience SQL Server’s full-text search
Therefore, the database must include a few character columns, a BLOB or image column, and a
BLOC-type column
Database design
The database design is very simple — a single table with one fable per row
Trang 4Nielsen White & Parui
Get ready for SQL Server 2008
Whether you’re a database developer, DBA, or BI
Developer, SQL Server 2008 promises to change the
way you deliver enterprise data solutions Open this
detailed, experience-based guide for clear explanations
of the concepts balanced with real-world examples and
best practices gleaned from years of field and consulting
experience SQL Server is an immense product — this
book is your guide to the strategies and details that
matter most.
• Master the data architecture concepts that drive database technologies
• Write elegant set-based queries that respond well to a comprehensive
indexing strategy
• Code an efficient and robust data abstraction layer with stored procedures
• Learn the best way to connect to SQL Server with ADO or Microsoft Access®
• Use PowerShell and Policy-based Management to better administer
your servers
• Use Analysis Services, MDX, and Excel® to analyze data trends
• Optimize performance with data compression, resource governor,
and partitioning
Companion Web Site
Please visit www.sqlserverbible.com
to download all the sample databases and code, watch screencasts that walk through key features, sign up for the SQL Server Bible eNewsletter, find additional SQL Server utilities and samples, and find out about the authors’ seminars and speaking schedules
Paul Nielsen, Microsoft MVP, with Mike White and Uttam Parui
Foreword by Kalen Delaney
Shelving Category:
COMPUTERS / Database Management / General
Reader Level:
Beginning to Advanced
www.wiley.com/compbooks
Manage enterprise
data servers with ease
Develop scalable
and flexible databases
Analyze data with
SQL Server’s BI Suite
2008
t ®
experience with this product into every page of the SQL Server 2008 Bible.”
—Kalen Delaney, SQL Server MVP