Database Systems Microsoft Access Practical #3 Queries Nos 215.

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?
Microsoft® Office Access® 2007 Training
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.
Access Lesson 8 Using Advanced Queries Microsoft Office 2010 Advanced Cable / Morrison 1.
Exploring Microsoft Access
Pivot Tables Need HW and exam. Why? A pivot table gives you a way to group, summarize and compare data in a spreadsheet. You can do the same tasks with.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Automating Tasks With Macros
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 Using the Select Query Window
Chapter 2 Querying a Database
Build a database IV: Create queries for a new Access database Overview: Ask your data — create queries It’s time to create queries, one of the most powerful.
Business Computer Information Systems Microsoft Office XP Access Review Lessons 1 through 5.
Datasheets II: Sum, sort, filter, and find your data Overview: Sum it up, and more Access 2007 makes it easier than ever to perform math functions on your.
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Exploring Office Grauer and Barber 1 Information From the Database: Reports and Queries(Wk4)
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 1 – Access Basics.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
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.
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 Access Get a green book. Page AC 2 Define Access Define database.
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.
Microsoft ® Office Access ® 2007 Training Datasheets II: Sum, sort, filter, and find your data ICT Staff Development presents:
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
Analyzing Data For Effective Decision Making Chapter 3.
Microsoft ® Access ® 2010 Training Create Queries for a New Database If a yellow security bar appears at the top of the screen in PowerPoint, click Enable.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a.
Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! With Microsoft ® Office 2007 Intermediate Chapter.
Database Systems Microsoft Access Practical #1 Creating Tables Nos 215.
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 - Information From the Database: Reports.
Analyzing Data Using Access. Creating a new database To create a new database 1.Start Access. In the Task Pane, click Blank Database. 2.The File New Database.
Database Systems Microsoft Access Practical #2 Making Forms and Reports Nos 215.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
CSC 240 (Blum)1 Introduction to Data Entry, Queries and Reports.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics Covered Understanding different types of Queries Creating a Query Creating a Query using a Wizard Changing.
Chapter 3 Query and Report. Agenda Report types Report contents Report creation Report design view Query and dynaset Function and grouping Action query.
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.
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.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
Lesson 01: Introduction to Database Software. At the end of this lesson, students should be able to: State the usage of database software. Start a database.
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.
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.
Microsoft Access Intro Class 9 Report 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)
DAY 18: MICROSOFT ACCESS – CHAPTER 3 CONTD. Akhila Kondai October 21, 2013.
Microsoft Access Lesson 5 Lexington Technology Center February 25, 2003 Bob Herring On the Web at
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.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
Datasheets II: Sum, sort, filter, and find your data – Easy math, sorts, and searches Lesson 19 By the end of this lesson you will be able to complete.
Microsoft Office Access 2010 Lab 3
Microsoft Access 2013 Bobby Wan.
Queries.
DATABASE CONCEPTS A database is a collection of logically related data designed to meet the information needs of one or more users Data bases are store-houses.
Plug-In T7: Problem Solving Using Access 2007
Microsoft Access 2003 Illustrated Complete
IT 244 Database Management Systems Lecture 2
Microsoft Official Academic Course, Access 2016
New Perspectives on Microsoft
Presentation transcript:

Database Systems Microsoft Access Practical #3 Queries Nos 215

Queries You use queries to view, change, and analyze data in different ways. You can also use them as a source of records for forms, reports, and data access pages. There are several types of queries in Microsoft Access. –Select Queries –Parameter Queries –Crosstab Queries –Action Queries –SQL Queries

Select Queries The simplest type of query is a select query that will let you select certain data based on criteria you provide This is the query that will come up if you choose “Create query by wizard” It retrieves data from one or more tables and displays the results in a datasheet where you can update the records sometimes You can also use a select query to group records and calculate sums, counts, averages, and other types of totals.

Select Queries If you create a query by wizard, you will see the familiar screen letting you choose what you want to include in your query The next screen will ask for “Detail” or “Summary.” Detail will put all the information in your results. Summary will let you summarize different field types. For example, you can take the average of all the ages instead of displaying just the age of a person. Then when you are done with the wizard, you will see the datasheet with the data you selected

Select Queries: Design View So to get the good functionality out of Access we need to look at the Design view of the query. The design view will show tables at the top half (you can add more by right clicking and going to ‘Show Table’) Then you can drag fields you want to appear to the bottom. The bottom contains all the fields in your query and whether you want to show them. You can also sort based on certain ordering here

