Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 11 Committed to Shaping the Next Generation of IT Experts. Chapter 7 Advanced Queries Robert.

Slides:



Advertisements
Similar presentations
Working with Tables 1 of 5. Working with Tables 2 of 5.
Advertisements

Copyright © 2008 Pearson Prentice Hall. All rights reserved.1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2.1: Relational Databases.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Access.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Access Lesson 8 Using Advanced Queries Microsoft Office 2010 Advanced Cable / Morrison 1.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Access Tutorial 3 Maintaining and Querying a Database
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Chapter 2 Querying a Database
Chapter 3 Maintaining a Database
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall.1 Exploring Microsoft Office Excel Copyright © 2008 Prentice-Hall. All rights.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 4: Create, Edit, and Perform.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall1 Exploring Microsoft Office Access 2007 Committed to Shaping the Next Generation of.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1: Finding Your Way Through.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1: Finding Your Way Through.
Copyright © 2008 Pearson Prentice Hall. All rights reserved.1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall1 Exploring Microsoft Office Access Committed to Shaping the Next Generation.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next Generation.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall. 1 1 Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1: Finding Your.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 4 BACKNEXTEND 4-1 LINKS TO OBJECTIVES Query Design Query Criteria Modify a Query Using OR.
1 Chapter 7 Query-By-Example by Monica Chan CS157B Professor Lee.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast,
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 10 Customizing a Database.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 5 PivotTables and Charts.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 9 Bulletproofing the Database.
Microsoft Access 2010 Chapter 10 Administering a Database System.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 11 Committed to Shaping the Next Generation of IT Experts. Chapter 3: Customize, Analyze,
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 3: Customize, Analyze,
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 4: Create, Edit,
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
1 11 Exploring Microsoft Office Access 2007 Chapter 6 Data Protection.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 3: Customize, Analyze,
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
Creating Advanced Queries and Enhancing Table Design.
1 11 Chapter 7 Action Queries Exploring Microsoft Office Access 2007.
Exploring Microsoft Office Access 2007
Exploring Microsoft Office Access 2007
Objectives Create an action query to create a table
Microsoft Access 2003 Illustrated Complete
Exploring Microsoft Office Access 2007
Exploring Microsoft Office Access 2007
Exploring Microsoft Office Access 2010
Exploring Microsoft Office Access 2007
Microsoft Office Access 2003
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 2 Building a Database and Defining Table Relationships
Tutorial 5 Advanced Queries and Enhanced Table Design
Presentation transcript:

Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Chapter 7 Advanced Queries Robert Grauer, Keith Mulbery, Maurie Wigman Lockley Exploring Microsoft Office Access 2007

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 2 Objectives Maintain a database Understand action queries Create an Update query Use a make table query Create a delete query

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 3 Objectives Construct a crosstab query Work with parameter queries Create find unmatched queries Understand find duplicate queries

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 4 Action Queries Change underlying table data  Select queried do not Can be used to create new tables Cannot be undone Play a large role in maintaining a database

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 5 About Update Queries Changes value(s) in one/ more records Use the Update query button  Database Tools tab, Query Type group Update button

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 6 Creating an Update query Identify record source Show desired tables in design grid Switch from Select to Update Query Insert Field to be updated Enter the value to be updated Value entered in Update To field Update value

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 7 Testing Action Queries Test all action queries before execution Choose Datasheet View  Allows preview of results before execution Check Datasheet View first

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 8 Running an Update Query Click the Run button  Design tab, Results group View table to see the results Run button Before Update query After Update query

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 9 Specifying Criteria in an Action Query Specified in the field being update Also specified using an additional field(s) Criteria

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 10 Using Criteria with an Update Query Specifies specific records for update Works the same as in a select query After update query with criteria Before update query with criteria Criteria

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 About Append Queries Adds records from one table to another Data types between tables must match Validation rules in existing table apply  Records not added if validation rule violated Source table fields may be ignored  Do not add to design grid If auto-number fields exists in target table  Do not import auto-number fields

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 12 Creating an Append Query Identify target and source tables Click Append button Choose Target table from Append box  May also browse to choose another database Append dialog box Append button

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 13 Creating an Append Query Add fields from Source table to design grid Test in Datasheet view Run query Fields to append added to design grid

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 14 Append Query Results Data is appended to existing table February Agents before append September Agents before and after append February Agents after append

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 15 About a Make Table Query Almost the same as append query  Table must preexist in append query  No pre-existing table in make table query Target database must exist

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 16 Creating a Make Table Query Identify the source table Click Make Table button Enter table name or choose database  Accomplished in the Make table dialog box Make Table dialog box Make Table button

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 17 Running a Make Table Query Add fields to design grid Test in Datasheet view Run query Fields added in design grid Test in Datasheet view

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 18 Make Table Query Results New table added to Objects pane Open table to view results Source Table Results of make table query

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 19 About Delete Queries Can delete all records from table  Criteria used to delete specific records  If no criteria, all records deleted Very powerful – cannot be undone Setup is same as other action queries

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 20 Creating a Delete Query Add table to Design grid Click Delete Button Add field(s) to design grid  Use criteria to specify delete conditions Add table to design grid Delete button Delete Query with criteria

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 21 Running a Delete Query Test query in Datasheet view Run Query Open table to view results Test in Design view Table before delete query Table after delete query

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 22 Hiding a Query Prevents accidental execution of action queries  Right-click query  Click the Hidden checkbox All queries shown Some queries hidden

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 23 About Crosstab Queries Summarizes by two sets of unrelated facts Output resembles a PivotTable  PivotTable primarily for management decision making  Crosstab query primarily for end users Will not work on related data Works with one or more tables

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 24 Crosstab Query – Using the Query Wizard Step 1 Click the Query Wizard button In the New Query dialog box  Select Crosstab Query Wizard Select Crosstab Query Wizard

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 25 Using the Query Wizard Step 2 Select table/query to use in crosstab To use fields from multiple tables  Create query from tables first Select source table or query to use

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 26 Using the Query Wizard Step 3 Select fields(s) for column headings Select field(s) for column headings

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 27 Using the Query Wizard Step 4 Select the field to calculate Select the appropriate aggregate function Select aggregate function

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 28 Using the Query Wizard Step 5 Enter new query name or accept default View or modify the query Enter new name or accept default name

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 29 Completed Crosstab Query Summarizes list price  Per selling/listing agent per city Source table Crosstab query

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 30 About Parameter Queries Information intentionally omitted by designer  Allows end user to supply criteria  Customizable data request More flexible than other query types Considered a select query Designers able to lock query design

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 31 Creating a Parameter Query Identify tables/ fields in design view Create prompt for user in criteria field  Prompt must be enclosed in brackets [ ]  Multiple fields can be used as prompts Message for user entered in brackets

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 32 Running a Parameter Query Click the Run button Enter criteria in message box  Criteria rules and use is same as normal select query View results in Datasheet view Message prompt with criteria entered Parameter query results

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 33 Parameter Report Normally based of a parameter query If not based on parameter query  Open reports source query in design view  Add parameter OR  View report in Design  Open property sheet for field  Click Record Source property - add parameter

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 34 About Unmatched Queries Compares records in two related tables Returns records found in only one table Query Wizard easiest method of creation Unmatched Query results

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 35 Unmatched Query Wizard Run Query Wizard Select Find Unmatched Query Wizard Find Unmatched Query

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 36 Unmatched Query Wizard Select first table source Select second table source Select first table source Select second table source

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 37 Unmatched Query Wizard Select the duplicate fields  Click the button Select display fields for query results Click Finish Select duplicate fields Select fields for query results

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 38 About Find Duplicates Query Finds duplicate data Aids in data entry error detection Allows administrative use of purposely duplicated data Easily created with the Query Wizard Query Wizard Find Duplicates query result

Copyright © 2008 Pearson Prentice Hall. All rights reserved. 39 Copyright © 2008 Pearson Prentice Hall. All rights reserved. 39