Вы находитесь на странице: 1из 16
9 Advanced Tables
9
Advanced Tables

LESSON SKILL MATRIX

Skill Exam Objective Objective Number Creating a Custom Table Create tables in Design View. Modify
Skill
Exam Objective
Objective Number
Creating a Custom Table
Create tables in Design View.
Modify the field description.
2.1.1
2.2.7
Using the Table Analyzer
Summarizing Table Data
KEY TERMS
aggregate functions
Table Analyzer
Totals row
224
Copyright © 2012 John Wiley & Sons
225
225

Advanced Tables

Lu and add aTotals row to a table.
Lu
and add aTotals row to a table.

CREATING A CUSTOM TABLE

Lucerne Publishing is a large publisher with a variety of products. You have just been

hi hired as sales manager for the business books division.You will be responsible for work-

i ing with the salespeople in your division to increase sales. The previous sales manager

used Access 2010 to track sales, so some data is already available. In this lesson, you

create a new custom table, use the Table Analyzer to divide one table into two tables,

The Bottom Line

When a table template doesn’t suit your needs, you can create a custom table in Design View. In Design View, you can insert fields, set data types, and perform other advanced table design tasks.

Creating a CustomTable Creating a CustomTable Creating a table from scraratch in Design View gives
Creating a CustomTable
Creating a CustomTable
Creating a table from scraratch in Design View gives you maximum fle
thing you needede
tto dooo to create the tablee iiiinnn Design View, including
and and ththththen then add add fieldddds fields for for the the newww new table table in in Design Design View. View.
Field Field Properties Prrroperrties section section of of thththhhe the deesisisisiignnn design grid. grid.
a a primary primary key, kekkk y, Access AAccess will will prompt ppprompt you yoyy u to to do do so sooo when when you you save save the the table. ta
Create a Custstoommmm TTaabbble inn DeDeDeDeDeDeesisigngnnnnnn VVVVieieeew
Create a Custom Table in Design View
GET READY. Before you begin these steps, be sure to turn on and/or log on to your
GEGEGEGET READY. Befooro eee you begin these stepeepeps, be sure to tttturrrn on and
commputer computer and and LAUNCH LAUNCH Access. Access.
is
1. 1.
OOPO OPEN EN Lucerne Lucerne Publishing Puuuublisiisiishing f from om the the data data files files for for this thththhis lesson. lesson.
2. 2.
SASAAAVVEV
SAVE the database as Lucerne PublishingXXX (where XXX is your initials).
the database aas LLLuuceerne PublishingXXXXXXX (where XXX is
3. 3.
On t hehehehe C reate ta b, i n th e Ta bles group, cl icccck thththththth e Tab l e Desi gn b
is is creatededededd created iin in Deeesign Design View, View, as as shown shown in innnnn FFFFiiigure Figure 9-1. 9-1.
e 9-1
Field Field Name Name column column
Data Data Type Type column column
Description Description column column
New
blank
table
Row
selector

Creating a table from scratch in Design View gives you maximum flexibility. You can do every-

thing you need to do to create the table in Design View, including adding fields, setting data

types, types, definnninininining defining fifield field properties, properties, and and defining defining a a primary prprprprprp imary key. key. As As you you create c a table, you can also

easily easily insert iinsnnssert and and delete deeellelete rows rows in in your youuuur table table design. design. In InInIn tthis this exercise, exercise, yo you create a new blank table

Creating Crrreating a a new new field field for for a a table table in in Design Design View View includeses includes keying keying the the name in the Field Name

column; ccoluuuumn; choosing choosing a a data data type type fromm from the the menu menu in in the the Data Data Type Type column; column and keying a description,

if iifi you you want, want, in in the the Description DeDDD scririiption column. colulull mmn. Additionallylylyly, Additionally, you you can can mod modify field properties in the

After After you you haveee have completed completed your your table taaaaaable design, design, youu’uuu you’ll ll need need to to save save it. it. If If y you haven’t already defined

STEP BY STEP

The Lucerne Lucerne

Publishing file for this

lesson is available on the the

book companion website bsite or in WileyPLUS.

Figure 9-1

Blank table in Design View

On the Create tab, in theTables group, click the Table Design button. A new blank table

group, click the Table Design button. A new blank table WileyPLUS Extra! features an online tutorial
group, click the Table Design button. A new blank table WileyPLUS Extra! features an online tutorial

WileyPLUS Extra! features an online tutorial of this task.

Field Properties section

Displays information about the location of the insertion point

Copyright © 2012 John Wiley & Sons

226 Lesson 9
226 Lesson 9

4. Key ID in the Field Name column, as shown in Figure 9-2.

Key ID in the Field Name column, as shown in Figure 9-2. Figure 9-2 Field Name

Figure 9-2

Field Name in Design View

5. Press the Tab key to move to the DataType column.

6. 6. Click the down arrow in the Data Type column and select AutoNum records
6.
6. Click the down arrow in the Data Type column and select AutoNum
records records starting startingngnggg at at 1. 1.

Click the down arrow in the DataType column and select AutoNumber from the menu,

as as shown shown in in Figure Figure 9-3.The 9-3.The AutoNumber AutoNuuumber data data type type will will automatically automatica number your

type will will automatically automatica number your Figure 9-3 Data Types menu in Design View 7.

Figure 9-3

Data Types menu in Design View

7.

Press the Tab key to move to the Description field.

8.

Key Record Number and press Tab again to move to the next blank field row.

9.

Key Gross Sales and press the Tab key.

10.

Click the down arrow on the DataType column and select Currency from the menu.

11.

Click in the Decimal Places row in the Field Properties section. Click the down arrow and select 0 from the menu, as shown in Figure 9-4.

Copyright © 2012 John Wiley & Sons

Advanced Tables 227
Advanced Tables
227
Figure 9-4 e 9-4 Field Properties in Design View View 1112 Enter the remaining fields,
Figure 9-4
e
9-4
Field Properties in Design View
View
1112 Enter the remaining fields, asas shown in Figug re 9-55, fooormatting
12.
daaaata type and 0 ddecimiimmal placess.s
data type and 0 decimal places.
Row selector
selector
Figure 9-5
e
9-5
Custom table in Design View
View
13. 13.
Click the row selector to the left of the ID field to select the row.
Click the row selector to the left of the ID field to select the ro
14. 14.
On the Design tab, in theTools group, click the Primary Key button.
On the Design tab, in the Tools group, click the Primary Key bu
2.1.1
15.

How do you create tables in Design View?

Enter the remaining fields, as shown in Figure 9-5, formatting each with the Currency

Click the Save button on the Quick AccessToolbar.The Save As dialog box appears.

16. Key Sales and click OK.

PAUSE. LEAVE the database open to use in the next exercise.

2.2.7
2.2.7

How do you modify the field description?

exercise. 2.2.7 How do you modify the field description? Another Way You can also right- click

Another Way

You can also right- click a selected row and choose Insert Rows or Delete Rows from the shortcut menu.

Inserting and Deleting Rows

When creating a custom table in Design View, you can insert and delete rows as needed using the Insert Rows and Delete Rows commands in the Tools group on the Table Tools Design contextual tab. When you click the Insert Rows button, a new row is inserted above the selected row. The field order from top to bottom in Design View will be displayed from left to right in Datasheet View. In this exercise, you insert and delete rows using the new table you created in the previous exercise.

Copyright © 2012 John Wiley & Sons

228 Lesson 9
228 Lesson 9

STEP BY STEP

Insert and Delete Rows in Design View

USE the database open from the previous exercise.

1. Click the row selector to the left of the Gross Sales field to select the entire row.

2. In theTools group on theTableTools Design contextual tab, click the Delete Rows button.The field row is deleted from the table.

3. Click the Undo button on the Quick AccessToolbar.The field row reappears.

4. In theTools group on theTableTools Design contextual tab, click the Insert Rows button. A blank row is inserted above the Gross Sales field.

5. In the Field Name column, key Area and press the Tab key.

6. Press the Tab key again to accept the Text data type.

7. Leave the Description field blank and press Tab again to move to the next field.

8. Click the Save button on the Quick AccessToolbar.

9. Switch to Datasheet View and enter the records in the table as sho 9.
9. Switch to Datasheet View and enter the records in the table as sho
9.
Figure 9-6
Sales table e
10. Save and close tht e tttatt bblblbbb e.
10. Save and close the table.
PAUS PAUSE. E. LEAVE LEAVE the the database daaataa abbbbb ase open o p n to to use use in innnn thhh the e next next exercisesese exercise.
USING THE TABLE ANALYZER
USINGGGGG THTT
E TABLE ANALALYZYZYZZER
The TTTTaaaaablblblblbleeeee AnAnAnAnAnAnAnAnAnAnAnnnnnalalalalala yzyzyzyzzererererer is a wizard that performs the nonoorrrmalization proce
ing a table designgngnn aandnnn
suggesting a way to divideee ththththtt e table for maximum
The Bottom Line

Switch to Datasheet View and enter the records in the table as shown in Figure 9-6.

The The ID ID field field will will be be automatically automatically generated, generated, so so just just press press Tab Tab to to get g past it.

just just press press Tab Tab to to get g past it. The Table Analyzer is

The Table Analyzer is a wizard that performs the normalization process for you by examin-

ing a table design and suggesting a way to divide the table for maximum efficiency. The Table

Analyzer Analyzer helps helps you you design design efficient efeffificient tables. tables. The TTTThehehhe Table Table Analyzer Analyzer will will suggest sugges primary keys for the

new new tables tables or or will will allow allow you you to to determine determine the the primary primary keys. keys. You You can can also also h have the wizard insert a

unique i identifier id ififi fifi field. ld If If i it d determines i that h a table bl h has d duplicate li i information, f it can split a table

into two more efficient tables for you, or you can choose to do it yourself. You can create the new tables yourself if you prefer.

Using theTable Analyzer

The Table Analyzer is a wizard that examines a table and asks you a series of questions about the table to determine whether it should be divided into two or more tables. In this exercise, you use the Table Analyzer Wizard to analyze a table in the database.

Well-designed databases do not store data in more than one place. Redundant data storage takes more disk space and increases the likelihood for data entry errors. In Lesson 1, you were intro- duced to the concept of normalization, which is the process of applying rules to a database design to ensure that you have divided your data into the appropriate tables.

In the Books table, contact information for authors has to be entered for each book the author wrote. The Table Analyzer Wizard will determine that a more efficient database would split the table into two tables—one with author contact information and one with book sales data.

Copyright © 2012 John Wiley & Sons

Advanced Tables 229
Advanced Tables
229
Advanced Tables 229 Ref Lesson 1 contains more information about normalization. In addition to analyzing the

Ref

Lesson 1 contains more information about normalization.

In addition to analyzing the table, the Table Analyzer Wizard will also analyze the redundant data in a table and suggest corrections for records that should match. It will also give you the choice of whether to create a query, which is similar to the original table. Creating the query allows forms and reports that were created with the original table to continue to function properly. The original table may be renamed, but it will not be removed or altered.

table may be renamed, but it will not be removed or altered. Troubleshooting If you run

Troubleshooting If you run the Table Analyzer before entering records in the table, you may get a message stating that you need to enter at least two records in the table to get a meaningful analysis.

STEP BY STEP

Use the Table Analyzer

USE the database open from the previous exercise. USE the database open from the previous
USE the database open from the previous exercise.
USE the database open from the previous exercise.
1. 1.
Open the Books table.
Open the Books table.
2. 2.
Scroll thththhrororough the table to become famimimimililliliaraa with the fields in t
3. 3.
On thehhehe DatabaseToo s a ,
tht e Analyze grouououup, click the Anal
fi rsrssss t Ta ble An alalalaal yzy zzz W i
d sscssscs c reen appears, as ssss hhhohh oo wn in Figur e
e 9-7
izard,
4. 4.
Click the Next > button.The secondTable Analyzer Wizard scree

screen reen 1 1

Scroll through the table to become familiar with the fields in the table.

On the DatabaseTools tab, in the Analyze group, click the Analyze Table button.The

firstTable Analyzer Wizard screen appears, as shown in Figure 9-7. This first dialog box

pprovides provides more more informatioooon information about about the the types types of of prororroroblb problems ems the the w wizard will find.

Figure 9-7

Table Analyzer Wizard,

Click the Next > button.The secondTable Analyzer Wizard screen appears, as shown in

Figure 9-8.This dialog box provides more information about what the wizard will do.

Figure 9-8

Table Analyzer Wizard, screen 2

about what the wizard will do. Figure 9-8 Table Analyzer Wizard, screen 2 Copyright © 2012

Copyright © 2012 John Wiley & Sons

230 Lesson 9
230 Lesson 9

5. Click the Next > button.The thirdTable Analyzer Wizard screen appears, as shown in Figure 9-9.

Figure 9-9

Table Analyzer Wizard, screen 3

in Figure 9-9. Figure 9-9 Table Analyzer Wizard, screen 3 6. 6. The Bookkkssss table should
6. 6. The Bookkkssss table should be selected in the list; ifffff itititit is not,
6.
6. The Bookkkssss table should be selected in the list; ifffff itititit is not, select it.
7.
7. The Yes, lett thththththheee wizard decide button shououououldldldddd be selected; if it is n
the Next > buttonnn TTTTThe fifth Table Analylylylyzezzezer Wizard screen appears
Figure Figure 9-11. 9-11.

The Books table should be selected in the list; if it is not, select it. Click the Next >

buttonnn. button.The ThTTThe fourth fourthTable TTTable Analyzer Analyzer WWWizard Wizard screen screen appepepears, appears, as as shown shown in Figure 9-10.

Figure 9-10

Table Analyzer Wizard, , screen 4 4

The Yes, let the wizard decide button should be selected; if it is not, select it. Click

the Next > button. The fifth Table Analyzer Wizard screen appears, as shown in

Figure 9-11

Table Analyzer Wizard, screen 5

Table names

Rename Table button

9-11 Table Analyzer Wizard, screen 5 Table names Rename Table button Tips button Copyright © 2012

Tips button

Copyright © 2012 John Wiley & Sons

Advanced Tables 231
Advanced Tables
231

8.

Scroll to the bottom of theTable2 box and click the Year field to select it. Notice that the wizard has placed it in the wrong table.

9.

Drag the selected field to theTable1 box. Position the horizontal black line below the BookTitle eld and release the mouse button to place the Year eld in its new location.

10.

Click the Table1 name to select it. Click the Rename Table button.TheTable Analyzer Wizard dialog box appears, as shown in Figure 9-12.

Figure 9-12

Rename Table dialog box

as shown in Figure 9-12. Figure 9-12 Rename Table dialog box 11. Key Book Sales and

11. Key Book Sales and click OK.

12. 12. Click the Table2 name and click the Rename Table button.The dialog dialog box
12. 12.
Click the Table2 name and click the Rename Table button.The
dialog dialog box box appears. appears.
13. 13.
Key Author Contact Information and click OK.
Key Authorooroorr CoCoCoContnn act Information andndndndd ccclick OK.
14. 14.
Contact Coooontntnttact Informmmattion Information field field was wasss added. added.
15. 15.
ScScScScScroll throughhhh the Authorrrrr Contact Information ttattabblbbb e. Notice th
IIDII
field was added as a primary key. Click the Nextxtxtxt > button.T
Wizard Wizard screen screen appears, appears, as as shown shown in in Figure Figure 9-13. 9-13.
9-13
Set Unique Identifier button
Set Uniqqqqque Identifier button
izard,

screen reen 6 6

Click the Table2 name and click the Rename Table button.TheTable Analyzer Wizard

Scroll Scrolllll dddown down to to the the bottom bottom of of the the Book Book Salelelelelesss Sales table. table. Notice Notice that that the Lookup to Author

Scroll through the Author Contact Information table. Notice that the Generated Unique

ID field was added as a primary key. Click the Next > button.The sixthTable Analyzer

Figure 9-13

Table Analyzer Wizard,

sixthTable Analyzer Figure 9-13 Table Analyzer Wizard, Another Way You can also double-click a table name

Another Way

You can also double-click a table name to launch the Table Analyzer Wizard Rename Table dialog box.

16. Click the ID field in the Book Sales table to select it. Click the Set Unique Identifier button. A primary key is inserted.

17. Click Next >.The seventhTable Analyzer Wizard screen appears, as shown in Figure 9-14.

Copyright © 2012 John Wiley & Sons

232 Lesson 9
232 Lesson 9

Figure 9-14

Table Analyzer Wizard, screen 7

232 Lesson 9 Figure 9-14 Table Analyzer Wizard, screen 7 18. 18. N otice tha t
18. 18. N otice tha t thththththh ee TTTa bl e A nalyzer W izard
18. 18.
N otice tha t thththththh ee TTTa bl e A nalyzer W izard has dedede ttetetete ct ed two similar rec
Correction field and select Leave as is.This is the correct record.
Correcccctittitit on field anndndndn
select Leavaveee as is. This is the cococorrrrrr ect record.
19. 19.
Click tttht e down arrow on the sse ond row of the Correcececectit on field an
Correction Cooooorrection menu meeenu
20. 20.
Click Next >>. ThThThThThe final Table Analyzer Wizard ssscrcrcreeee n appears, as show
Table Analyzer Wizard ssscrcrcreeee n appears, as show Notice that theTable Analyzer Wizard has detected two

Notice that theTable Analyzer Wizard has detected two similar records, one with an

incorrect incorrectt zip zizzziip code code and and phone phone number. number. Click Click the the down dodododoown arrow arrow in in the the first row of the

Click the down arrow on the second row of the Correction field and select the Tomic

correection correction from from the the menu, menu, as as shown shown in in Figure Figure 9-15, 9-15, to tooo replace reeplace the the incorrect record.

Figure 9-15

Corrections to the new tables s

Click Next >.The final Table Analyzer Wizard screen appears, as shown in Figure 9-16.

Figure 9-16

Table Analyzer Wizard, final screen

Copyright © 2012 John Wiley & Sons

Advanced Tables 233
Advanced Tables
233

21. The Yes, create the query option button should be selected. Click the Finish button.

22. A message saying that the new query will be saved as Books_NEW appears. Click OK.

23. If Access Help appears on your screen, close it.Your screen should look similar to Figure 9-17.

close it.Your screen should look similar to Figure 9-17. 9-17 eated 24. Close all tttablees anddddd
9-17 eated 24. Close all tttablees anddddd qqquqq eries. 24. Close all tables and queries.
9-17
eated
24. Close all tttablees anddddd qqquqq eries.
24.
Close all tables and queries.
PAUSE. PAUSE. LEAVE LEAVE the the ddddataba database as e open open to to usee use in in the the next next exer exercise. cc ise.
SUMMARIZING TABLE DATA
SUUUUMMARIZING TAB E DATA
It is ooofo ten necessary to count or summarize data inn aaaa table colum
e
b be e more more usususs useful. efefefefefef ulu . The The Totals To ta ls row r ow makes makes these these tasks t asass ksksksksksk easy. e as y.
SummarizingTable Data
SummarizingTable Data

Figure 9-17

New tables and queries created

by the Table Analyzer Wizard Wizard

The Bottom Line

It is often necessary to count or summarize data in a table column by column. Tables that

containnnn contain columns cccoc lumns of of sales salaa esss figures fifigureseseseses or or other other numbers numbers nenneneneneed need to to be be summed, summe averaged, or counted to

Much like the bottom row of a spreadsheet, the Totals row is a feature in Access 2010 that makes

it easy to sum, average, or count the values in a datasheet column. You can also find maximum

or minimum values and use statistical functions such as standard deviation and variance. In this exercise, you summarize table data by inserting a Totals row.

Take Note

summarize table data by inserting a Totals row. Take Note Aggregate functions are functions that calculate

Aggregate functions are functions that calculate values across a range of data, such as in

a column. You can use these functions in queries or in Visual Basic for Applications (VBA)

code. Although you can still use those methods, the Totals row saves you time by allowing you to choose one of these functions from a menu, applying it instantly. The Totals row is a row inserted at the bottom of a table that provides a menu of functions for each column in the row.

provides a menu of functions for each column in the row. You can also add a
provides a menu of functions for each column in the row. You can also add a

You can also add a Totals row to queries open in Datasheet View and to a split form open in Form View. You cannot add a Totals row to a report, but you can use aggregate functions in reports using other methods.

Copyright © 2012 John Wiley & Sons

234 Lesson 9
234 Lesson 9

STEP BY STEP

Insert a Totals Row

USE the database open from the previous exercise.

1. Open the Book Sales table.

2. On the Home tab, in the Records group, click the Totals button.TheTotals row appears below the asterisk (*) row.

3. Click the down arrow in the BookTitle column of theTotals row. Select Count from the menu, as shown in Figure 9-18.The number of records in the column is counted, and the number 11 is displayed.

Figure 9-18

Dropdown Dropdown menu menu of of available available functions functions fffor for column column Totals
Dropdown
Dropdown
menu menu of of
available
available
functions functions
fffor for column column
Totals row
Totalss row
4. 4.
Clicck the down arrorororow in the Domestic Salalalalala es column of the Totals ro
fromomomomomomm from the the menu. menu.
5. 5.
Clickkk ttthe down arroww in ttthe International Sales columnmmmn of theTotal
Sum from the menu.Your screen should look similar to Figure 9-19.
Sum fffrorororom the menu. Youuur sccreeen should look similalallalaar to Figure 9-1

Totals row

Click the down arrow in the Domestic Sales column of theTotals row and select Sum

Click the down arrow in the International Sales column of theTotals row and select

Figure 9-19

Totals row in the Book k Sales table e

Copyright © 2012 John Wiley & Sons

Advanced Tables 235
Advanced Tables
235

6. Save the table.

7. On the Home tab, in the Records group, click the Totals button. The Totals row is hidden.

8. On the Home tab, in the Records group, click the Totals button again.TheTotals row reappears.

9. Save and close the table.

CLOSE Access.

Table 9-1 describes the aggregate functions available in the Totals row and the data types that they work with.

Table 9-1

Aggregate Function Description Data Types Average Calculates the average value for a Number, Decimal, Currency,
Aggregate Function
Description
Data Types
Average
Calculates the average value for a
Number, Decimal, Currency,
column column
Date/Ti Date/Time
Count Count
Counts the number of items in a
Counts theheh
numuumummmber of items in a
All All (exc (except multivalued list)
column column
Maximum Maximuummmmm
Returns Returnnsssss the the item item with with the theeeee highest hihihihighg est
Numbe Number, Decimal, Currency,
value valulululuuueee
Date/Ti Date/Time
Minimum MMiniiimum
Returns RReturns the the item item with with the the lowest lowestt
Numbe Number, Decimal, Currency,
value value
Date/Ti Date/Time
Standard Standdard Deviation Deviation
Measures how widely values are
Mea ureess howo
widely valul es are
Numbe Number, Decimal, Currency
dispersed disperererersed from from an an average averaagaa e value value
Sum um
Adds Adds items items in in a a column column
Number, Numbe Decimal, Currency
Variance ariance
Measures Measurrres the the statistical statisticii al variance variance of of
Number, Numbe Decimal, Currency
all all values values in in the the column collulul mn
As shown in the table, some functions only work with certain data types. For example, you
AsAsAsAs shown in the tablllle, some functionss onllllyl
work with certain dat
cannot sum a column of text, so that function would not be available for a column with the
cannot sum a column of text, s
that funnction would nnonotttt be availa
daaatatata data type type of of text. text.
If you wwwant to sort orrr fifiltter dddadata, Access will excludeeee ththhe Totals row b
If you want to sort or filter data, Access will exclude the Totals row by default.
SKILL SUMMARY
SKILL SUMMARY

Aggregate Functions in the Totals Row

Take Note

In This Lesson You Learned How To:

 

Objective

Exam Objective

Number

Create a Custom Table

Create tables in Design View. Modify the field description.

2.1.1

2.2.7

Use the Table Analyzer

Summarize Table Data

Copyright © 2012 John Wiley & Sons

236 Lesson 9
236 Lesson 9
Knowledge Assessment
Knowledge Assessment

Matching

Match the term in Column 1 to its description in Column 2.

Column 1

Column 2

1. aggregate function

a.

square to the left of a field in Design View

2. Table Analyzer

b.

inserts a blank row above a selected row in Design View

3. Totals row

c.

the process of applying rules to a database design to ensure that you have divided your information into the appropriate tables

4. row selector

d.

a wizard that performs the normalization process by

examining a table design and suggesting a way to divide

the the table table for for maximum maximum efficiency efficiency 5. 5. Insert Rows button
the the table table for for maximum maximum efficiency efficiency
5.
5.
Insert Rows button
Insert Rows button
e.
e.
an aggrerereregag te function that counts the
6.
6.
Delete Rowssss bububbbubbutton
Delete Rows button
f.
f.
an optional part of Design View where you can enter a
an optional papapartrtrtrrt oof Design View wher
field field description description
7.
7.
normalization
normalalalliization
g.
a ddddata type
a data type
8.
8.
couuntttt
count
h.
h.
fu ction that calculates vvalaaa ues across
function that calculates values across a range of data
9.
9.
currency
cuuuurrrrrency
i.
i.
a row inserted at the bottom of a table that provides a
a row inserted at the bottttom of a tabl
menu menu of of functions fuf nctionssssss for for each eaeaccch column ccolumn in in the row
10.
10.
description
descripptpp ionnn
j.
j.j
delettteses a selected fielddddd row in Design
deletes a selected field row in Design View
True/False
True/False
Circle
Circle T if the statement is true or F if the statement is false.
if the statemennt is true orrr F if the stttttatement isss falllslse.
T
T
F F
1. 1. If If you you havvvven’t haven’t aalreeaee already dy deefiefiee defined nedddd a a primary prririmary key, key, Access Access will will prompt p you to do
so so when wheeeen yoouuu you save saave the the t table bleee in in DeDeDeDDeDesiggn Design View. View.
T
T
F F
2. Well-dessisisigneededd databases storee dattttta in more thaan one plac
2.
Well-designed databases store data in more than one place.
T
T
F F
3. The row seeele ector is located at theeeee bottom of the ttttat ble.
3.
The row selector is located at the bottom of the table.
T
T
F F
4. The Table Analyzer does not remove the origiinaaala table.
4.
TheTable Analyzer does not remove the original table.
T
T
F F
5.
555. TheTable Annalyz r gives you the choice of wwwhheh ther to crea
TheTable Analyzer gives you the choice of whether to create a query.
T
T
F F
6. TTTThe Table Anaaaalylylylylyzez r dodododododoes not add new fieldlldldlddss.
6.
TheTable Analyzer does not add new fields.
T
T
F F
7. Aveeeerarararaagegegegee is an example of an aggregagagagaaatetete function.
7.
Average is an example of an aggregate function.
T
T
F F
8. The Totals rorow is inserted ababbbovovee the asterisk row.
8.
TheTotals row is inserted above the asterisk row.
T
T
F F
9.
9. Certain functions only work with certain data types.
Certain functions only work with certain data types.

an aggregate function that counts the records in a column

T F

10. You cannot delete aTotals row, but you can hide it.

Competency Assessment
Competency Assessment

Project 9-1: Summarize the Sales Table

The Sales table you created at Lucerne Publishing seems incomplete. Add a Totals row to summarize the data.

USE Lucerne Publishing XXX that you saved in a previous exercise.

1. Open the Sales table.

2. On the Home tab, in the Records group, click the Totals button.TheTotals row appears.

3. Click the down arrow in theTotals row of the Gross Sales column. Select Sum from the menu.

Copyright © 2012 John Wiley & Sons

Advanced Tables 237
Advanced Tables
237

4. Click the down arrow in theTotals row of the Cost of Goods column. Select Sum from the menu.

5. Click the down arrow in theTotals row of the Net Sales column. Select Sum from the menu.

6. Save and close the table.

CLOSE the database.

Project 9-2: Analyze the Fourth Coffee Customers Table

In your part-time job as an office assistant at Fourth Coffee, you have been taking on most of the database responsibilities. As you learn more and more about Access, you decide to use the Table Ana- lyzer to check a table you created previously to make sure it is efficient.

GET READY. LAUNCH Access if it is not already running.

GET READY. LAUNCH Access if it is not already running. The Fourth Coffee Inventory file for

The Fourth Coffee Inventory file for this

lesson is available on the the

book companion website bsite or in WileyPLUS.

1. OPEN Fourth Coffee Inventory from the data files for this lesson.

2. 2. SAVE the database as Fourth Coffee Inventory XXX (where X 3. 3. Open
2. 2.
SAVE the database as Fourth Coffee Inventory XXX (where X
3. 3.
Open the Customers table.
Open the Customers table.
4. 4.
O n the D atatatatat abababababaa asasasasas ee To ol s ta b, i n th e Annnn alaalalala yzyzyzyzyzze group, click the A na l
A AnalyzeTable nal yzyzyzyzeee TTTa bl e Wizard W izard dialog dialog b box ox appears. appear s.
5. 5.
Cliliickckckk Next > too display the nenext Analyze Table WWWWWizard dialog bo
6. 6.
CCCCllick Next > to display theee next AnalyzeTable Wizizii aaraa d dialog bo
7777. The Customers table should be selected. Click Nextxttt.
7.
The Customers table should be selected. Click Next.
8 The Yes, let the Wizard decide option button shoululd be selecte
8.
9.
. A message is disspplayeed that ssayayaysssss the wizard does nottt recomm
Clicck Click OKKK. OK.
10. 10.
Click Cancel to close theTable Analyzer Wizard.
Click Cancel to close thththeTablllle Analyzer Wiiiziizarrrrd.
11. 11.
Close ttthe ttaba le.
Close the table.
LEAVE the dddatabbbbbase opeeene
LEAVE the database open for use in the next project.
fffor uses
inn the next project.
sessmeeennt
Project 9-3: Design the Fourth Coffee Sales Table
Projecccttt 9-9 3: Designn ththe FoFoFouuuruu th Coffee Sales TaTaTaTaTaabbble
Sales data forr FouFFouFouFouFourth Coffee has just come in fofofoooorrrr tttthehehehe first quarter. The man
three-digit three-digit number, number, such such as as 656. 656.

Click Next > to display the next AnalyzeTable Wizard dialog box.

Click Next > to display the next AnalyzeTable Wizard dialog box.

SAVE the database as Fourth Coffee Inventory XXX (where XXX is your initials).

On the DatabaseTools tab, in the Analyze group, click the Analyze Table button.The

The Yes, let the Wizard decide option button should be selected. Click Next.

A message is displayed that says the wizard does not recommend dividing the table.

Proficiency Assessment
Proficiency Assessment

Sales data for Fourth Coffee has just come in for the first quarter. The manager asks you to create a

table table that that displays displays ttheee the salsales sales for for each each of of thee the ve five stores stores in in your your division. division. Note: No Each store is known by a

USE the Fourth Coffee Inventory XXX database that you saved in a previous exercise.

1. Create a new table in Design View.

2. Key ID as the first field name and press the Tab key. Set the data type to AutoNumber.

3. Key Month as the second field name and press the Tab key. A message appears stating that the word month is a reserved word. Click OK. Change the field name to Mon and set its data type to Text.

4. Enter the remaining field names and data types, as shown in Figure 9-20. Set the primary key as shown.

Figure 9-20

Monthly Sales by Store in Design view

Set the primary key as shown. Figure 9-20 Monthly Sales by Store in Design view Copyright

Copyright © 2012 John Wiley & Sons

238 Lesson 9
238 Lesson 9

5. Save the table as Monthly Sales by Store.

6. Switch to Datasheet View.

7. Enter the data in the table as shown in Figure 9-21.

Figure 9-21

Monthly Sales by Store table

in Figure 9-21. Figure 9-21 Monthly Sales by Store table 8. 8. Insert a Totals row.
8. 8. Insert a Totals row. Insert aa TTTotals row. 9. 9. Count the Mon
8. 8.
Insert a Totals row.
Insert aa TTTotals row.
9. 9.
Count the Mon field and sum the Sales field.
Countntntnt the Mon field and sum the Sales field.
10. Saavee and close the table.
10. Save and close the table.
CLOSSSE CLOSE theee the databa database. ase.
Project 9-4: Summarize the Wingtip Toys Table
Project 9-4:4::: Suuummarize thhehhehh
Wingtgtiiip Toys Table
As marma keting coordiinnan tor at Wingtiiiip Toysss,s, you are consstantantantatantantly examining sales
GET READY. LAUNCH Access if it is not already running.
GET READY. LAUNCH Acceeese s if it is nnnot alrlrreadyyyy ruunuu ning.
1. 1.
OPOPOPOPEN Wingtip TTToysss Innvvvventory from thththe dad taaaaa files for this leesson.
OPEN Wingtip Toys Inventory from the data files for this lesson.
2. 2.
SSASAAVE the databassse aasa
Wing ip oys Invveneentttot ry XXX (whererere XXX is
3. 3.
Opepepepepepen the Inventory table.
Open the Inventory table.
4. 4.
Inseerererrtttt aTotals row.
Insert aTotals row.
5. 5.
Counttt theh
Descriptioon fieeelld, sum the In Stock field,, aaand sum the Pr
6. 6.
Save andd clcllose the tablblble.
Save and close the table.
LEAVE LEAVE the the database databasasasasasasaseeee oopooopen open for for use use in in the the nextxxt next pppppprorororororoject. project.

As marketing coordinator at Wingtip Toys, you are constantly examining sales data and trying to think

of of wayays ways to to increassssse increase saaales. sales. Total Total thhhe the inventorrrrry inventory table table to to get ggget a a clear clear picture picture of of the the current inventory.

picture pic tur e of of the the current inventory. The Wingtip Toys Inventory file for

The Wingtip Toys Inventory file for this lesson is available on the book companion website or in WileyPLUS.

SAVE the database as Wingtip Toys Inventory XXX (where XXX is your initials).

Count the Description field, sum the In Stock field, and sum the Price field.

Mastery Assessment
Mastery Assessment

Project 9-5: Design the Wingtip Toys Yearly Sales Table

The owner of Wingtip Toys has given you yearly sales data for each of the company’s sales channels. Create a table in which to store and total the data.

USE the Wingtip Toys Inventory XXX that you saved in a previous exercise.

Figure 9-22

Yearly Sales table in Design View

1. Create a new table in Design View.

2. Create the table as shown in Figure 9-22.

Create a new table in Design View. 2. Create the table as shown in Figure 9-22.

Copyright © 2012 John Wiley & Sons

Advanced Tables 239
Advanced Tables
239

3.

Save the table as Yearly Sales and switch to Datasheet View and review the table you just created.

4.

Switch back to Design View.

5.

Insert a blank row above the Catalog field.

6.

Key Yr as a new field with theText data type.

7.

Select the Yr field and click the Primary Key button to designate the Yr field as the new primary key.

8.

Delete the ID field.

9.

Save the table and switch to Datasheet View.

10.

Enter data in the table as shown in Figure 9-23.

Figure 9-23

Yearly Sales table

as shown in Figure 9-23. Figure 9-23 Yearly Sales table 11. 11. Savvveee the table Save
11. 11. Savvveee the table Save the table. 12. 12. Innssert a Totalsllsls row. Insert
11. 11.
Savvveee the table
Save the table.
12. 12.
Innssert a Totalsllsls row.
Insert a Totals row.
133 SSum the Catalog, Internet, Stores, and Other coluuumns.
13.
Sum the Catalog, Internet, Stores, and Other columns.
11114.4.4 Save and close the tabl .
14.
Save and close the table.
CLCCLCLOSE CLOSE the the databasee.e database.
Project 9-6: Analyze the Alpine Reservations Table
Project 9-99 6: Analyze theeee Alpiininini e Reservatiooooonss Table
As administrrrrativeeee assistant fffor Alpine Ski House,,, youu have noticed that on
again. You
decidded
too run tttht eeeee Table Analnalnalnalyzer tto seee iifi the table needs to be s
GET READY. LAUNCH Access if it is not already running.
GGET READY. LAUNCH Access if it is nnnnnot alreaee dy running.
er-
1.
1. OPEN Alpine RRRReservations from the ddad ta files for tthihihihis lesson.
OPEN Alpine Reservations from the data files for this lesson.
22. SAVE the database as Alpine Reservations XXX (whwhww ere XXX i
2.
3. 3.
SeSeSeSeSeelect the Reservatioons table in the Navigation pppaana e.
Select the Reservations table in the Navigation pane.
4. 4.
Runnn tht e Table Annalyzyzzerr, lettttttt ing the wizard decccccidididididide how to split t
5. 5.
6. 6.
Select the IDIDD field in the Reservatioooonn DeD tails table and designa
7. 7.
Create the query and finish the wizard.
Create the query and finish the wizard.

8.

Save and close the database.

As administrative assistant for Alpine Ski House, you have noticed that one of the tables you use on

a a regular regular basis basisss seems seeeems large largegeee annnnnd and cumbm cumbersome erssssome annndd and yyyou you have have to to enter enter some some of the same data again and

again. You decide to run the Table Analyzer to see if the table needs to be split.

SAVE the database as Alpine Reservations XXX (where XXX is your initials).

Run theTable Analyzer, letting the wizard decide how to split the table.

RenammememeeTTTable1 RenameTable1 to to Reservation Reservation Details Details andndndndd and renameTable2 rrrenameTable2 to to R Room Details.

Select the ID field in the Reservation Details table and designate it as the primary key.

Details table and designate it as the primary key. The Alpine Reser- vations file for this

The Alpine Reser-

vations file for this lesson sson

is available on the book ok

companion website or r in in WileyPLUS.

CLOSE Access.

ok companion website or r in in WileyPLUS. CLOSE Access. I NTERNET R EADY Readers, writers,
I NTERNET R EADY Readers, writers, and publishers around the world closely watch the New

INTERNET READY

Readers, writers, and publishers around the world closely watch the New York Times best-sellers list. Cat- egories of best sellers include fiction, nonfiction, advice, and children’s books. Search the www.nytimes.com website for

the New York Times best-sellers list of your choice. Create a new table in Design View that includes information about the top five best sellers in your favorite category. Include rel- evant fields such as the title, author, description, and price.

Copyright © 2012 John Wiley & Sons