-
Chapter 1 Pivot Tables
-
Using a Pivot Table
-
-
Chapter 2 Sets
-
Introduction
-
The Students Example
-
Implementing Set Difference
-
Comparing Two Sets for Equality
-
Implementing Partial Intersection
-
Implementing Full Intersection
-
Classifying Subsets
-
Summarizing Classes of Sets
-
Aggregating Aggregates
-
Summarizing Aggregated Classes
-
Including Nonaggregated Columns
-
Finding the Top N Values in a Set
-
Reporting the Size of a Set's Complement
-
Finding the Complement of a Set
-
Finding the Complement of a Missing Set
-
Finding Complements of Sets with Different Universes
-
Comparing a Set with Its Universe
-
Dynamic Classification System
-
-
Chapter 3 Data Structures
-
Types of Data Structures
-
Working Example
-
Finding Regions
-
Reporting Region Boundaries
-
Limiting Region Size
-
Ranking Regions by Size
-
Working with Sequences
-
Working with Runs
-
Cumulative Aggregates in Lists
-
Implementing a Stack
-
Implementing Queues
-
Implementing Priority Queues
-
Comparing Two Rows in an Array
-
Printing Matrices and Arrays
-
Transposing a Matrix
-
Calculating a Matrix Trace
-
Comparing Two Matrices for Size
-
Adding and Subtracting Matrices
-
Multiplying Matrices
-
-
Chapter 4 Hierarchies in SQL
-
Types of Hierarchies
-
Creating a Permission Hierarchy
-
Changing Individual Permissions
-
Adding New Individual Permissions
-
Centralizing Authorization Logic
-
Implementing General Hierarchies
-
Traversing Hierarchies Recursively
-
Manipulating Hierarchies Recursively
-
Aggregating Hierarchies
-
Preparing Multilevel Operations
-
Aggregating Hierarchies Revised
-
-
Chapter 5 Temporal Data
-
Introduction
-
The Schedules Example
-
Enforcing Granularity Rules
-
Storing Out-of-Range Temporal Values
-
Deriving the First and Last Dates of the Month
-
Printing Calendars
-
Calculating Durations
-
Reporting Durations
-
Querying Periods
-
Querying Periods and Respecting Granularity
-
Finding Available Periods
-
Finding Common Available Periods
-
Excluding Recurrent Events
-
Excluding Nonrecurring Events
-
Finding Continuous Periods
-
Using Calendar Information with Periods
-
Using Calendar Information with Durations
-
-
Chapter 6 Audit Logging
-
Audit Logs
-
The Warehouse Example
-
Row-Level Logging
-
Reporting Log Events
-
Generating Current Snapshots
-
Generating Time-Restricted Snapshots
-
Undoing Table Changes
-
Minimizing Audit-Log Space Consumption
-
Online Account Balancing
-
Activity-Level Logging
-
Partitioning Large Log Tables
-
Server Push
-
-
Chapter 7 Importing and Transforming Data
-
Considerations When Importing Data
-
Working Examples
-
Importing External Data
-
Importing Data into a Live System
-
Importing with a Single Procedure
-
Hiding the Import Procedure
-
Folding Tables
-
Pivoting Tables
-
Joining Arrays with Tables
-
Joining Arrays with Master Tables
-
Joining Arrays with Multiple Master Records
-
Extracting Master Records from Tables
-
Generating Master Records Online
-
Working with Duplicates
-
-
Chapter 8 Statistics in SQL
-
Statistical Concepts
-
The Light-Bulb Factory Example
-
Calculating a Mean
-
Calculating a Mode
-
Calculating a Median
-
Calculating Standard Deviation, Variance, and Standard Error
-
Building Confidence Intervals
-
Calculating Correlation
-
Exploring Patterns with Autocorrelation
-
Using a Simple Moving Average
-
Extending Moving Averages
-
-
Appendix A The T-Distribution Table
-
Colophon
- Title:
- Transact-SQL Cookbook
- By:
- Ales Spetic, Jonathan Gennick
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- March 2002
- Ebook Release:
- February 2009
- Pages:
- 304
- Print ISBN:
- 978-1-56592-756-8
- | ISBN 10:
- 1-56592-756-7
- Ebook ISBN:
- 978-0-596-10363-7
- | ISBN 10:
- 0-596-10363-8
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Transact-SQL Cookbook is a tree swift. Swifts are small, swallow-like birds related to hummingbirds. They are found all over the world, especially in the tropics. There are many different species of swifts that are specific to certain regions.
Swifts range from 3.5 to 9 inches in length. Their powerful, streamlined bodies have long wings; small, weak legs; and small feet. Swifts perch on vertical surfaces, but, due to their weak legs, once they perch, they have a difficult time returning to flight. Because of this, swifts do nearly everything on the wing, including feeding, drinking, bathing, courting, and sometimes mating. Their strong wings also make them rapid fliers.
Jeffrey Holcomb was the production editor and proofreader for Transact-SQL Cookbook . Tatiana Apandi Diaz was the copyeditor. Linley Dolby, Leanne Soylemez, and Claire Cloutier provided quality control. Phil Dangler, Leanne Soylemez, and David Chu provided production assistance. Johnna VanHoose Dinse wrote the index. Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
David Futato designed the interior layout. Neil Walls converted the files from Microsoft Word to FrameMaker 5.5.6 using tools created by Mike Sierra. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Linley Dolby.
