1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.

Slides:



Advertisements
Similar presentations
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
Advertisements

Jeopardy Objects Navigation Buttons True/False Parts of a Report Vocabulary Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Lesson 8 Using Advanced Queries Microsoft Office 2010 Advanced Cable / Morrison 1.
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
Chapter 5 Creating, Sorting, and Querying a Table
Access Lesson 2 Creating a Database
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.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
Querying a Database Microsoft Office Access 2003.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
QUERYING A DATABASE By: Dr.Ennis-Cole. OBJECTIVES: Learn how to use the Query window in Design view Create, run and Save queries Define a relationship.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 3 Maintaining a Database Using the Design and Update Features of Access.
Access Tutorial 3 Maintaining and Querying a Database
Pasewark & Pasewark 1 Access Lesson 4 Creating and Modifying Forms Microsoft Office 2007: Introductory.
Access Lesson 4 Creating and Modifying Forms
1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2010 Introductory Pasewark & Pasewark.
Microsoft Access Database software. What is a database? … a database is an organized collection of data. A collection of data of similar information compiled.
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Chapter 3 Maintaining a Database
Maintaining and Querying a Database Microsoft Access 2010.
Microsoft Access – Tutorial 3
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Microsoft Access 2010 Building and Using Queries.
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.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
Pasewark & Pasewark 1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2007: Introductory.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
® Microsoft Access 2010 Tutorial 3 Maintaining and Querying a Database.
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.
1 Access Lesson 3 Creating Queries. 2 Creating a Query with the Simple Query Wizard Query-- database object that lets you ask the database about the data.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
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.
D ATABASE O BJECTS Putting the Objects to Work. Database Objects When creating a database, you are creating a database that will store objects. Database.
1 Lesson 18 Managing and Reporting Database Information Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Pasewark & Pasewark 1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2007: Introductory.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
COMPREHENSIVE Access Tutorial 1 Creating a Database.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
1 Access Lesson 2 Creating Queries, Forms, and Reports Microsoft Office 2010 Fundamentals Story / Walls.
Access Maintaining and Querying a Database
Maintaining a Database
Microsoft Office Illustrated Introductory, Windows Vista Edition
Access Tutorial 3 Maintaining and Querying a Database
Objectives Query for top values Create a parameter query
Microsoft Office Illustrated Fundamentals
Microsoft Access 2003 Illustrated Complete
Microsoft Office Access 2003
Microsoft Office Access 2003
Microsoft Office Illustrated Introductory, Windows XP Edition
Assignment 3 Querying and Maintaining a Database
Presentation transcript:

