Download Chapter 3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts

Clusterpoint wikipedia, lookup

Relational model wikipedia, lookup

Database model wikipedia, lookup

Microsoft Jet Database Engine wikipedia, lookup

Versant Object Database wikipedia, lookup

Extensible Storage Engine wikipedia, lookup

Entity–attribute–value model wikipedia, lookup

Transcript
New Perspective on Access 2007 Instructor’s Manual
1 of 13
Access 2007
Tutorial 3: Maintaining and Querying a Database
A Guide to this Instructor’s Manual:
We have designed this Instructor’s Manual to supplement and enhance your teaching experience
through classroom activities and a cohesive chapter summary.
This document is organized chronologically, using the same heading in blue that you see in the
textbook. Under each heading you will find (in order): Lecture Notes that summarize the section,
Figures and Boxes found in the section (if any), Teacher Tips, Classroom Activities, and Lab
Activities. Pay special attention to teaching tips, and activities geared towards quizzing your
students, enhancing their critical thinking skills, and encouraging experimentation within the
software.
In addition to this Instructor’s Manual, our Instructor’s Resources CD also contains PowerPoint
Presentations, Test Banks, and other supplements to aid in your teaching experience.
For your students:
Our latest online feature, CourseCasts, is a library of weekly podcasts designed to keep your
students up to date with the latest in technology news. Direct your students to
http://coursecasts.course.com, where they can download the most recent CourseCast onto their
mp3 player. Ken Baldauf, host of CourseCasts, is a faculty member of the Florida State University
Computer Science Department where he is responsible for teaching technology classes to
thousands of FSU students each year. Ken is an expert in the latest technology and sorts through
and aggregates the most pertinent news and information for CourseCasts so your students can
spend their time enjoying technology, rather than trying to figure it out. Open or close your
lecture with a discussion based on the latest CourseCast.
Table of Contents
Chapter Objectives
AC 100: Updating a Database
AC 104: Introduction to Queries
AC 105: Query Window
AC 107: Creating and Running a Query
AC 109: Updating Data Using a Query
AC 110: Creating a Multitable Query
AC 112: Sorting Data in a Query
AC 116: Filtering Data
AC 119: Defining Record Selection Criteria for Queries
AC 128: Defining Multiple Selection Criteria for Queries
2
2
3
3
4
5
5
6
7
7
8
New Perspective on Access 2007 Instructor’s Manual
2 of 13
AC 133: Creating a Calculated Field
AC 137: Using Aggregate Functions
AC 142: Working with the Navigation Pane
End of Tutorial Material
Glossary of Key Terms
9
10
11
11
13
Chapter Objectives
Students will have mastered the material in this tutorial when they can:









Find, modify, and delete records in a
table
Learn how to use the Query window in
Design view
Create, run, and save queries
Update data using a query datasheet
Create a query based on multiple tables
Sort data in a query
Filter data in a query
Specify an exact match condition in a
query
Change the font size and alternating
row color in a datasheet





Use a comparison operator in a query to
match a range of values
Use the And and Or logical operators in
queries
Create and format a calculated field in a
query
Perform calculations in a query using
aggregate functions and record group
calculations
Change the display of database objects
in the Navigation Pane
AC 100 Updating a Database
LECTURE NOTES
 Show how to modify records in a database
 Show how to find data in a table
 Show how to delete a record
BOXES
 Reference Window: Deleting a Record (AC 102)
FIGURES
 Figure 3-1, Figure 3-2, Figure 3-3, Figure 3-4
TEACHER TIP
Be sure students understand that when they delete a record from a table, there is no way to get it back. As is
true anytime they delete something, they should carefully consider whether that is really what they want
to do.
CLASSROOM ACTIVITIES
1. Classroom Discussion: Why is it not necessary to click the Save button when changes are made?
(Answer: Access automatically saves your database when you move the insertion point to a new
New Perspective on Access 2007 Instructor’s Manual
3 of 13
field or to another record, or when you close the table. It is not necessary to click the Save button to
save changes to field values or records.)
2. Quick Quiz:
 ______ a database is the process of adding, changing, and deleting records in database tables to
keep them current and accurate. (Answer: A)
A. Updating
B. Creating
C. Deleting
D. Transforming
 True/False: Deleting a record is not permanent as it can be retrieved from the Recycle Bin.
(Answer: False)
AC 104 Introduction to Queries
LECTURE NOTES
 Introduce students to queries
