Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.

Slides:



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

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
Access Tutorial 3 Maintaining and Querying a Database
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – 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.
Querying a Database Microsoft Office Access 2003.
Mary K. Olson PS Reporting Instance – Query Tool 101.
Access Tutorial 3 Maintaining and Querying a Database
Access 2007 ® Use Databases How can Access help you to find and use information?
Chapter 2 Querying a Database
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Access 2010 © 2011 The McGraw-Hill Companies,
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Maintaining and Querying a Database Microsoft Access 2010.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Lesson 31: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Design.
Microsoft Access Intro Class 5 Working with Queries.
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.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Microsoft Access 2010 Building and Using Queries.
Analyzing Data For Effective Decision Making Chapter 3.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 6 – Designing.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Concepts of Database Management Seventh Edition
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
® Microsoft Access 2010 Tutorial 3 Maintaining and Querying a Database.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics Covered Understanding different types of Queries Creating a Query Creating a Query using a Wizard Changing.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
® Microsoft Office 2013 Access Maintaining and Querying a Database.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
You can sort Access data so you can view records in the order you want to view them, and you can filter data so you only see the records you want to see.
T7-1 LEARNING OUTCOMES – ACCESS PROBLEM SOLVING 1.Describe the process of using the Simple Query Wizard using Access 2.Describe the process of using the.
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1.
DAY 18: MICROSOFT ACCESS – CHAPTER 3 CONTD. Akhila Kondai October 21, 2013.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
Microsoft Access Lesson 5 Lexington Technology Center February 25, 2003 Bob Herring On the Web at
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
MICROSOFT ACCESS – CHAPTER 3 CONTD. Sravanthi Lakkimsetty Mar 09, 2016.
Access Maintaining and Querying a Database
Microsoft Office Illustrated Introductory, Windows Vista Edition
Access Tutorial 3 Maintaining and Querying a Database
Access Chapter 2 Querying a Database.
Objectives Query for top values Create a parameter query
Plug-In T7: Problem Solving Using Access 2007
Querying a Database Using the Select Query Window
Microsoft Access 2003 Illustrated Complete
Building and Using Queries
Nagendra Vemulapalli Access chapters 3&5 Nagendra Vemulapalli 1/18/2019.
Microsoft Office Illustrated Introductory, Windows XP Edition
Assignment 3 Querying and Maintaining a Database
New Perspectives on Microsoft
Presentation transcript:

Lesson 4: Querying a Database

2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query criteria and sort order  Create and format a calculated field  Use functions in query expressions  Create special types of queries

Reviewing Query Features 3 A query acts as a saved question you ask a database. A query is a subset of data from one or more tables. Data displayed in query results remain stored in the original table rather than in the query. When you edit data in query results, you are actually editing the data stored in the source table.

Reviewing Query Features 4 Queries are dynamic objects that display up-to-date data stored in database tables. Queries can be used to create forms and reports, which may contain fields from multiple tables. Query results datasheets enable you to filter or selectively organize data using the same techniques you may use to filter and organize table datasheets.

Creating Select Queries The most common type of query is the select query. Access contains two distinct tools for creating select queries:  Query Wizard  Query Design 5

Using the Simple Query Wizard Steps you through the creation of a select query Enables you to identify table(s) and fields from each table that you want to include in the query Prompts you to save the query 6

Using Query Design View Presents a split window with table field lists at the top and columns and rows at the bottom 7

Adding Fields to the Query Grid Double-click a field name to add the field to the next available column of the query design grid. Drag a field to the next column in the grid. Click the Field row of a column in the query grid and select the field from the drop-down list. Double-click the asterisk (*) that appears at the top of the field list to add all fields to the grid. Double-click the field list title bar to place each field in the table in a separate column of the query grid. 8 Note! When you use the asterisk to add all fields, Access places the table name in the Field row, but when you run the query, each field appears in a separate column of the query results datasheet.

Adding Fields to the Query Grid You can rearrange query columns in Design View or Datasheet View by dragging and dropping them into position. 9

Multi-Table Query When you add fields from multiple tables, these tables must be related in order for the intended results to be displayed. You may wonder which ID field to add to a query. The best practice is to identify the table for which the ID field is the primary key. 10

Setting Query Criteria 11 Comparison Operator Wildcard Value Dates Wildcard

Setting AND and OR Criteria AND Criteria OR Criteria 12

Sorting a Query and Limiting Results Sorting query results  Use sort tools after running the query.  Set a sort order in the query grid Sort row. 13

Limiting Results Effective way of limiting results; combines sorting with restricting the number of results to display The Return feature on the Query Design tab enables you to set the number of records you want to retrieve. 14

Performing Calculations in Queries A calculated field:  Creates a new field in the query that can be used in a form or report  Can be used to perform mathematical operations such as add and multiply  Has a name and can be formatted with properties just like a regular field  Enables you to combine values in two text fields into one field, such as LastName and FirstInitial  Updates and recalculates each time you run the query 15

Calculated Fields Have no value of their own Perform calculations using other field values Calculated field name Field names from existing tables Arithmetic or comparison operator 16

Please Excuse My Dear Aunt Sally Parentheses Exponentials Multiplication/Division Addition/Subtraction (2+2)*32=6/2=33 17

Using Functions in Queries Aggregate functions perform specific calculations, such as finding the minimum, maximum, and average values, and counting and summing the entries in a datasheet. 18

Crosstab Queries Rearrange data for summarizing Group data and total values 19

Crosstab Query Palette Groupings appear as row and column headings. Summarized values appear in the TOTAL area. 20

Unmatched and Duplicates Queries Check database tables to ensure there is no duplication of records Also check database to ensure that records referenced in one table have a matching record in the other table Hoped-for result of running these two queries is that Access finds nothing to report. 21

Structured Query Language SQL is the underlying structure created for queries in Access. 22

Lesson 4: Querying a Database