100% found this document useful (1 vote)
7 views

SQL Server Analytical Toolkit: Using Windowing, Analytical, Ranking, and Aggregate Functions for Data and Statistical Analysis 1st Edition Angelo Bobak instant download

The document is a promotional description for the book 'SQL Server Analytical Toolkit' by Angelo Bobak, which focuses on using windowing, analytical, ranking, and aggregate functions for data and statistical analysis. It includes links for downloading the book and mentions other related titles available on the same website. The book covers various SQL functions and their applications in data analysis, along with performance considerations.

Uploaded by

eusopemukmin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
7 views

SQL Server Analytical Toolkit: Using Windowing, Analytical, Ranking, and Aggregate Functions for Data and Statistical Analysis 1st Edition Angelo Bobak instant download

The document is a promotional description for the book 'SQL Server Analytical Toolkit' by Angelo Bobak, which focuses on using windowing, analytical, ranking, and aggregate functions for data and statistical analysis. It includes links for downloading the book and mentions other related titles available on the same website. The book covers various SQL functions and their applications in data analysis, along with performance considerations.

Uploaded by

eusopemukmin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

SQL Server Analytical Toolkit: Using Windowing,

Analytical, Ranking, and Aggregate Functions for


Data and Statistical Analysis 1st Edition Angelo
Bobak pdf download
https://ebookmeta.com/product/sql-server-analytical-toolkit-
using-windowing-analytical-ranking-and-aggregate-functions-for-
data-and-statistical-analysis-1st-edition-angelo-bobak/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

SQL Server Analytical Toolkit: Using Windowing,


Analytical, Ranking, and Aggregate Functions for Data
and Statistical Analysis 1st Edition Angelo Bobak

https://ebookmeta.com/product/sql-server-analytical-toolkit-
using-windowing-analytical-ranking-and-aggregate-functions-for-
data-and-statistical-analysis-1st-edition-angelo-bobak/

Cambridge IGCSE and O Level History Workbook 2C - Depth


Study: the United States, 1919-41 2nd Edition Benjamin
Harrison

https://ebookmeta.com/product/cambridge-igcse-and-o-level-
history-workbook-2c-depth-study-the-united-states-1919-41-2nd-
edition-benjamin-harrison/

Mathematical Analysis and Analytical Modeling 1st


Edition Ivan Stanimirovic■

https://ebookmeta.com/product/mathematical-analysis-and-
analytical-modeling-1st-edition-ivan-stanimirovic/

Good Son is Sad If He Hears the Name of His Father The


Tabooing of Names in China as a Way of Implementing
Social Values 1st Edition Piotr Adamek

https://ebookmeta.com/product/good-son-is-sad-if-he-hears-the-
name-of-his-father-the-tabooing-of-names-in-china-as-a-way-of-
implementing-social-values-1st-edition-piotr-adamek/
Museum Store the Manager s Guide Basic Guidelines for
the New Museum Store Manager 4th Edition Museum Store
Association (U.S.)

https://ebookmeta.com/product/museum-store-the-manager-s-guide-
basic-guidelines-for-the-new-museum-store-manager-4th-edition-
museum-store-association-u-s/

PYRO Sons of Hell MC Sons of Hell M C Book 3 1st


Edition Rebecca Joyce

https://ebookmeta.com/product/pyro-sons-of-hell-mc-sons-of-hell-
m-c-book-3-1st-edition-rebecca-joyce/

Dirty Secret A Dark Enemies to Lovers Mafia Romance 1st


Edition Bianca Cole

https://ebookmeta.com/product/dirty-secret-a-dark-enemies-to-
lovers-mafia-romance-1st-edition-bianca-cole/

A Touch Of Envy Vices Virtues 1st Edition Alana Winters

https://ebookmeta.com/product/a-touch-of-envy-vices-virtues-1st-
edition-alana-winters/

Only Pieces 1st Edition Edd Tello

https://ebookmeta.com/product/only-pieces-1st-edition-edd-tello/
Optimization of Integer/Fractional Order Chaotic
Systems by Metaheuristics and their Electronic
Realization 1st Edition Esteban Tlelo-Cuautle

https://ebookmeta.com/product/optimization-of-integer-fractional-
order-chaotic-systems-by-metaheuristics-and-their-electronic-
realization-1st-edition-esteban-tlelo-cuautle/
SQL Server Analytical
Toolkit
Using Windowing, Analytical,
Ranking, and Aggregate Functions
for Data and Statistical Analysis