TEACHER TIP
Make sure students understand that the datasheet from the query is a temporary view of the data. All of the
data still exists in the participating tables even though they might not be displayed in the query datasheet.
CLASSROOM ACTIVITIES
1. Group Activity: Divide students into groups of two or three. Have students consider a table of
student's records. Each group should brainstorm about different queries (questions) they might
want to ask about the student data. Have students make a list of possible queries including the fields
that would be needed and the criteria that would specify which records would be displayed.
Additionally, have the groups think about who might need the results of their list of queries. If
students have trouble getting started, give them one of the following examples:
 A list of students who are from a particular state
 A list of students with a GPA of 3.0
 A list of students with a GPA under 2.0
 A list of students who are math majors
2. Quick Quiz:
 True/False: No Query Wizard exists in Access. (Answer: False)
 True/False: The result of a query is referred to as a recordset. (Answer: True)
AC 105 Query Window
LECTURE NOTES
 Show how to open the Query window in Design view
BOXES
 InSight: Comparing Methods for Adding All Fields to the Design Grid (AC 107)
FIGURES
 Figure 3-5, Figure 3-6
New Perspective on Access 2007 Instructor’s Manual
4 of 13
TEACHER TIP
The Query window in Design view allows students to specify the desired results for a query. It is important
to remember that the result of a query is a temporary view of the data. The contents displayed in a query
are a result of the fields selected and the criteria specified in the query design grid.
When using the Query window, you use “query by example (QBE)”. Help students to understand that they
are creating an “example” of what Access should display as a result of their query. They will use the design
grid to specify the fields they want to see and to specify which records they want to see.
CLASSROOM ACTIVITIES
1. Class Discussion: When you use _________, you give Access an example of the information you are
requesting. (Answer: query by example (QBE)) What key do you press to move to the last field?
(Answer: End)
2. Quick Quiz:
 True/False: The View Table shows a list of tables in the database. (Answer: True)
 True/False: You can use the mouse to drag a field name from the field list to a column in
 the design grid. (Answer: True)
AC 107 Creating and Running a Query
LECTURE NOTES


Demonstrate how to create a query
Demonstrate how to run a query
BOXES
InSight: Query Datasheet vs. Table Datasheet (AC 109)
FIGURES
 Figure 3-7, Figure 3-8
TEACHER TIP
A query result differs from a table's Datasheet view in that only selected fields are displayed. If they move a
field to the design grid and then want to remove it, they can click 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 a
different sort order is specified.
New Perspective on Access 2007 Instructor’s Manual
5 of 13
CLASSROOM ACTIVITIES
1. Class Discussion: What is the difference between a query datasheet and a table datasheet? (Answer:
Although a query datasheet looks just like a table datasheet and appears in Datasheet view, a query
datasheet is temporary, and its contents are based on the criteria you establish in the design grid. In
contrast, a table datasheet shows the permanent data in a table. However, you can update data while
viewing a query datasheet, just as you can when working in a table datasheet or form.)
2. Quick Quiz:
 True/False: A query datasheet displays all the fields in the table in the same order as they appear
in the table. (Answer: False)
 True/False: If you accidentally add the wrong field to the design grid, you will not be able to
remove the field from the grid. (Answer: False)
AC 109 Updating Data Using a Query
LECTURE NOTES
 Demonstrate how to update data using a query
TEACHER TIP
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, you will want to close the query and open the table
in Datasheet view.
Caution students about updating table data in a query. If only a portion of the fields are represented in the
query, there may be fields that are not getting updated.
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: A query datasheet is temporary. (Answer: True)
 True/False: You should check the table to verify that changes you made in the query datasheet
were also made in the table. (Answer: True)
2. Class Discussion: Which key can you press to move through the fields? (Answer: Tab) Once a query is
created, where can you find it? (Answer: In the Navigation Pane)
AC 110 Creating a Multitable Query
LECTURE NOTES
 Demonstrate how to create a query using multitables
FIGURES
 Figure 3-9
TEACHER TIP
A database is almost always made up of a collection of tables. Access is a Relational Database management
system, which allows you to form relationships between the tables. When you form a relationship between
tables, it is said that you are “joining” the tables. Tables are “joined” on common fields between the tables.
New Perspective on Access 2007 Instructor’s Manual
6 of 13
When the tables are “joined”, you can draw data from both tables as if the tables were one combined table.
Tables can be joined in three ways: one-to-one, one-to-many, and many-to-many.
CLASSROOM ACTIVITIES
1. Creative Thinking Activity: Consider using some “real world examples.” Use the class situation, for
example. Say that a class has one teacher and many students. Each student in the class has one
teacher but the teacher has many students. So you can say that the relationship between teacher
and student is a one-to-many relationship. You can use many examples to reinforce the concepts of
relationships. If you use the Mother and child relationship you can say this is a one-to-many
relationship because each child has only one mother, but the mother may have many children. If,
on the other hand, you use the Parent (both mother and father) and child relationship, this would
be a many-to-many relationship because each child has “many” (more than one) parents and each
parent can have many children. One final example would be the husband wife relationship. This is
a one-to-one relationship because each husband has one wife and each wife has one husband.
2. Quick Quiz:
 True/False: A relationship must be established between tables based on a common field that
