Database Reference
In-Depth Information
from any (or all) of the base tables within the view, however, when you determine it will
contribute to the information the view provides.
Note
Inordertoavoidanyunnecessaryambiguityorconfusion,makecertainyoudonot
have any primary key indicators within the view symbol when you diagram a data
view.
Aggregate View
Youusethistypeofviewtodisplayinformationproducedbyaggregatingaparticularsetof
data in a specific manner. As with a data view, you can define an aggregate view using one
ormorebasetables.Youcanthenincludeoneormorecalculatedfieldsthatincorporatethe
functions that aggregate the data and one or more data fields (drawn from the view's base
tables) to group the aggregated data. Sum, Average (arithmetic mean), Minimum, Maxim-
um, and Count are the most common aggregate functions that you can apply to a set of
data, and every major RDBMS supports them.
Let's say that you wanted to know how many students are registered for each class, and
you're using the tables from the school example shown in Figure 12.3 . Your first impulse
is to define a data view called CLASS REGISTRATION that will provide the information
you need to answer your question. So, you use the C LASS N AME field from the CLASSES
tableandtheS TUDENT IDfieldfromtheSTUDENTCLASSEStabletobuildtheview. Fig-
ure 12.6 shows a diagram for the new CLASS REGISTRATION view.
Search WWH ::




Custom Search