Tutorial 8 Advanced Queries. Notes Switch to new database! Tutorial.08 folder Only Session 8.1 and 8.2.

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?
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.
© 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 10 – Designing.
Access Lesson 8 Using Advanced Queries Microsoft Office 2010 Advanced Cable / Morrison 1.
Exploring Microsoft Access
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
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.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Querying a Database Microsoft Office Access 2003.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
1 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and Custom Forms.
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,
1 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Database Applications – Microsoft Access Lesson 9 Designing Special Queries Updated 4/11.
Lesson 31: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Design.
The Attribute Table! Without the attribute table, a polygon is just a polygon, a point is a point The attribute table defines what points, lines, or polygons.
Exam Review – Queries & MORE! Access SimNet Exam Access Case Exam Final Exam.
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.
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.
Exploring Microsoft Access Chapter 4 Relational Databases, External Data, Charts, and the Switchboard.
Analyzing Data For Effective Decision Making Chapter 3.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
Access Class Outline Data Organization Tables Import and Export of Data Queries Select Calculate Values Aggregation (Count, Sum) Create Append Delete Crosstab.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Access Queries. Queries  Let you see the data you want  With Select queries you can:  Query more than one table  Create new calculated fields  Summarize.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Chapter 7 Advanced Queries Robert.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
Chapter 3 Query and Report. Agenda Report types Report contents Report creation Report design view Query and dynaset Function and grouping Action query.
Actions Queries. Understanding Action Queries  Action queries are a way to make corrections to database. They can make an enormous mess of database if.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
O FFICE M ANAGEMENT T OOL - II B BA -V I TH. Abdus Salam2 Week-7 Introduction to Query Introduction to Query Querying from Multiple Tables Querying from.
Summary Queries Query Wizard –This is a choice once you select fields –Much easier to develop some summary queries with the wizard, then learn how to do.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1.
(SQL - Structured Query Language)
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
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.
Creating Advanced Queries and Enhancing Table Design.
COMPREHENSIVE Access Tutorial 1 Creating a Database.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
1 11 Chapter 7 Action Queries Exploring Microsoft Office Access 2007.
Relational Databases Today we will look at: Different ways of searching a database Creating queries Aggregate Queries More complex queries involving different.
Microsoft Office Access 2010 Lab 3
Objectives Query for top values Create a parameter query
Objectives Create an action query to create a table
Microsoft Access 2003 Illustrated Complete
Microsoft Access 2003 Illustrated Complete
Exploring Microsoft Office Access 2010
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
Tutorial 9 Using Action Queries and Advanced Table Relationships
Tutorial 5 Advanced Queries and Enhanced Table Design
New Perspectives on Microsoft
Presentation transcript:

Tutorial 8 Advanced Queries

Notes Switch to new database! Tutorial.08 folder Only Session 8.1 and 8.2

Create a crosstab query A crosstab query performs aggregate function (arithmetic operations) calculations on the values of one database field and displays the results in a spreadsheet format. Possible functions include average, count, first field value, last field value, etc. Crosstab Query Wizard will walk you through creating a crosstab query.

A select query versus a crosstab query This figure shows a Select query and a crosstab query. These two queries are based on the same data. In this case the crosstab query is using the Sum function to summarize the potential income for each country`. However, notice that the crosstab query data is much more summarized than the select query data.

Crosstab query aggregate functions The figure below shows the aggregate functions that can be used in a crosstab query.

The Crosstab Query Wizard steps 1. Select the table or query upon which you want to create the crosstab query. 2. Select fields to use as row headings. 3. Select fields to use as column headings. 4. Select the field that will be calculated upon and what calculation is to be performed.

The final Crosstab Query Wizard dialog box This figure shows the final Crosstab Query Wizard dialog box where you select the field to be used for the calculation, and which type of calculation to perform.

Other types of queries Find duplicates a select query that locates duplicate records in a table or query Find unmatched returns a datasheet for all records that do not have a matching record in the related table Top values Returns the top number top percentage of records E.g. top 10 or top 25%

Action queries Queries that make changes to the data in the underlying table(s). Action queries can: Create a new table (make-table query) Add records to a table (append query) Delete records from a table (delete query) Update the data in a table (update query)

Action query considerations These queries change the underlying tables permanently! Be very careful!!! Always create a select query to test it out first You can then view the results and determine if these are the records you want to alter. When you are sure the query is right, run it as an action query.

Many-to-many Relationships Between Tables A many-to-many relationship exists between tables when the tables involved have multiple matches in each of the tables. For example, if you have a table containing student data and another table containing course data, you could say that this is a (M:N) relationship because a student can take many courses and a course can have many students Many-to-many relationships require a third table that will “link” the two tables together in a one-to-many relationship.

A many-to-many relationship In the figure below, you see an illustration of a many-to-many relationship. Note that the Job table is used to join the Position table and the Student table. The Job table contains a PositionID and a StudentID for each position that a students holds. In this case, a student can have more than one position and a position can be held by more than one student.

A query datasheet for a many-to-many relationship Once you have created the third table (the table that joins the two tables in a many-to-many relationship) you can create a query based on all three tables. The following figure show a query datasheet based on the three tables.