Presentation is loading. Please wait.

Presentation is loading. Please wait.

By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1.

Similar presentations


Presentation on theme: "By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1."— Presentation transcript:

1 by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

2 Determine when to use an action query Update data with an update query Add records to a table with an append query Create a table with a make table query Delete records with a delete query Summarize data with a crosstab query Find duplicate data records with a query Find unmatched records with a query 2 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

3 An action query adds, edits, or deletes data in a database Four main queries used to maintain a database: – Update query – Append query – Make Table query – Delete query 3 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

4 Recognize the benefits of an action query – Used when a user is required to enter the same information into many records – Used to move records from one table to another 4 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

5 Back up a database when testing an action query – Updates and deletions made by an action query cannot be undone – Back up database before running an action query 5 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

6 An update query changes data values in fields for records that meet specific criteria Example – changing area code Create a select query before running an update query to identify missing data 6 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

7 Test an update query – Test before running an update query to verify that the correct records will be updated – Once a query has run, it cannot be undone – Steps to test an update query: From Design view, click View in the Results group and click Datasheet View 7 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

8 Verify an Update Query – Running an action query does not display results – Test results by creating query to locate updated records – Another method is to locate original records prior to the update and verify that they no longer exist after the update query has run 8 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

9 An append query copies records from a source table and adds them to the destination table Appended records appear in primary key order If no primary key, appended records are added to end of the table 9 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

10 Rules for appending – Data types of fields in both tables must match – Normal rules for adding records apply – If field from source table does not exist in destination table, Access leaves a blank in the Append To row – Destination table should not contain an AutoNumber field 10 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

11 Create a select query before running an append query – To identify data to append Records to be appended: 11 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

12 Set Append To fields in an append query – Append To row appears in query design grid to identify destination fields 12 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

13 Source field, Append To row, destination field: 13 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

14 A make table query selects records from one or more tables and creates a new table Create a make table query – Similar to creating an append query – Difference – structure is created then records added 14 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

15 Test and run a make table query – Preview and verify records in Datasheet view before running make table query 15 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

16 A delete query selects and removes records from a table Test and run a delete query – Preview and verify records to be deleted in Datasheet view before running delete query 16 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

17 A crosstab query summarizes a data source into a grid of rows and columns Intersections display aggregate data Shows trends in values over time Can be based on a table or query 17 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

18 Group and summarize data – Row headings display field names along the left side – Column headings display field names along the top – Summarization (aggregation) is at the intersection – Type of data depends on aggregate function Examples: count, sum, average 18 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

19 Use the crosstab query wizard – Almost always used – First identify data source – Only one object can be referenced – Must combine data in separate query to use fields from different data sources 19 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

20 Modify a crosstab query – Modifications made in Design view – Types of modifications: Change row or column heading fields Modify aggregate function Alter field selection for aggregate calculation Add/modify properties, fields, field order 20 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

21 Use a find duplicates query – A find duplicates query helps to identify duplicate values in a table – Useful for inherited databases with poor design 21 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

22 A find unmatched query compares records in two related tables Displays records found in one table, but not the other Example – gradebook 22 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

23 In this chapter you learned to: – Determine when to use an action query – Update data with an update query – Add records to a table with an append query – Create a table with a make table query – Delete records with a delete query – Summarize date with a crosstab query – Find duplicate data records with a query – Find unmatched records with a query 23 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

24 24 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

25 25 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.


Download ppt "By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1."

Similar presentations


Ads by Google