Angelo Bobak
SQL Server Analytical Toolkit: Using Windowing, Analytical, Ranking, and Aggregate
Functions for Data and Statistical Analysis
Angelo Bobak
Hastings On Hudson, NY, USA

ISBN-13 (pbk): 978-1-4842-8666-1 ISBN-13 (electronic): 978-1-4842-8667-8


https://doi.org/10.1007/978-1-4842-8667-8

Copyright © 2023 by Angelo Bobak


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Joan Murray
Development Editor: Laura Berendson
Coordinating Editor: Gryffin Winkler
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media LLC, 1 New York Plaza,
Suite 4600, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-
sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member
(owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a
Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub.
Paper in this product is recyclable
I would like to dedicate this book to my wife, Cathy, for all her support
and patience throughout my career and all my book projects. I would
like to thank Apress for this opportunity, specifically Joan Murray, the
acquisition editor, who gave me this chance and Laura Berendson
and Gryffin Winkler for their valuable help and suggestions.
Last but not least, I thank all the technical reviewers for their
suggestions, tips, and corrections. What’s good about this book is
because of them. What’s not so good is entirely due to me!
Table of Contents
About the Author�����������������������������������������������������������������������������������������������������xv

About the Technical Reviewer�������������������������������������������������������������������������������xvii


Introduction������������������������������������������������������������������������������������������������������������xix

Chapter 1: Partitions, Frames, and the OVER( ) Clause��������������������������������������������� 1


What Are Partitions and Window Frames?������������������������������������������������������������������������������������ 1
What Is an OVER( ) Clause?����������������������������������������������������������������������������������������������������������� 2
History of the OVER( ) Clause and Window Functions������������������������������������������������������������������� 2
The Window Functions������������������������������������������������������������������������������������������������������������������ 3
The OVER( ) Clause������������������������������������������������������������������������������������������������������������������������ 4
Syntax������������������������������������������������������������������������������������������������������������������������������������������� 4
Partitions and Frames������������������������������������������������������������������������������������������������������������������� 6
ROWS Frame Definition����������������������������������������������������������������������������������������������������������������� 8
RANGE Frame Definition������������������������������������������������������������������������������������������������������������� 16
Example 1����������������������������������������������������������������������������������������������������������������������������������� 19
ROWS and RANGE Default Behavior�������������������������������������������������������������������������������������������� 23
Scenario 1����������������������������������������������������������������������������������������������������������������������������� 24
Scenario 2����������������������������������������������������������������������������������������������������������������������������� 24
ROWS and RANGE Window Frame Examples������������������������������������������������������������������������������ 25
Data Set��������������������������������������������������������������������������������������������������������������������������������� 25
Example 2������������������������������������������������������������������������������������������������������������������������������ 29
Example 3������������������������������������������������������������������������������������������������������������������������������ 32
Example 4������������������������������������������������������������������������������������������������������������������������������ 34
Example 5������������������������������������������������������������������������������������������������������������������������������ 38
Summary������������������������������������������������������������������������������������������������������������������������������������ 40

v
Table of Contents

Chapter 2: Sales DW Use Case: Aggregate Functions��������������������������������������������� 43


Sales Data Warehouse���������������������������������������������������������������������������������������������������������������� 43
Sales Data Warehouse Conceptual Model����������������������������������������������������������������������������������� 45
A Word About Performance Tuning���������������������������������������������������������������������������������������������� 50
Aggregate Functions������������������������������������������������������������������������������������������������������������������� 60
COUNT( ), MAX( ), MIN( ), AVG( ), and SUM( ) Functions����������������������������������������������������������� 61
With OVER( )��������������������������������������������������������������������������������������������������������������������������� 63
GROUPING( ) Function������������������������������������������������������������������������������������������������������������ 67
GROUPING: Performance Tuning Considerations������������������������������������������������������������������� 71
STRING_AGG Function����������������������������������������������������������������������������������������������������������� 77
STDEV( ) and STDEVP( ) Functions����������������������������������������������������������������������������������������� 80
STDEV: Performance Tuning Considerations�������������������������������������������������������������������������� 85
VAR( ) and VARP( ) Functions�������������������������������������������������������������������������������������������������� 91
SQL Server 2022: Named Window Example�������������������������������������������������������������������������������� 95
Summary���������������������������������������������������������������������������������������������������������������������������������� 103

Chapter 3: Sales Use Case: Analytical Functions������������������������������������������������� 105


Analytical Functions������������������������������������������������������������������������������������������������������������������ 105
CUME_DIST( ) Function�������������������������������������������������������������������������������������������������������� 106
Performance Considerations����������������������������������������������������������������������������������������������� 112
PERCENT_RANK( ) Function������������������������������������������������������������������������������������������������� 117
Performance Considerations����������������������������������������������������������������������������������������������� 124
High-Performance Strategy������������������������������������������������������������������������������������������������� 127
LAST_VALUE( ) and FIRST_VALUE( )������������������������������������������������������������������������������������� 134
Performance Considerations����������������������������������������������������������������������������������������������� 137
LAG( ) and LEAD( )���������������������������������������������������������������������������������������������������������������� 140
Performance Considerations����������������������������������������������������������������������������������������������� 142
PERCENTILE_CONT( ) and PERCENTILE_DISC( )������������������������������������������������������������������� 147
Performance Considerations����������������������������������������������������������������������������������������������� 152
Using a Report Table������������������������������������������������������������������������������������������������������������ 157
Summary���������������������������������������������������������������������������������������������������������������������������������� 163

vi
Table of Contents

Chapter 4: Sales Use Case: Ranking/Window Functions�������������������������������������� 165


Ranking/Window Functions������������������������������������������������������������������������������������������������������ 165
RANK( ) vs. PERCENT_RANK( )��������������������������������������������������������������������������������������������� 171
Performance Considerations����������������������������������������������������������������������������������������������� 175
RANK( ) vs. DENSE_RANK( )������������������������������������������������������������������������������������������������� 179
Performance Considerations����������������������������������������������������������������������������������������������� 183
NTILE( ) Function Revisited�������������������������������������������������������������������������������������������������� 185
Performance Considerations����������������������������������������������������������������������������������������������� 188
ROW_NUMBER( ) Function��������������������������������������������������������������������������������������������������� 190
Performance Considerations����������������������������������������������������������������������������������������������� 194
Islands and Gaps Example��������������������������������������������������������������������������������������������������� 201
Summary���������������������������������������������������������������������������������������������������������������������������������� 209

Chapter 5: Finance Use Case: Aggregate Functions��������������������������������������������� 211


Aggregate Functions����������������������������������������������������������������������������������������������������������������� 211
COUNT( ) and SUM( ) Functions�������������������������������������������������������������������������������������������� 217
Performance Considerations����������������������������������������������������������������������������������������������� 226
SUM( ) Function������������������������������������������������������������������������������������������������������������������� 234
Performance Considerations����������������������������������������������������������������������������������������������� 238
MIN( ) and MAX( ) Functions������������������������������������������������������������������������������������������������� 244
Performance Considerations����������������������������������������������������������������������������������������������� 250
AVG( ) Function�������������������������������������������������������������������������������������������������������������������� 258
Performance Considerations����������������������������������������������������������������������������������������������� 264
GROUPING Function������������������������������������������������������������������������������������������������������������� 267
Performance Considerations����������������������������������������������������������������������������������������������� 272
STRING_AGG( ) Function������������������������������������������������������������������������������������������������������ 277
STDEV( ) and STDEVP( ) Functions��������������������������������������������������������������������������������������� 278
Performance Considerations����������������������������������������������������������������������������������������������� 286
VAR( ) and VARP( ) Functions������������������������������������������������������������������������������������������������ 297
Ticker Analysis�������������������������������������������������������������������������������������������������������������������������� 302

vii
Table of Contents

More Non-statistical Variance��������������������������������������������������������������������������������������������� 305


Even More Statistical Variance�������������������������������������������������������������������������������������������� 308
Summary���������������������������������������������������������������������������������������������������������������������������������� 311

Chapter 6: Finance Use Case: Ranking Functions������������������������������������������������ 313


Ranking Functions�������������������������������������������������������������������������������������������������������������������� 313
RANK( ) Function������������������������������������������������������������������������������������������������������������������ 314
DENSE_RANK( ) Function����������������������������������������������������������������������������������������������������� 341
NTILE( ) Function������������������������������������������������������������������������������������������������������������������ 355
ROW_NUMBER( ) Function��������������������������������������������������������������������������������������������������� 370
The Data Gaps and Islands Problem����������������������������������������������������������������������������������������� 377
Step 1: Create the First CTE������������������������������������������������������������������������������������������������� 383
Step 2: Set Up the Second CTE to Label Gaps��������������������������������������������������������������������� 386
Step 3: Set Up the Third CTE and Identify Start/Stop Dates of Gaps����������������������������������� 388
Step 4: Generate the Report������������������������������������������������������������������������������������������������ 390
Performance Considerations����������������������������������������������������������������������������������������������� 392
Islands Next������������������������������������������������������������������������������������������������������������������������������ 395
Step 1: Create the First CTE Using LAG( ) and LEAD( )��������������������������������������������������������� 395
Step 2: Create the Second CTE That Labels Islands and Gaps�������������������������������������������� 397
Step 3: Identify Island Start/Stop Dates������������������������������������������������������������������������������� 402
Step 4: Create the Final Report�������������������������������������������������������������������������������������������� 404
Summary���������������������������������������������������������������������������������������������������������������������������������� 408

Chapter 7: Finance Use Case: Analytical Functions���������������������������������������������� 409


Analytical Functions������������������������������������������������������������������������������������������������������������������ 409
CUME_DIST( ) Function�������������������������������������������������������������������������������������������������������� 410
Performance Considerations����������������������������������������������������������������������������������������������� 416
FIRST_VALUE( ) and LAST_VALUE( ) Functions��������������������������������������������������������������������� 420
Performance Considerations����������������������������������������������������������������������������������������������� 424
LAG( ) and LEAD( ) Functions������������������������������������������������������������������������������������������������ 431
LAG( ) Function��������������������������������������������������������������������������������������������������������������������� 431
Performance Considerations����������������������������������������������������������������������������������������������� 435
LEAD( ) Function������������������������������������������������������������������������������������������������������������������ 440

viii
Table of Contents

Performance Considerations����������������������������������������������������������������������������������������������� 442


Memory-Optimized Strategy����������������������������������������������������������������������������������������������� 445
PERCENT_RANK( ) Function������������������������������������������������������������������������������������������������� 450
Performance Considerations����������������������������������������������������������������������������������������������� 453
PERCENTILE_CONT( ) and PERCENTILE_DISC( )������������������������������������������������������������������� 455
PERCENTILE_CONT( )����������������������������������������������������������������������������������������������������������� 455
Performance Considerations����������������������������������������������������������������������������������������������� 459
PERCENTILE_DISC Function������������������������������������������������������������������������������������������������ 462
Performance Considerations����������������������������������������������������������������������������������������������� 465
Multi-memory-enhanced-table Strategy����������������������������������������������������������������������������� 471
Performance Considerations����������������������������������������������������������������������������������������������� 476
Summary���������������������������������������������������������������������������������������������������������������������������������� 482

Chapter 8: Plant Use Case: Aggregate Functions������������������������������������������������� 483


Aggregate Functions����������������������������������������������������������������������������������������������������������������� 484
Data Model�������������������������������������������������������������������������������������������������������������������������������� 485
Data Dictionaries����������������������������������������������������������������������������������������������������������������������� 489
Entity Data Dictionary���������������������������������������������������������������������������������������������������������� 489
Entity Attribute Data Dictionary������������������������������������������������������������������������������������������� 491
Entity Relationship Data Dictionary: Equipment Failure Subject Area��������������������������������� 498
Entity Relationship Data Dictionary: Equipment Status History������������������������������������������� 500
Entity Relationship Data Dictionary: Plant Expense������������������������������������������������������������� 500
COUNT( ) Function��������������������������������������������������������������������������������������������������������������������� 501
AVG( ) Function��������������������������������������������������������������������������������������������������������������������� 512
MIN( ) and MAX( ) Functions������������������������������������������������������������������������������������������������� 514
GROUPING( ) Function���������������������������������������������������������������������������������������������������������� 526
STRING_AGG( ) Function������������������������������������������������������������������������������������������������������ 530
STDEV( ) and STDEVP( ) Functions���������������������������������������������������������������������������������������� 534
VAR( ) and VARP( ) Functions������������������������������������������������������������������������������������������������������ 543
Example 1: Rolling Variance������������������������������������������������������������������������������������������������ 544
Example 2: Variance by Quarter������������������������������������������������������������������������������������������� 547
Example 3: Variance by Year������������������������������������������������������������������������������������������������ 550

ix
Table of Contents

Performance Considerations����������������������������������������������������������������������������������������������������� 553


Memory-Optimized Table Approach������������������������������������������������������������������������������������� 559
Seven-Million-Row Query: Performance Tuning����������������������������������������������������������������������� 570
Summary���������������������������������������������������������������������������������������������������������������������������������� 582

Chapter 9: Plant Use Case: Ranking Functions����������������������������������������������������� 583


Ranking Functions�������������������������������������������������������������������������������������������������������������������� 583
RANK( ) Function������������������������������������������������������������������������������������������������������������������ 584
Performance Considerations����������������������������������������������������������������������������������������������� 588
Performance Considerations����������������������������������������������������������������������������������������������� 594
Performance Considerations����������������������������������������������������������������������������������������������� 600
DENSE_RANK( ) Function����������������������������������������������������������������������������������������������������� 606
Performance Considerations����������������������������������������������������������������������������������������������� 611
NTILE Function��������������������������������������������������������������������������������������������������������������������� 616
Performance Considerations����������������������������������������������������������������������������������������������� 622
ROW_NUMBER( ) Function��������������������������������������������������������������������������������������������������� 626
Performance Considerations����������������������������������������������������������������������������������������������� 630
Summary���������������������������������������������������������������������������������������������������������������������������������� 633

Chapter 10: Plant Use Case: Analytical Functions������������������������������������������������ 635


Analytical Functions������������������������������������������������������������������������������������������������������������������ 635
CUME_DIST( ) Function�������������������������������������������������������������������������������������������������������� 637
Performance Considerations����������������������������������������������������������������������������������������������� 643
FIRST_VALUE( ) and LAST_VALUE( ) Functions��������������������������������������������������������������������� 648
Performance Considerations����������������������������������������������������������������������������������������������� 651
LAG( ) Function��������������������������������������������������������������������������������������������������������������������� 652
Performance Considerations����������������������������������������������������������������������������������������������� 656
LEAD( ) Function������������������������������������������������������������������������������������������������������������������ 665
Performance Considerations����������������������������������������������������������������������������������������������� 667
PERCENT_RANK( ) Function������������������������������������������������������������������������������������������������� 669
Performance Considerations����������������������������������������������������������������������������������������������� 671
PERCENTILE_CONT Function����������������������������������������������������������������������������������������������� 677
Performance Considerations����������������������������������������������������������������������������������������������� 680

x
Table of Contents

PERCENTILE_DISC( ) Function���������������������������������������������������������������������������������������������� 685


Performance Considerations����������������������������������������������������������������������������������������������� 688
Our Usual Report Table Solution������������������������������������������������������������������������������������������ 692
SQL Server Analysis Services��������������������������������������������������������������������������������������������������� 697
Summary���������������������������������������������������������������������������������������������������������������������������������� 714

Chapter 11: Inventory Use Case: Aggregate Functions���������������������������������������� 717


The Inventory Database������������������������������������������������������������������������������������������������������������ 717
The Inventory Data Warehouse������������������������������������������������������������������������������������������������� 719
Loading the Inventory Data Warehouse������������������������������������������������������������������������������������ 721
Aggregate Functions����������������������������������������������������������������������������������������������������������������� 735
COUNT( ), SUM( ), MAX( ), MIN( ), and AVG( ) Functions��������������������������������������������������������� 735
Performance Considerations����������������������������������������������������������������������������������������������� 739
AVG( ) Function�������������������������������������������������������������������������������������������������������������������� 743
Performance Considerations����������������������������������������������������������������������������������������������� 745
Data Warehouse Query�������������������������������������������������������������������������������������������������������� 747
Performance Considerations����������������������������������������������������������������������������������������������� 750
STDEV( ) Function���������������������������������������������������������������������������������������������������������������� 754
Performance Considerations����������������������������������������������������������������������������������������������� 758
Data Warehouse Query�������������������������������������������������������������������������������������������������������� 760
Performance Considerations����������������������������������������������������������������������������������������������� 764
VAR( ) Function��������������������������������������������������������������������������������������������������������������������� 766
Performance Considerations����������������������������������������������������������������������������������������������� 769
Enhancing the SSIS Package���������������������������������������������������������������������������������������������������� 772
Summary���������������������������������������������������������������������������������������������������������������������������������� 783

Chapter 12: Inventory Use Case: Ranking Functions�������������������������������������������� 785


Ranking Functions�������������������������������������������������������������������������������������������������������������������� 786
RANK( ) Function������������������������������������������������������������������������������������������������������������������ 786
Performance Considerations����������������������������������������������������������������������������������������������� 791
Querying the Data Warehouse��������������������������������������������������������������������������������������������� 796
DENSE_RANK( ) Function����������������������������������������������������������������������������������������������������� 802
Performance Considerations����������������������������������������������������������������������������������������������� 805
xi
Table of Contents

NTILE( ) Function������������������������������������������������������������������������������������������������������������������ 809


Performance Considerations����������������������������������������������������������������������������������������������� 813
ROW_NUMBER( ) Function��������������������������������������������������������������������������������������������������� 818
Performance Considerations����������������������������������������������������������������������������������������������� 823
Create an SSRS Report������������������������������������������������������������������������������������������������������������� 824
Report Builder Mini Tutorial������������������������������������������������������������������������������������������������� 828
Create a Power BI Report���������������������������������������������������������������������������������������������������� 855
Summary���������������������������������������������������������������������������������������������������������������������������������� 867

Chapter 13: Inventory Use Case: Analytical Functions����������������������������������������� 869


Analytical Functions������������������������������������������������������������������������������������������������������������������ 869
CUME_DIST( ) Function�������������������������������������������������������������������������������������������������������� 870
Performance Considerations����������������������������������������������������������������������������������������������� 876
FIRST_VALUE( ) and LAST_VALUE( ) Functions��������������������������������������������������������������������� 878
Performance Considerations����������������������������������������������������������������������������������������������� 883
LAG( ) Function��������������������������������������������������������������������������������������������������������������������� 885
Performance Considerations����������������������������������������������������������������������������������������������� 889
LEAD( ) Function������������������������������������������������������������������������������������������������������������������ 894
Performance Considerations����������������������������������������������������������������������������������������������� 900
PERCENT_RANK( ) Function������������������������������������������������������������������������������������������������� 907
Performance Considerations����������������������������������������������������������������������������������������������� 912
PERCENTILE_CONT( ) Function�������������������������������������������������������������������������������������������� 914
Performance Considerations����������������������������������������������������������������������������������������������� 919
PERCENTILE_DISC( ) Function���������������������������������������������������������������������������������������������� 925
Performance Considerations����������������������������������������������������������������������������������������������� 929
Overall Performance Considerations����������������������������������������������������������������������������������� 935
Report Builder Examples����������������������������������������������������������������������������������������������������������� 939
Summary���������������������������������������������������������������������������������������������������������������������������������� 947

Chapter 14: Summary, Conclusions, and Next Steps�������������������������������������������� 949


Summary���������������������������������������������������������������������������������������������������������������������������������� 949
Our Journey������������������������������������������������������������������������������������������������������������������������������ 949
About the Code�������������������������������������������������������������������������������������������������������������������������� 950
xii
Table of Contents

About the Database Folders������������������������������������������������������������������������������������������������������ 952


Data Used in the Examples������������������������������������������������������������������������������������������������������� 952
The Toolkit��������������������������������������������������������������������������������������������������������������������������������� 953
SQL Server�������������������������������������������������������������������������������������������������������������������������������� 954
SSMS���������������������������������������������������������������������������������������������������������������������������������������� 956
The Window Functions�������������������������������������������������������������������������������������������������������������� 959
The Visual Studio Community License�������������������������������������������������������������������������������������� 960
SSAS Projects���������������������������������������������������������������������������������������������������������������������� 962
SSIS Projects����������������������������������������������������������������������������������������������������������������������� 963
Power BI Web Scorecards, Dashboards, and Reports��������������������������������������������������������������� 964
Microsoft Excel Spreadsheets�������������������������������������������������������������������������������������������������� 965
SSAS Server������������������������������������������������������������������������������������������������������������������������������ 966
SSRS Server and Website��������������������������������������������������������������������������������������������������������� 968
Report Builder��������������������������������������������������������������������������������������������������������������������������� 970
Performance Analysis Tools������������������������������������������������������������������������������������������������������ 971
Estimated Query Plans�������������������������������������������������������������������������������������������������������� 972
Live Query Plans������������������������������������������������������������������������������������������������������������������ 973
DBCC������������������������������������������������������������������������������������������������������������������������������������ 974
IO and TIME Statistics���������������������������������������������������������������������������������������������������������� 974
STATISTICS PROFILE������������������������������������������������������������������������������������������������������������ 975
Where to Get the Tools�������������������������������������������������������������������������������������������������������������� 977
SQL Server Developer���������������������������������������������������������������������������������������������������������� 977
Visual Studio Community����������������������������������������������������������������������������������������������������� 978
SQL Server Data Tools��������������������������������������������������������������������������������������������������������� 979
SQL Server SSAS Project Support��������������������������������������������������������������������������������������� 980
SQL Server SSIS Project Support���������������������������������������������������������������������������������������� 981
SQL Server SSRS Project Support��������������������������������������������������������������������������������������� 982
Report Builder���������������������������������������������������������������������������������������������������������������������� 983
Power BI Desktop���������������������������������������������������������������������������������������������������������������� 984
Power BI Server������������������������������������������������������������������������������������������������������������������� 985

xiii
Table of Contents

Microsoft Excel�������������������������������������������������������������������������������������������������������������������� 986


SSMS����������������������������������������������������������������������������������������������������������������������������������� 987
Next Steps��������������������������������������������������������������������������������������������������������������������������������� 988
Thank You!�������������������������������������������������������������������������������������������������������������������������������� 988

Appendix A: Function Syntax, Descriptions���������������������������������������������������������� 989

Appendix B: Statistical Functions����������������������������������������������������������������������� 1009

Index������������������������������������������������������������������������������������������������������������������� 1035

xiv
About the Author
Angelo R. Bobak is a published author with more than three
decades of experience and expertise in the areas of business
intelligence, data architecture, data warehouse design, data
modeling, master data management, and data quality using
the Microsoft BI Stack across several industry sectors such as
finance, telecommunications, engineering, publishing, and
automotive.

xv
Exploring the Variety of Random
Documents with Different Content
Mrs. Jesse M. Overton
Mrs. Fred Russell
Mrs. Laird Smith
Mrs. William H. Wemyss
Mrs. John Reid Woodward

ELECTED MAY, 1963

Mrs. A. MacDowell Smith, Regent


Mrs. William P. Cooper, First Vice-Regent
Mrs. E. W. Graham, Second Vice-Regent
Mrs. Roy C. Avery, Treasurer
Mrs. Horatio Buntin, Recording Secretary
Miss Martha Lindsey, Corresponding Secretary
Mrs. George M. Blackie
Miss Marian Craig
Mrs. Paul E. DeWitt
Mrs. Edgar M. Foster
Mrs. Henry Goodpasture
Mrs. Douglas Henry
Mrs. Marvin E. Holderness
Mrs. Gilbert S. Merritt
Mrs. Jesse M. Overton
Mrs. Fred Russell
Mrs. Laird Smith
Mrs. William H. Wemyss
Mrs. John Reid Woodward
Mrs. Douglas M. Wright

64

Publications Sold By The Ladies’ Hermitage


Association
Guide Book (Catalogue, Historical Data, Pictures)
25 Cents
The Hermitage, Home of Old Hickory, $3.95
Stanley F. Horn
Andrew Jackson’s Hermitage, $1.50
Mary French Caldwell
The Battle of New Orleans, Its Real Meaning, 35 Cents
Reau E. Folk
Mr. Bancroft’s Oration on the death of Andrew Jackson
25 Cents
Preservation of the Hermitage, $2.00
Mrs. Mary C. Dorris
Rachel Jackson, 35 Cents
Mrs. Walter Stokes
Advice to Jackson from His Mother
illuminated, 25 Cents
Andrew Jackson, Man of Destiny, 10 Cents
William E. Beard
President’s Lady, $3.95
Irving Stone
Historical Homes of the Old South (Drawings)
75 Cents
The Hermitage, 50 Cents
Stanley F. Horn
Constitution of the United States, Declaration of Independence
Historical Facts and Data
30 Cents
Historic Documents; Declaration of Independence, Constitution of
United States, Bill of Rights, Lincoln’s Gettysburg Address
$1.00
Andrew Jackson and Freemasonry, By Dr. Paul E. DeWitt
25c
Various Postcards and Slides

FOR YOUNG READERS


Andrew Jackson, $2.50
Genevieve Foster
Rachel Jackson, Tennessee Girl, $1.95
Christine Noble Govan
The Jacksons of Tennessee, $2.95
Marguerite Vance
Andrew Jackson, The Fighting Frontiersman, $1.75
Frances Fitzpatrick Wright
Sam Houston, Fighter and Leader, $1.75
Frances Fitzpatrick Wright
Andrew Jackson, Frontier Statesman, $3.50
Clara Ingram Judson

65

Books and Pamphlets on Andrew Jackson


IN THE STATE LIBRARY DIVISION OF TENNESSEE STATE
LIBRARY AND ARCHIVES

Author Title Date of


Publication
Jackson, Andrew Correspondence, 7 vols., ed. by 1926-35
John S. Bassett
An American Officer Civil and Military History of 1825
Andrew Jackson
Bassett, John S. The Life of Andrew Jackson, 2 1911
vols.
Bowers, Claude G. Party Battles of the Jackson 1922
Period
Brady, Cyrus T. The True Andrew Jackson 1906
Brown, William G. Andrew Jackson 1900
Buell, Augustus G. History of Andrew Jackson 1904
Campbell, Tom W. Two Fighters and Two Fines 1941
Citizen of New York Memoirs of General Andrew 1845
Jackson
Cobbett, William Life of Andrew Jackson 1834
Colyar, Arthur St. C. Life and Times of Andrew 1904
Jackson
Dusenbery, Ben M. Monument to the Memory of 1845
Gen. Jackson
Eaton, John H. The Life of Andrew Jackson 1817
Frost, John Pictorial Life of Andrew Jackson 1847
Gentleman of the Some Account of Gen. Jackson 1828
Baltimore Bar
Goodwin, Philo A. Biography of Andrew Jackson 1832
Headley, Joel T. The Life of Andrew Jackson 1880
Heiskell, Saml. G. Andrew Jackson and Early 1920
Tenn. History, 3 vols.
James, Marquis Andrew Jackson, 2 vols. 1938
Jenkins, Jno. S. Life and Public Services of Gen. 1880
Andrew Jackson
Johnson, Gerald W. Andrew Jackson, An Epic in 1927
Homespun
Karsner, David Andrew Jackson, The Gentle 1929
Savage
Macdonald, Wm. Jacksonian Democracy, 1829- 1906
1837
Mayo, Robert Political Sketches of Eight Years 1839
in Washington
Nicolay, Helen Andrew Jackson, The Fighting 1929
President
Ogg, Frederic A. The Reign of Andrew Jackson 1921
Parton, James Life of Andrew Jackson, 2 vols. 1860
Peck, Charles H. The Jacksonian Epoch 1899
Rowland, Eron O. Andrew Jackson’s Campaign 1926
Against the British
Schlesinger, Arthur The Age of Jackson 1945
M.
Snelling, William J. A Brief, Impartial History by a 1831
Free Man
Sumner, William G. Andrew Jackson 1910
Syrett, Harold G. Andrew Jackson, His 1953
Contribution
Van Deusen, The Jacksonian Era, 1828-1848 1959
Glyndon
Waldo, Samuel P. Memoirs of Andrew Jackson 1819
Walker, Alexander Jackson and New Orleans 1856
Ward, John W. Andrew Jackson, Symbol for an 1955
Age

FOR YOUNG READERS

Coy, Harold Real Book About Andrew Jackson 1952


James, Bessie R. The Courageous Heart 1934
Judson, Clara I. Andrew Jackson 1954

In addition to the above, the State Library has many valuable,


rare, and out-of-print pamphlets on General Jackson.

Microfilms of Hermitage Letters and Documents are available at


Joint University Library.

66
Entrance to the Hermitage
Transcriber’s Notes
Retained publication information from the printed edition: this
eBook is public-domain in the country of publication.
Added headings in the text to match the Table of Contents
Corrected a few palpable typos.
In the text versions only, text in italics is delimited by
_underscores_.
*** END OF THE PROJECT GUTENBERG EBOOK THE HERMITAGE,
HOME OF GENERAL ANDREW JACKSON ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it
away or re-use it under the terms of the Project Gutenberg
License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country where
you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.

You might also like