exists in both tables before you can create a query to display data from both tables at the same
time. (Answer: True)
 True/False: A multitable query is a query based on only two tables. (Answer: False)
AC 112 Sorting Data in a Query
LECTURE NOTES
 Show how to use AutoFilter to sort data
 Show how to sort multiple fields in Design view
BOXES
 Reference Window: Sorting a Query Datasheet (AC 114)
FIGURES
 Figure 3-10, Figure 3-11, Figure 3-12, Figure 3-13
TEACHER TIP
You can control the order of data displayed in a query by altering its sort key. Students will choose a field
on which they want the data to be sorted and then specify whether they want the data sorted in ascending
or descending order. Sometimes they may want to specify multiple fields as the sort key if they want to
arrange data in sorted order within groups of data. They will find that they can easily sort the query in the
query design grid.
CLASSROOM ACTIVITIES
1. Quick Quiz:
 The sort that allows you to sort numerically from lowest to highest is a ____ sort. (Answer: A)
A. Number, Ascending
B. Number, Descending
C. Text, Ascending
D. Text, Descending
 _____ is the process of rearranging records in a specified order or sequence. (Answer: Sorting)
New Perspective on Access 2007 Instructor’s Manual
7 of 13
2. Class Discussion:
What is the AutoFilter? (Answer: It enables you to quickly sort and display field values in various
ways. A menu gives options for sorting and displaying field values. The first two options on the menu
enable you to sort the values in the current field in ascending or descending order. Unless you save
the datasheet or form after you’ve sorted the records, the rearrangement of records is temporary.)
AC 116 Filtering Data
LECTURE NOTES
 Demonstrate how to display records using Filter by Selection
BOXES
 Reference Window: Using Filter By Selection (AC 116)
FIGURES
 Figure 3-14, Figure 3-15
TEACHER TIP
Sometimes database users will want to isolate a certain portion of data in their query results. This is done by
setting a filter, or a set of restrictions, to specify what records they want to view in the results. There are
two methods used to make these selections, “Filter By Selection” or “Filter By Form”. If you no longer want
to view the data with the filter applied, you can simply remove the filter.
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: A filter is a set of restrictions you place on the records in an open datasheet or form
to permanently isolate a subset of the records. (Answer: False)
 True/False: The simplest technique for filtering records is Filter By Selection. (Answer: True)
2. Class Discussion:
What is the difference between Filter By Selection and Filter By Form? (Answer: Filter By Selection
lets you select all or part of a field value in a datasheet or form, and then display only those records
that contain the selected value in the field. Filter By Form changes your datasheet to display blank
fields. Then you can select a value using the arrow that appears when you click any blank field to
apply a filter that selects only those records containing that value.)
LAB ACTIVITIES
Have students try filtering data by various fields and values. Show them examples of setting and
removing filters on several fields. Explain that this is just a temporary filter that can be removed at any
time. The filter does not alter the data in the table at all.
AC 119 Defining Record Selection Criteria for Queries
LECTURE NOTES
 Demonstrate how to specify an exact match using a query
 Show how to modify a query
 Show how to change a datasheet’s appearance
 Show how to change the background color of datasheet rows
 Show how to use a comparison operator to match a range of values
New Perspective on Access 2007 Instructor’s Manual
8 of 13
FIGURES
 Figure 3-16, Figure 3-17, Figure 3-18, Figure 3-19, Figure 3-20, Figure 3-21, Figure 3-22, Figure 323, Figure 3-24, Figure 3-25, Figure 3-26, Figure 3-27
TEACHER TIP
Remind students that they have already learned how to select what fields they want to see in a query
datasheet. In this section, they establish which records they want to see. Be sure to thoroughly cover the
concepts of a condition and how comparison operators are used to establish the condition. Use Figure 3-16
to go over the various operators. Be sure students understand that where there are two symbols in an
operator (such as the less then or equal to operator) there is no space between the two symbols. If they put a
space between the symbols, an error will be created.
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: A comparison operator asks Access to compare the value in a database field to the
condition value and to select all the records for which the relationship is true. (Answer: True)
 True/False: You can make changes to the query if the results are not what you expected or want
