Chapter 2 Querying a Database

Slides:



Advertisements
Similar presentations
Microsoft Access 2010 Chapter 2 Querying a Database.
Advertisements

Access Lesson 8 Using Advanced Queries Microsoft Office 2010 Advanced Cable / Morrison 1.
Chapter 4 Creating Reports and Forms
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Query-By-Example (QBE) 2440: 180 Database Concepts.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Chapter 1 Databases and Database Objects: An Introduction
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
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
Staff Development Daze June 27 & 28 Tony Gauvin. Schedule  Monday June 27  Monday June 27  9:00 – 12:00 Basic Excel  12:00 – 1:00 Lunch for all workshop.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Chapter 1 Databases and Database Objects: An Introduction
Concepts of Database Management Sixth Edition
Microsoft Access 2010 Chapter 7 Using SQL.
Chapter 2 Querying a Database
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
Developing Effective Reports
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
Concepts of Database Management, Fifth Edition
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Database Applications – Microsoft Access Lesson 9 Designing Special Queries Updated 4/11.
Database Applications – Microsoft Access Lesson 9 Designing Special Queries.
Microsoft Access 2010 Chapter 7 Using SQL. Change the font or font size for SQL queries Create SQL queries Include fields in SQL queries Include simple.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Chapter 1 Databases and Database Objects: An Introduction
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 4 BACKNEXTEND 4-1 LINKS TO OBJECTIVES Query Design Query Criteria Modify a Query Using OR.
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.
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 2007 Access Chapter 2 Querying a Database.
Concepts of Database Management Seventh Edition
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create and Open a Database Create and Open a Database.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
Microsoft Access 2010 Chapter 4 Creating Reports and Forms.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 3Performing Queries.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
Spreadsheets What is Excel?. Objectives 1. Identify the parts of the Excel Screen 2. Identify the functions of a spreadsheet 3. Identify how spreadsheets.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
Creating Advanced Queries and Enhancing Table Design.
Microsoft Access 2007 – Level 2
Microsoft Access 2007 – Level 1
Microsoft Office Illustrated Introductory, Windows Vista Edition
Access Chapter 2 Querying a Database.
Querying a Database Using the Select Query Window
Access Maintaining and Querying a Database
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Chapter 1 Databases and Database Objects: An Introduction
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Microsoft Office Illustrated Introductory, Windows XP Edition
Microsoft Office Illustrated Fundamentals
Shelly Cashman: Microsoft Access 2016
Tutorial 5 Advanced Queries and Enhanced Table Design
New Perspectives on Microsoft
Presentation transcript:

Chapter 2 Querying a Database Microsoft Access 2010 Chapter 2 Querying a Database

Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query Create and use parameter queries Use compound criteria in queries Sort data in queries Querying a Database

Objectives Join tables in queries Create a report and a form from a query Export data from a query to another application Perform calculations and calculate statistics in queries Create crosstab queries Customize the Navigation Pane Querying a Database

Create folder for this chapter Create a Ch. 2 folder under your Access folder in your home directory Copy the Camashaly Design database from your chapter 1 folder to your chapter 2 folder to use it for our new projects. Querying a Database

Project – Querying a Database Read Project – Querying a database on pg. 74 Querying a Database

General Project Guidelines – for Queries Identify the fields – which fields from which tables? Identify restrictions – does the query include ALL records or a restricted group? Determine whether special order is required – should you sort the data? Determine whether more than one table is required – special items to take care of if items are from more than one table Determine whether calculations are required – Group totals, individual totals, etc. If data is to be summarized, determine whether a crosstab query would be appropriate – if data is to be grouped by 2 different types of information, a crosstab query will work great! Querying a Database

Creating a Query in Design View Open the Camashaly Design database in your chapter 2 folder. Previously we used the query wizard, now we will create queries in Design view. Click on the Create Ribbon, then on the Query Design button. Add the Client Table (double click, or click then click add button) Close the Show Table dialog box. Resize the box so you can see all the fields Querying a Database

