Calculations & Parameters Advanced Queries Calculations & Parameters
Concept Map Access Queries Calculation Queries Limitations Parameter Queries
Objective Create calculation queries. Create parameter queries. Discuss limitations of queries.
Textbook Chapter Videos The query chapters are available in video format as well: http://www.lacoste.pamplin.vt.edu/web1504/resources/video/db.html
Segment A: Summary Calculations
Summary Calculations One calculation/total for a group of records. Example: Calculate the average rating each participant assigned to Product A.
Count Books by Author For each author, identify how many of their books are in the library. Extension: Also include: the average cost of those books, and the total number of pages contained in those books.
Segment B: Record Calculations
Record Calculations One calculation per record. Example: Determine the age of each participant in five years.
Price Increase Write a query to calculate a 15% increase in the price of each book purchased during the summer (June, July or August) listing the highest priced book first and the lowest priced book last. Format the new price as currency with two decimal places. Extension: How could you use Title as a secondary sort but display it as the first column of your query?
Segment C: Parameter Queries
Parameter Query Example: Create a query that will display all the observations for a selected ID.
One Author’s Books Write a query that will display all the books for a selected author. Books should be displayed in alphabetical order by title. I should be able to pick a different author last name each time I run the query. Extension: Select author based on last name as well as first name.
Segment D: Limitations
Query Limitations Queries can show only one level of grouping at a time. Queries have limited formatting options.