to view. (Answer: True)
 You can change the background color for datasheet rows to something more noticeable using
the _________. (Answer: Alternate Fill/Back Color button in the Font group)
2. Creative Thinking Activity:
Have students think of additional examples of the use of the comparison operators.
AC 128 Defining Multiple Selection Criteria for Queries
LECTURE NOTES
 Discuss the logical operators And and Or for multiple selection criteria
 Demonstrate how to create a new query using the And logical operator
 Demonstrate how to create a new query using the Or logical operator
BOXES
 InSight: Understanding the Results of Using And vs. Or (AC 132)
FIGURES
 Figure 3-28, Figure 3-29, Figure 3-30, Figure 3-31, Figure 3-32
TEACHER TIP
When you need to use multiple conditions for a query, you will need to 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.
Spend some time going over the flowcharts in Figure 3-28. This will help the students understand how the
condition works. Use the arrows to follow the chart under the current conditions.
New Perspective on Access 2007 Instructor’s Manual
9 of 13
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: If none of the conditions are met that you specify, Access does not select the record.
(Answer: True)
 To create an OR condition in the Query window, you enter two on conditions on _____.
(Answer: A)
A. separate rows
B. the same row
C. separate design windows
D. separate datasheet columns
 When you want a record selected only if two or more conditions are met, use the __________.
(Answer: And logical operator)
2. Class Discussion:
What is the difference between the And and Or logical operators? (Answer: When you use the And
logical operator to define multiple selection criteria in a query, you narrow the results produced by
the query, because a record must meet more than one condition to be included in the results. When
you use the Or logical operator, you broaden the results produced by the query, because a record
must meet only one of the conditions to be included in the results. This is an important distinction
to keep in mind when you include multiple selection criteria in queries, so that the queries you
create will produce the results you want.)
AC 133 Creating a Calculated Field
LECTURE NOTES
 Discuss calculated fields
 Show how to create calculated fields
 Demonstrate how to format a calculated field
BOXES
 Reference Window: Using Expression Builder (AC 133)
 InSight: Creating Calculated Fields (AC 137)
FIGURES
 Figure 3-33, Figure 3-34, Figure 3-35
TEACHER TIP
Sometimes, students will want a query actually to perform a calculation for them. They will need to enter
an “expression” into the query design grid. They have to be careful when creating an expression that they
are following the rules of precedence. If students want to perform a calculation in a query, they will need to
add a “calculated field” to the query design.
New Perspective on Access 2007 Instructor’s Manual
10 of 13
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: If your field names include spaces in the names, as in the fields “First Name” and
“Last Name,” you must enclose the names in brackets when using them in an expression.
(Answer: True)
 True/False: An Expression Builder is a field that displays the results of an expression. (Answer:
False)
2. Class Discussion:
In class, discuss the importance of understanding calculated fields. Values that are produced by
calculated fields should not be stored as separate fields in a database table. If you store the results of
a calculated field in a table and the data produced by the calculated field becomes outdated, you
would have to update the records in the table datasheet with the current data. It is best to create a
query that includes a calculated field to perform the calculation you want. Then, every time you
open the query, the calculation is performed and the resulting query datasheet reflects the most
current data.
LAB ACTIVITIES
Ask the students to use Expression Builder to build several expressions. If students become familiar
with the use of Expression Builder, they will have a smoother experience in learning to develop
calculated fields. Use Figure 3-33 to guide a discussion of the parts of the Expression Builder dialog
box.
AC 137 Using Aggregate Functions
LECTURE NOTES
 Discuss what an aggregate function is
 Show how to apply aggregate functions using the Totals Row
 Demonstrate how to create queries with aggregate functions
 Show how to calculate statistics for groups of records
FIGURES
 Figure 3-36, Figure 3-37, Figure 3-38, Figure 3-39, Figure 3-40
TEACHER TIP
Use Figure 3-36 to introduce the most commonly used aggregate functions. Be sure to include in your
discussion the “Data Types Supported” so that students understand that they can only use these functions
on supported data types.
New Perspective on Access 2007 Instructor’s Manual
11 of 13
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: Aggregate functions perform arithmetic operations on a database. (Answer: False)
 True/False: You can apply only one aggregate function to a table. (Answer: False)
2. Class Discussion:
Discuss the book. Records are grouped by City, and aggregate functions are used to create totals for
the groupings. Who would use this kind of report? What other ways might this table be grouped?
Why would this be used in an organization? Who would use the report?
AC 142 Working with the Navigation Pane
LECTURE NOTES
 Demonstrate how to group objects in the Navigation Pane
FIGURES
 Figure 3-41, Figure 3-42
