Page 295 - Trackpad 402_Class-X_Final
P. 295

Step 5:  Save the query by pressing Ctrl + S keys.
            Step 6:   Double-click on the query name to run the query. Notice that a new column titled Amount Payable is displayed
                    showing the necessary calculations. Remember that calculation can be made only on those fields where data
                    type used is Numeric.

            Grouping Data in Queries

            In business organisations and companies, the senior management needs reports in summary form. In such situations,
            a summary report can be prepared grouping records on the basis of field that contains repetitive values.
            For example, consider the stock table of a departmental store which sells items that include Kitchen Appliances, Furniture
            and Decoration. The senior management wants to know the quantity of stock under each category of products.














            Observe in the given table that some of the entries in the Product_Category field are repeating. Base allows the user
            to categorise the data on this field. This field on the basis of which data is being grouped is called group-field.

            Base creates queries for grouping data on the basis of:
            •  Group-field
            •  Grouping function
            Grouping function refers to the in-built function used to present grouped data. The grouped data can be presented in
            the form of SUM, AVERAGE, MAXIMUM, MINIMUM, COUNT, etc. of the values stored in the table.

            To create a grouping query, follow these steps:
            Step 1:  Create a new query in the Design view.
            Step 2:   In the Field row in the Query Design pane, in the first column, select and use the group-field, which in this
                    case is Product_Category.





























            Step 3:  In the Function row, click to open the drop-down list and select the option Group.


                                                                                   Database  Management System  295
   290   291   292   293   294   295   296   297   298   299   300