1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 222 Objectives Create a query using a Wizard. Sort and filter data in a datasheet. Create a query in Design view. Create relationships in a database. Create a query based on more than one table. Use operators in a condition in a query. Calculate data using a query.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 333 Vocabulary And operator AutoFilter calculated field common field condition expression filter Filter By Form Filter By Selection foreign key multitable query one-to-many relationship Or operator

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 444 Vocabulary (continued) query referential integrity relationship Simple Query Wizard sort subdatasheet Total row

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 555 Creating a Query with the Simple Query Wizard A query is a database object that lets you ask the database about the data it contains. The result of a query is a datasheet that includes the records you asked to see. Specifications in a query are called conditions. – A condition is also called a criterion. – When the condition has two or more parts to it, the two conditions are called criteria.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 666 Creating a Query with the Simple Query Wizard (continued) A query is based on a table or another query (or multiple tables/queries) When you open a query object, you run the query. Running a query displays a datasheet with only the records and fields that you asked to see. The Simple Query Wizard is an easy way to create a query.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 77 Creating a Query with the Simple Query Wizard (continued) 7 First Simple Query Wizard dialog box

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 888 Creating a Query with the Simple Query Wizard (continued) A detail query shows every field in each record. A summary query lets you summarize relevant data, such as adding the field values in a column that stores price data.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 999 Sorting Data When you view field values in ascending or descending order from A to Z or from smallest to largest, you apply a sort to the field. Sorting a field in ascending order arranges records from A to Z, or from smallest to largest. Sorting a field in descending order arranges records from Z to A, or from largest to smallest.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 10 Filtering Data A filter temporarily displays records in a datasheet based on the condition that you specify. You can use different types of filters to display the data you need. When you use Filter By Selection, you select a field value, and then click the Selection button in the Sort & Filter group on the Home tab. 10

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 11 Filtering Data (continued) You can use Filter By Form to display records that contain one or more values based on the values stored in one or more fields. Click the Advanced button in the Sort & Filter group on the Home tab. Click the Toggle Filter button in the Sort & Filter group on the Home tab to display only records in the datasheet that match the filter. 11

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 12 Filtering Data (continued) An easy way to sort and filter data is to use an AutoFilter. An AutoFilter is a menu that opens when you click the arrow on the right side of a field selector, and contains options for: – Sorting data and clearing filters. – Using Filter By Selection and Filter By Form. 12

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 13 Filtering Data (continued) 13 AutoFilter for the Product Name field (a Text field)

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 14 For a query datasheet, you have more sorting and filtering options when you create or modify a query in Design view. In the Query Design window, you build and change the query using the design grid.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Creating a Query in Design View (continued) The Query window in Design view is divided into two parts. – The top shows the field list for the table you included in the query design. – The bottom contains a design grid that allows you to specify fields, conditions, and sort orders. A query can contain one, some, or all of the fields in the table. You can add the fields in any order to the design grid. 15

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 16 You can set a sort order for a field using the field's Sort box in the design grid. You can run a query by clicking the Run button in the Results group on the Query Tools Design tab. When you run a query, the results appear in a query datasheet. To add a condition to a field, click in the field's Criteria box, and then type the condition.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 17 Creating Table Relationships 17 The feature that lets you connect the data in the tables is a relationship. To create a relationship between two tables, you must design the tables so they contain a common field. A common field is a field that appears in both tables, has the same data type, and contains the same values. A common field is also called a matching field.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Creating Table Relationships (continued) The most common relationship is a one-to- many relationship. – One record in the first table can match many records in the second table. The common field in the related table is called a foreign key when it is used in a relationship. 18

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 19 Creating Table Relationships (continued) 19 When you relate tables, Access uses a set of rules to ensure that there are matching values in the common field used to form the relationship. This set of rules is called referential integrity. Referential integrity protects the data in the tables to make sure that data is not accidentally deleted or changed, resulting in inconsistent data.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 20 Creating Table Relationships (continued) 20 Relationships window after creating a one-to-many relationship

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Creating a Multitable Query Queries based on more than one table are sometimes called multitable queries. After you add two related tables to the query design, a join line shows the relationship. – The join line connects the common field used to relate the tables. – It defines the type of relationship by using the "1" to represent the "one" and the infinity symbol to represent the "many" side of the relationship. 21

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 22 Using Operators in a Condition 22 In an exact match condition the records must contain the specified value. In a range-of-values condition the record must match a range of values. The And operator selects records that match all of two or more conditions in a query. The Or operator selects records that match at least one of two or more conditions in a query.

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Using Operators in a Condition (continued) Relational operators 23

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Calculating Data Access provides two ways to calculate data using a query: – Total Row: Use the Total row to count the number of values in a column. The Total row includes additional functions for values. – Calculated Field: A field with a value calculated using other fields is called a calculated field. The calculation is called an expression. 24

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 25 Summary In this lesson, you learned: A query is a database object that lets you ask the database a question about the data it contains. You can create a query quickly and easily using the Simple Query Wizard, which asks you about the data you want to see and lets you select options in dialog boxes. You can change the way data is sorted in a datasheet by applying an ascending or a descending sort order to one of the fields. 25

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 26 Summary (continued) You can use a filter in a datasheet to temporarily display records in a datasheet based on a condition that you specify. Filter By Selection lets you select a field value or part of a field value in a datasheet and then filter out all records that do not match the filter. Filter By Form lets you display records that match a value you select in a field. An AutoFilter opens when you click the arrow on a field selector. You can use an AutoFilter to sort and filter data. You can also move and sort fields in Design view. To run a query, click the Run button in the Results group on the Query Tools Design tab. 26

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory 27 Summary (continued) When you need to create a query that uses conditions to select records, create the query in Query Design view. Use the Relationships window to create relationships between tables in a database by joining tables with a field that contains matching field values. A one-to-many relationship exists when one record in the primary table matches zero, one, or many records in the related table. Referential integrity is the set of rules that Access uses to protect data in the tables and to make sure that data is not accidentally deleted or changed. 27

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Summary (continued) A multitable query is a query that is based on more than one table. When you need to use a query to search for records that match a range of values, use a relational operator in the query design. When you need to select records that match all of two or more conditions in a query, use the And operator by placing the criteria in the same Criteria row in the design grid. When you need to select records that match at least one of two or more conditions in a query, use the Or operator by placing the first condition in the Criteria row and the second condition in the or row in the design grid. 28

Access Lesson 3 Pasewark & Pasewark Microsoft Office 2010 Introductory Summary (continued) In Access, you can perform calculations by using the Total row in a datasheet, or by creating a calculated field in the design grid in Query Design view. 29