Part II. Query Types On the design query table pane, right click and the cascading window will appear.

Slides:



Advertisements
Similar presentations
The Ribbon Standard to all Office 2007 applications Organized by feature and functionality Navigation Pane Access to all objects in the current database.
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.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Access Lesson 2 Creating a Database
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 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.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Querying a Database Using the Select Query Window
FIS 318/618: Financial Systems & Databases Queries Oakland University School of Business Administration Accounting and Finance Joe Callaghan.
Querying a Database Microsoft Office Access 2003.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
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
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 © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
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.
Working with Queries in Microsoft Access The Access Workbench: Section Three DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Tutorial 8 Advanced Queries. Notes Switch to new database! Tutorial.08 folder Only Session 8.1 and 8.2.
Queries. What is a query? A query is actually the name for any database manipulation operation. The most commonly used type is a select query, which is.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
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.
CSS/417 Introduction to Database Management Systems Workshop 2.
Microsoft Access 2010 Building and Using Queries.
Analyzing Data For Effective Decision Making Chapter 3.
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)
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 Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
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 Office 2007 Access Chapter 3 Maintaining a Database.
® 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.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making Chapter.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics Covered Understanding different types of Queries Creating a Query Creating a Query using a Wizard Changing.
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.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
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.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
© 2001 ComputerPREP, Inc. All rights reserved. Access 2000: Module II.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
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.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Microsoft Office Access 2010 Lab 3
Objectives Query for top values Create a parameter query
Plug-In T7: Problem Solving Using Access 2007
Objectives Create an action query to create a table
Microsoft Access 2003 Illustrated Complete
Microsoft Office Access 2003
Tutorial 3 – Querying a Database
Access Lesson 2 Creating a Database
Microsoft Office Access 2003
Tutorial 9 Using Action Queries and Advanced Table Relationships
New Perspectives on Microsoft
Presentation transcript:

Part II

Query Types On the design query table pane, right click and the cascading window will appear.

There are 5 general query types Select crosstab parameter action SQL

Select Select query - retrieves the specific data you request from one or more tables, then displays the data in query datasheet in the order you specify. This is the most common type of query. (also the one we have concentrated on)

Crosstab Crosstab query - Summarizes large amounts of data in an easy-to-read, row-and-column format

Parameter Parameter query - Displays a dialog box prompting you for information, such as criteria for locating data. For example, a parameter query might request beginning and ending dates, then display all records matching dates between the two specified values

Action query Makes changes to many records in one operation. There are 4 types: –make-table - creates a new table from selected data in one or more tables –update - makes update changes to record, such as when you need to raise the cost of material by 5% –append - add records from one or more tables to end of other tables –delete - deletes records from a table or tables

SQL Created using SQL (Structure Query Language) an advanced programming language used in Access

Working with more than one table Large tables are difficult to manage most likely will have redundancy A join is an association that tells Access how data between tables is related A relationship is established between tables usually through at least one common field.

Related tables Tables that are related must share at least one common field The data type for the common field must be the same in tables being related –you cannot relate a text field to a date/time field Often the fields have the same name, but this is not a necessary requirement.

Joining Tables To join tables, you first bring both tables to the upper pane of the design query window. Access will draw a line, called a join line, between matching fields from either table. Matching fields are fields with the same name where one of fields is a primary field. This is called a default join or an inner join.

Joining Tables If you fail to give the matching fields the same name, Access will not automatically insert the line and create the join. You can create the join manually by dragging form one common field to to the other. The join instructs the the query to check for matching values in joined fields. When matches are found, the matching data is added to the query datasheet as a single record

Three types of relationships one-to-many many-to-many one-to-one

One-to-many A record in table A can have many matching records in table B, but a record in table B have only one matching record in table A Example: one instructor may teach one or more sections

Many-to-many A record in table A can have many matching records in table B, and a record in table B can have many matching records in table A Example: Instructors can teach many courses.

Example of a many-to-many using a third linking table

One-to-one A record in table A has only one matching record in table B, and a record in table B has only one matching record in table A. Example: an employee information table and an employee compensation table

Defining using Tools->Relationships, you can define permanent relationships between tables that will enforce the rules of referential integrity

Employees Enployee ID Hire Date Last Name First Name... Location Employee ID Location Job Title (Joined on common field) Two tables in a one-to-one relationship. When the Employee ID fields of the two tables are joined, a query can be created using data from both tables

Design Query Customers * Customer Id First Name Last Name Age Display in alphabetical order the last names of customers that have a credit card with “us” Field: Table: Sort: Show: Criteria Or: First Name Customers Ascending Last Name Customers Customer Id Credit Card * Customer Id Credit limit...

The Results A list will appear when the run command is clicked, the ! Icon. First Name Adam Eve Susan John Joseph Harold * Both tables must contain matching records in order for a record to appear in the query’s result Last Name Abrahams Cane Duly Done Jackson Smith Customer Id

Calculated Field A calculated field enables you to draw the data form other field columns and perform a mathematical calculation on a row-by-row based Generally, if a value can be calculated for display, it should not be stored permanently in the database

Create Select an empty field column in the query design grid, click the expression builder to help you to enter expression. (the magic wand) example syntax: Nameof field in datasheet window:expression example NEW GRADE: expression

Creating Select an empty field column in the query design grid, click the expression builder to help you to enter expression. (the magic wand) syntax : Name of field in datasheet window:expression Expression - can use a field name, operators and numbers example: multiply the field purchase ( in table Customers) by 5% and call this field Tax Tax:[Customers]![purchase] *.05

Creating Summary Queries Enables to perform aggregate calculations to summarize a group of data. Right click on the design grid and a cascading menu will appear, the top will be be Totals. Select totals, an extra row will appear in the design grid called Totals: select a cell in the Total row of the desired column.

Select a calculation option

First and Last The First and Last functions are most useful in calculated controls on a report. For example, if you have an Order report that is grouped on a ShipCountry field and sorted on an OrderDate field, you can use the First and Last functions in calculated controls to show the range of earliest to latest order dates for each grouping.

Questions