Microsoft Office Tutorials and References
In Depth Information
FIguRE 2-28 Sample report with categories and subcategories tied to the product.
Although this might seem a simple enhancement, it is a very important one because it lets
us introduce the concept of Data Modeling, to which we are going to dedicate the whole
of Chapter 4. The user queries the Data Model, and the simpler it is, the better will be his
experience. One of the most complex abilities of a data modeler is to create models that,
even if complex in their implementation, look very easy to the end user.
Note Even if the original data model of AdventureWorks has two distinct tables for category and
subcategory (which is the right choice for a standard database system), the data model is much easier
to query if you hide these two tables and transform their content into columns inside the Product
table, which is exactly what you have done. By modifying the data model, you have reduced the
number of tables shown to the user and given a meaningful name to the columns.
The two tables still exist in the data model, but they are hidden from the user, who can have
access to their values through the new computed columns. This is the first sample situation in
which you use an internal data model while showing a different one to the user. You will get
acquainted with this technique because we use it throughout the topic.
An interesting exercise, which we leave to you to try, is to use the RELATED function to
remove the technical table we previously used to give a description of the online order
lag. The technique is exactly the same one you used in this section and the exercise gives
you greater confidence using the RELATED function. Moreover, you should use the same
technique whenever the purpose of a table is to provide lookup values and that table is
not a part of the data model you want to show to the user.