Database Reference
In-Depth Information
CHAPTER 8
Generating Summaries
8.0. Introduction
Database systems are useful for data storage and retrieval, but can also summarize your
data in more concise forms. Summaries are useful when you want the overall picture,
not the details. They're more readily understood than a long list of records. They enable
you to answer questions such as “How many?” or “What is the total?” or “What is the
range of values?” If you run a business, you may want to know how many customers
you have in each state, or how much sales volume you generate each month.
The preceding examples include two common summary types: counting summaries
and content summaries. The first (the number of customer records per state) is a count‐
ing summary. The content of each record is important only for purposes of placing it
into the proper group or category for counting. Such summaries are essentially histo‐
grams, where you sort items into a set of bins and count the number of items in each
bin. The second example (sales volume per month) is a content summary, in which sales
totals are based on sales values in order records.
Another summary type produces neither counts nor sums, but simply a list of unique
values. This is useful if you care which values are present rather than how many of each
there are. To determine the states in which you have customers, you need a list of the
distinct state names contained in the records, not a list consisting of the state value from
every record.
The summary types available to you depend on the nature of your data. A counting
summary can be generated from all kinds of values, whether they be numbers, strings,
or dates. Summaries that produce sums or averages apply only to numeric values. You
can count instances of customer state names to produce a demographic analysis of your
customer base. And sometimes it makes sense to apply one summary technique to the
result of another. For example, to determine how many states your customers live in,
generate a list of unique customer states, then count them.
 
Search WWH ::




Custom Search