Select Query: Criteria There will also be many times when you want to select items based on different criteria (Example, select all people with name of sione) If this is the case, you can add in stuff in the criteria field on the bottom of the design view For example, if you have a field called names and you just want to see “Sione,” inside the Criteria field, you will put = “Sione” This works for other cases, like if you have a field called age and you want all the people over 50, put > 50

Action Queries An action query is a query that makes changes to or moves many records in just one operation. There are four types of action queries: –Delete – a query to delete a number of records –Update – a query to update records –Make-Table – create a new table from parts of other tables –Append – add records from one table to the end of another table.

Action Queries To make an action query, go to the design view and select one of the actions (delete, update, append, make-table) from the Query menu If you choose “Update” for example, the parts below will be changed to have an “Update to” field appear. This is where you can put in a new value that the records will be updated to If you choose “Delete” a “Delete” field will appear. It will say “Where” and this lets you add criteria. So to delete all people over fifty, you would add in the criteria field > 50

Action Queries Append – By choosing an append query you can add records from one table to the end of another. When you choose it, a new window will appear asking for where the data will be appended to Then you can construct a query, and the results of that query will be put into the table you have chosen. This can be helpful if you have another database and you need to put the data in, but don’t want to type everything Finally, when you are done making your query in design view, make sure to hit the “!” button to make it run.

Crosstab Queries You use crosstab queries to calculate and restructure data for easier analysis of your data. Crosstab queries calculate a sum, average, count, or other type of total for data that is grouped by two types of information — one down the left side of the datasheet and another across the top. They are just a different way to display data that limits the presentation to three categories (the row header, the column header and the values)

Crosstab Queries To create a crosstab query, you can start with your standard query and then go to design view. Then select from the Query menu, Crosstab. Another row on the bottom level will appear that says “Crosstab” Here is where you will select one row, one header and one column that will contain the values. For example, if you had a table of family members and you wanted to see their ages grouped by their name and their gender: –Select name as the Row Header, Gender as Column Header, age as Values

Crosstab Queries Crosstab queries are also a good way to see calculations on data. When you select a field as the “Values” you can also change how the data is computed from the line that says “Total” The column and the row headers will say “Group by” and you are able to change the Value field to Sum, Min, Max, Avg and so on. If you have data that is similar and can be grouped together, the Value field will then be displayed as a composite of all the Values that match

Parameter Queries A parameter query is a query that, when run, displays a box prompting you for information, such as criteria for retrieving records or a value you want to insert in a field. You can design the query to prompt you for more than one piece of information; for example, you can design it to prompt you for two dates. Microsoft Access can then retrieve all records that fall between those two dates. Parameter queries can also be good for reports and forms that ask the user for a certain of data to be entered.

Parameter Queries To create a parameter query, click in the criteria section and enter an expression that will be used by the query Examples –To make the user enter a name to select by, put in the criteria field = [Enter Name:] –To make the user enter an age that will be greater than all the ages selected < [Enter Maximum Age:] The general rule is that you put the symbol you want to compare against (=,>,<, LIKE, etc), then, inside brackets, put the message you want to appear

Parameter Queries Suppose you had a date and you wanted the user to enter two dates to mark all the acceptable dates Inside the criteria field, we can put two dates with the following code: Between [Enter First Date:] and [Enter Second Date:] The dates the user enters will bound the select query

The Union Operator Just like in the theory part of the class, there is a real world Union operator. It will take two tables and combine all their fields into one beautiful table Go to the Query menu, then SQL Specific and then choose Union. A window will appear that will be blank. Unfortunately, we have to paste in or write SQL queries here. What we can do is make two queries, then paste them in and put “union” between them. The result will be a new table with both values

Union Simple union example. –Say we had two tables. One is mothers, the other is children. –First we make a query to select the name and age select name,age from Mothers –Then we make a query to select name and age from Students select name,age from Students –Now we take them both and put them in the Union window –select name,age from mothers UNION select name,age from Students The result will be one big table

SQL Queries Most of the queries you create with the Wizard or design have counterparts in the SQL language. In fact, all your queries are turned into the SQL language before they are actually executed. You can see what the SQL code is for any query after you create it by clicking on SQL View in the View menu. You are also able to create your own SQL queries in here, which you can do once we learn the language.