Creating a Query in Design View Querying a Database

Adding Fields to the Design Grid Do page 80-82 You can use the View button or the Run button to see the results of a query. Querying a Database

Using Saved Queries Easily change the layout to modify it for future queries Can be easily printed Querying a Database

Using a Wildcard Wildcard – a symbol that represents any character or combination of characters * - represents any collection of characters ? – represents any individual character Do page 83-86.. Call me over and let me see it. Querying a Database

Using a Wildcard Querying a Database

Parameter Query Sometimes we need to allow the user to enter information which needs to be searched for. Querying a Database

Creating and Viewing a Parameter Query Build a parameter query.. Pg. 87-91 Querying a Database

Using a Compound Criterion Involving AND AND – both criterion must be true (same row) OR – Either criterion must be true (different rows) Querying a Database

Using a Compound Criterion Involving OR Do pages 91-93 Querying a Database

Special Criteria – pg. 94 Range of values for a single field – see example 1 BETWEEN operator – example BETWEEN 1000 and 4000 IN operator – IN followed by a list of values in parenthesis. For example IN (“11”, “14”) Querying a Database

Sort Order What is the sort key? Is there more than one sort key? (Major and Minor) Major sort field MUST appear to the left of the minor sort field in a query! Are there any restrictions? One common restriction is to exclude duplicates. Another is to list only a certain # of records Querying a Database

Clearing the Design Grid Open the query in Design view Click just above the column heading in the first column in the grid to select the column Hold the SHIFT key down and click just above the last column heading to select all the columns Press the DELETE key to clear the design grid Now do pages 96-99 Querying a Database

Creating a Top-Values Query This allows you to show only a specified number of records (top 5, top 10, etc.) Do pages 96-100 Querying a Database

Joining Tables – do you need more than one tables’ information? Finding records in two table that have matching values. See page 101 Querying a Database

Joining Tables Click the Query Design button (Create tab | Queries group) to create a new query Add two related tables to the new query Add the desired fields from each table to the query Next slide Querying a Database

Joining Tables For the JOIN to happen properly… the fields have to be spelled EXACTLY alike, be the same data type, width, etc. If you still don’t have a join line.. .create one yourself… I will show you how. Querying a Database

Joining Tables Do pages 102-108 DO NOT PRINT THE REPORT! Querying a Database

Creating a Form for a Query DO pages 109-110 Querying a Database

Exporting Data to Excel There are many times that others may need the data you have in your tables in some other format…either Word or Excel We have already imported from Excel, now let’s export to excel. There are steps here also to create a .rtf file or a regular text file. Do pages 111-113 Querying a Database

Restricting the Records in a Join Do page 115 Querying a Database

Using a Calculated Field in a Query Is there something that you need to calculate on the fly? If so, Choose a name for the calculated field Determine the format for the calculated field (currency, # decimal places, etc.) Querying a Database

Using a Calculated Field in a Query Do pages 116-119 Querying a Database

Using Criteria in Calculating Statistics There are some built-in statistics such as COUNT, SUM, MIN, MAX, STDEV, VAR, etc. These are called aggregate functions – they perform mathematical functions against a group of records. Do pages 119-122 Querying a Database

Using Grouping Grouping – creating groups of records that share some common characteristic. Do page 122-123 Querying a Database

Crosstab Queries Crosstab queries calculate a statistic (sum, avg, count) for data that is grouped by 2 different types of information. One group will be horizontal and the other vertical (rows and columns) Do pages. 124-128 Querying a Database

What now? Homework Learn it Online – Labs Pg. 129- Who wants to be a Computer Genius? Make sure you choose Chapter 2 www.scsite.com/ac2010 You can do a screen capture or print it.. But you get what you get, got it? Labs In the Lab, Lab 3 – Philamar Training DB – pg. 135 Cases & places Case 1 – Chamber of Commerce – pg. 135-136 BEFORE you can do the labs for this chapter… you better make REALLY sure that your tables are corrected from ch. 1 Test - TBD Querying a Database