1 Microsoft Access 2002 Tutorial 3 – Querying a Database.

Slides:



Advertisements
Similar presentations
Tutorial 3 Queries and Table Relationships
Advertisements

Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 4 – Finding and Ordering Data.
Concepts of Database Management Sixth Edition
Exploring Microsoft Access 2003 Chapter 6 Many-to-Many Relationships: A More Complex System.
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.
Microsoft Access 2003 Introduction To Microsoft Access 2003.
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.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 1 1 Microsoft Access 2003 Tutorial 1 – Introduction To Microsoft Access 2003.
Access Tutorial 3 Maintaining and Querying a Database
Define Table Relationships—1 of 3 One of the most powerful features of a relational database management system, such as Access, is its ability to define.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Chapter 3 Maintaining a Database
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
Microsoft Access – Tutorial 3
You can use a query to view a subset of your data or to answer questions about your data. For example, if you want to view a list of student names and.
G-Databases Competency 7.00 Objective 7.01 Demonstrate basic database concepts and functions.
® 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.
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.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
® Microsoft Office 2010 Access Tutorial 2 Building a Database and Defining Table Relationships.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
® Microsoft Access 2010 Tutorial 2 Building a Database and Defining Table Relationships.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Microsoft Access Intro Class 6 Relationships.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
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.
Filtering Data A filter is a set of restrictions you place on the records of an open datasheet or form to temporarily isolate a subset of the records.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
Microsoft Office XP Illustrated Introductory, Enhanced Tables and Queries Using.
® Microsoft Office 2013 Access Maintaining and Querying a Database.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
CHAPTER 1 – INTRODUCTION TO ACCESS Aliya Farheen March 5, 2014.
BA271 Week 6 Lecture Dave Sullivan. Goal for today… Status Report – Review where we are … Status Report – Review where we are … Begin learning about Microsoft.
DAY 16: MICROSOFT ACCESS – CHAPTER 2 Madhuri Siddula October 8, 2015.
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.
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
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 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Access Tutorial 2 Building a Database and Defining Table Relationships
Microsoft Access – Tutorial 3
Microsoft Office Illustrated Fundamentals
Access Maintaining and Querying a Database
Microsoft Office Access 2003
Tutorial 3 – Querying a Database
Microsoft Office Access 2003
Microsoft Office Illustrated Introductory, Windows XP Edition
New Perspectives on Microsoft
Presentation transcript:

1 Microsoft Access 2002 Tutorial 3 – Querying a Database

XP 2 The Query Window in Design View The Query window in Design view allows you to … can specify which fields you want to be included in your query results. control what records are displayed in the query by specifying select query criteria. Each column in the design grid represents a field that will be used in the query. You can run the query at anytime to view the results according to the current specifications.

XP 3 Add Fields To a Query in Design View The design grid is used to specify the fields and records you want to see. Add fields to the design grid by double-clicking the field in the field list or by dragging the field to the design grid. Remember that the results of a query provide a temporary view of the data The contents displayed in a query are a result of the fields you select and the criteria you specify in the query design grid When you use the query design window, you use Query By Example (QBE). When you use QBE, you give Access an example of the information you wish to see when you run your query.

XP 4 Create, run, and save queries From the fields list, either drag or double-click fields that you want included in the query. A query result differs from a table's datasheet view in that only selected fields are displayed If you move a field to the design grid and then you want to remove it, you can click on the field's column and then press the delete key. The results of the query will be displayed in order by the primary key of the table unless you specify another sort order. You can save the query and give it a name by pressing the save button on the toolbar.

XP 5 Update data using a query You can use the query datasheet to update data in a table. It is important to realize that the query datasheet is a temporary view of the data. However, when you update data by means of the query datasheet, the updates are placed directly into the underlying table. You can only update fields that are represented in the query. To observe the actual changes made to the table, close the query and open the table in datasheet view.

XP 6 Access is a relational database A database is almost always a collection of tables. Access is a relational database management system that allows you to form relationships between the tables. When you form a relationship between tables, you are joining the tables. Tables are joined on common fields between the tables. When tables are joined, you can view data from both tables as if the tables were one combined table.

XP 7 A one-to-many relationship Tables can be joined in three ways; one-to-one, one- to-many, and many-to-many. A one-to-many relationship exists when one table has many records associated with a given value but the related table has only one record for that value. The table with one record is called the primary table The table with many records is called the related table Queries can be defined to use the relationship to extract data from both tables in a single query.

XP 8 An example of a one-to-many relationship The Employer table is related to the Position table via the common field EmployerID. The Employer table has one record for EmployerID value The Position table has two records.

XP 9 Query results for a one-to-many relationship Queries can be built and saved that extract data from both the primary table (Employer) and the related table (Position).

XP 10 Using referential integrity Referential integrity allows you to maintain the integrity between related tables. Referential integrity: when you add a record to a related table, there must be a matching record in the primary table. Enforcing referential integrity: insures no orphaned records (records that have no matching record in the primary table).

XP 11 Cascaded Updates and Cascaded Deletes Cascaded updates: change in a field that is common to two related tables will also cause change in the other table Cascaded deletes is similar. If you delete a field that is common to two tables, the deletion will take place in both tables. Be careful with these features, as they can have dramatic effects on your data.

XP 12 Sort data in a query You can control the order of data displayed in a query by altering the queries sort key. Choose a field on which you want the data to be sorted and then specify whether you want the data sorted in ascending or descending order. Specify multiple fields as the sort key if you want to arrange data in sorted order within groups of data. Specify sort criteria for the query in the query design grid.

XP 13 Sort single or multiple fields To sort only one field, click in the desired field to select it, and then click the Sort Ascending or Sort Descending button on the toolbar. To sort multiple fields, you must specify them in the query design grid.

XP 14 Specify an exact match condition in a query You can specify an exact match condition, which allows you to specify that only records that match your criteria will be displayed. To specify an exact match, use the criteria row in your query design grid. When you run the query after specifying an exact match, only those records that meet the criteria will be displayed. An exact match condition specifies that the value in the specified field must match the condition exactly.

XP 15 Comparison Operators

XP 16 Use the And and Or logical operators When you need to use multiple conditions for a query, you can use the logical operators to combine conditions. The And logical operator specifies that both conditions must be met The Or logical operator specifies that one or the other of the conditions must be met When you enter two conditions on the same row of the query design grid, an And condition is created. If you enter two conditions that are on separate rows, an Or condition is created.

XP 17 Illustration of And and Or logic The And condition. The Or condition.

XP 18 Creating And and Or conditions in the design grid And conditions must be specified on the same line. Or conditions must be specified on different lines.