TEACHER TIP
Discuss how conditional formatting in a report (or form) is special formatting applied only to certain field
values depending on one or more conditions—similar to criteria you establish for queries. If a field value
meets the condition or conditions you specify, the formatting is applied to the value.
CLASSROOM ACTIVITIES
1. Quick Quiz:
 True/False: You can hide the display of a group’s objects by clicking the bar for the group.
(Answer: True)
 The main area for working with the objects in a database is referred to as the ________.
(Answer: Navigation Pane)
2. Class Discussion:
Discuss the default Tables and Related Views category. (Answer: The default Tables and Related
Views category is a predefined category. You can also create custom categories to group objects in
the way that best suits how you want to manage your database objects. As you continue to build a
database and the list of objects grows, creating a custom category can help you to work more
efficiently with the objects in the database.)
End of Tutorial Material

Review Assignments: Review Assignments provide students with additional practice of the skills they
learned in the tutorial using the same tutorial case, with which they are already familiar. These
assignments are designed as straight practice only and should not include anything of an exploratory
nature.

Case Problems: A typical NP tutorial has four Case Problems following the Review Assignments. Short
tutorials can have fewer Case Problems (or none at all); other tutorials may have five Case Problems.
The Case Problems provide further hands-on assessment of the skills and topics presented in the
tutorial, but with new case scenarios. There are four types of Case Problems:
New Perspective on Access 2007 Instructor’s Manual





12 of 13
Apply. In this type of Case Problem, students apply the skills that they have learned in the tutorial
to solve a problem. “Apply” Case Problems can include “Explore” steps, which go a bit beyond
what was presented in the tutorial, but should include only 1 or 2 Explore steps if any at all.
Create. In a “Create” Case Problem, students are either shown the end result, such as a finished
Word document, and asked to create the document based on the figure provided; or, students are
asked to create something from scratch in a more free-form manner.
Challenge. A “Challenge” Case problem involves 3 or more Explore steps. These steps challenge
students by having them go beyond what was covered in the tutorial, either with guidance in the
step or by using online Help as directed.
Research. In this type of Case Problem, students need to go to the Web to find information that
they will incorporate somehow in their work for the Case Problem.
A tutorial does not have to include each of the four types of Case Problems; rather, the tutorial’s
content should dictate the types of exercises written. It’s possible, therefore, that some tutorials
might have three Case Problems of one type and only one Case Problem of a different type. To
the extent possible, the first Case Problem in a tutorial should be an “Apply” so that the Case
Problems progress in degree of difficulty.

Internet Assignments: Internet Assignments are additional exercises that students access via the Student
Online Companion Web site. These assignments integrate the skills the students learned in the tutorial
with research on the Web. Not all books or tutorials include Internet Assignments; for example, in the
Office First Course text, only the application tutorials (Word, Excel, Access, and PowerPoint) have
Internet Assignments.

Reality Check Exercises: This feature is new for Microsoft Office 2007. Reality Check exercises are
comprehensive, open-ended assignments that give students the opportunity to practice skills by creating
practical, real-world documents, such as resumes and budgets, which they are likely to use in their
everyday lives at school, home, or work. Reality Check exercises are offered at various points
throughout a text, encompassing the concepts and skills presented in a standalone tutorial or a group of
related tutorials.
New Perspective on Access 2007 Instructor’s Manual
13 of 13
Glossary of Key Terms





















aggregate function (AC 137)
All Tables (AC 142)
Alternate Fill/Back Color button (AC 124)
And logical operator (AC 128)
AutoFilter (AC 112)
calculated field (AC 132)
comparison operator (AC 119)
condition (AC 119)
datasheet selector (AC 124)
design grid (AC 106)
editing mode (AC 100)
exact match (AC 119)
expand indicator (AC 103)
expression (AC 127)
Expression Builder (AC 133)
F2 key (AC 100)
field list (AC 106)
filter (AC 116)
Filter By Form (AC 116)
Filter By Selection (AC 116)
Find command (AC 101)
Top of Document





















Group By operator (AC 140)
logical operator (AC 128)
maintain (a database) (AC 100)
navigation mode (AC 100)
nonunique sort field (AC 113)
Or logical operator (AC 128)
plus sign (AC 103)
primary sort field (AC 113)
query by example (QBE) (AC 105)
Query Wizard (AC 104)
recordset (AC 106)
run (a query) (AC 106)
secondary sort field (AC 113)
select query (AC 104)
sort (AC 104)
sort field (AC 112)
subdatasheet (AC 103)
Tables and Related Views (AC 142)
unique sort field (AC 113)
update (a database) (AC 100)
Zoom box (AC 133)