105 Summary Query Results Access 2019 In Practice

105 Summary Query Results Access 2019 In Practice

File Link

SKILLS COVERED IN THIS PROJECT

  • Create a summary query in Design view.
  • Edit a query in Design view.
  • Add fields to a query.
  • Execute a query.
  • Save a query.
  • Sort query results.
  • Add aggregate functions.
  1. Open the NewYorkDMV-03.accdb database start file.
  2. The file will be renamed automatically to include your name. Change the project file name if directed to do so by your instructor.
  3. Enable content in the database.
    Datasheet view of query results shows 22 records.
    Figure 3-104 Summary query results counting tickets by city and factor
  4. Create a new summary query in Design view. The query counts the number of tickets issued by city and violation.
    1. Add the Ticketstable into the Query Design window.
    2. Increase the size of the table object to display all of the fields.
    3. Add the following fields into the query: City, PrimaryFactor, and TicketNumber.
    4. Add the Total row to the query.
    5. Group By the Cityand PrimaryFactorfields and Count the TicketNumber field.
  5. Save the query as TicketCountByCityAndFactor.
  6. Run the query. The datasheet should display 22 records.
  7. Adjust the field column widths using AutoFit or Best Fit. The datasheet should be similar to Figure 3-104.
  8. Save the changes to the query.
    Datasheet view of query results shows nine records.
    Figure 3-105 Summary query results counting tickets by factor
  9. Save a copy of the query as TicketCountByFactor.
  10. Edit the TicketCountByFactorquery in Design view. The query should show the total tickets issued for each violation factor, sorted in descending order by count.
    1. Delete the City field.
    2. Sort the TicketNumber field in descending order.
  11. Save and run the query. The datasheet should match Figure 3-105.
  12. Close the query.
  13. Create a new summary query in Design view. The query provides summary data on the total fines assessed against each driver.
    1. Add both tables into the Query Design window.
      Datasheet view of query results
      Figure 3-106 Summary query results of tickets by driver
    2. Increase the size of the table objects to display all of the fields.
    3. Add the following fields into the query: LicenseNumber, FirstName, LastName, Fine, and TicketNumber.
    4. Add the Total row to the query.
    5. Group By the LicenseNumber, FirstName, and LastName fields, Sum the Fine field and Count the TicketNumber field.
    6. Sort the Fine field in descending order.
  14. Save the query as TicketsByDriver.
  15. Run the query. The datasheet should display 24 drivers who have received tickets, sorted in descending order by the total dollar amount of their fines (Figure 3-106).
  16. Close the query.
  17. Close the database.
  18. Upload and save your project file.
  19. Submit project for grading.