Student Guide M2
Student Guide M2
40572A
Microsoft Access expert 2019
Module 2: Designing and setting up data structure
Designing and setting up data structure
Contents
Contents........................................2
Module overview...........................4
Description.................................4
Scenario.....................................5
Cornerstone................................5
Lesson 1: Starting the database design 6
Overview....................................6
Warm-up.....................................6
Topic 1: Organize related data...7
The design process.................7
Dividing the information into tables 7
Turning information items into columns 8
Activity: Think-pair-share........9
Try-it: Organize related data...9
Topic 2: Overview of data types10
Activity: Pose a challenge.....12
Try-it: Overview of data types12
Topic 3: Create primary keys. . .13
Specifying primary keys........13
Setting a primary key............13
Remove the primary key.......14
Activity: Discuss and learn....15
Try-it: Create primary keys. . .15
Wrap-up....................................16
Lesson 2: Starting an Access database 17
Overview..................................17
Warm-up...................................17
Topic 1: Create an Access file. .18
Create a database by using a template 18
Create a blank database.......18
2
Designing and setting up data structure
3
Designing and setting up data structure
Cornerstone.................................46
Overview..................................46
Objectives.................................46
Duration...................................47
Instructions...............................47
Tasks........................................47
4
Designing and setting up data structure
Module overview
Description
Now that you’ve had a chance to review an existing database and explore
the Microsoft Access 2019 interface, it's time to begin planning and creating
your own database. This module introduces you to organizing related data
into databases. You’ll become familiar with database tables, lists, and data
types. You’ll also learn about primary keys and their purpose. Finally, you'll
learn about creating Access files and tables, using AutoNumber, setting the
primary key, and creating table fields. You'll have plenty of opportunities to
apply these concepts.
You'll begin by learning how to organize related data into tables, and then
define and describe a primary key. Next, you'll create an Access database
file with multiple tables, utilize AutoNumber, and set the primary key.
Finally, you'll create text, numeric, Date/Time, and Yes/No fields in a table,
and set various field properties.
The following table outlines the lesson objectives and their corresponding
Microsoft Office Specialist (MOS) exam objectives.
5
Designing and setting up data structure
Scenario
Your visit with the Harvesting team at Munson’s Pickles and Preserves Farm
was very worthwhile. They demonstrated how they use their database and
described the thinking process that they used to decide which data to store
and how to label that data to maximize its usefulness in their decisions. It’s
now time to sit down with your Community Supported Agriculture (CSA)
program team to figure out what data you need to store and to think about
how you want to use the data. The answers to those two questions will
dictate your next steps—creating tables and fields to store the data.
Cornerstone
At the end of this module, you’ll work on a Cornerstone project, in which
you’ll design and create a database file. You’ll organize related data into the
basis for tables, use AutoNumber and set the primary key, create table
fields, and also compact and repair the database.
6
Designing and setting up data structure
Warm-up
Use these questions to find out what you already know about this lesson’s
topics:
1. What is the storage structure for data in an Access database?
Select the correct option.
a. Forms
b. Queries
c. Reports
d. Tables
2. Which of the following are data types in Access?
Select all that apply.
a. Yes/No
b. Table
c. Large Number
d. OLE Object
3. Select here to enter text. are columns that uniquely identify each row
stored in the table.
Fill in the blank space.
7
Designing and setting up data structure
8
Designing and setting up data structure
Products
o Product name
o Price
o Units in stock
Orders
o Order number
o Order date
o Product
The major entities included here are the customers, the suppliers, the
products, and the orders. Therefore, it makes sense to start with these four
tables: one for facts about products, one for facts about suppliers, one for
facts about customers, and one for facts about orders. Although this doesn’t
complete the list, it's a good starting point. You can continue to refine this
list until you have a design that works well.
Additional information
For more information about database design, refer to:
Database design basics
9
Designing and setting up data structure
Caution
This course uses database files that follow a general storyline
for the CSA program at Munson’s Pickles and Preserves
Farm. These database files are the Learning Activity
Resource files that you’ll use to work on each module’s
activities and try-its. Each Learning Activity Resource file
contains the data and objects, such as tables, queries, forms,
and reports, that you need to complete a corresponding
activity.
Due to this course’s modular nature, the objects and data in
these files might vary across activities or try-its. Therefore,
it’s important that you start your activities or try-its only with
the designated files, as per applicable instructions. You also
should note that screenshots in the topic content are for
illustration purposes only and might appear different than
those that are in the Learning Activity Resource files.
Activity: Think-pair-share
In this activity, you'll sort related information into appropriate tables.
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Pair with a classmate.
2. Review the field names that your teacher provided.
3. Review the table names and descriptions that your teacher provided.
4. Discuss your grouping and sorting options with your partner.
5. Place the fields in the appropriate table.
6. Ask clarification questions.
Resources
You'll need the following resource for this activity:
10
Designing and setting up data structure
None
Instructions
1. Review the module scenario.
2. Think about at least two tables that you would use to group information
collected for use in the database.
3. List at least five fields to include for each table.
4. Share your ideas.
5. Ask clarification questions.
11
Designing and setting up data structure
12
Designing and setting up data structure
Additional information
For more information on data types, refer to: Data types for
Access desktop databases
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Review the field name that your teacher provided in Topic 1.
2. Determine the correct data type for each field.
3. Discuss your choice options.
4. Ask clarification questions.
Resources
You'll need the following resource for this try-it:
Your list from Topic 1 of fields to include in the Munson’s Pickles and
Preserves Farm CSA database.
Instructions
You'll perform the following general tasks during this try-it:
1. Review the list of tables and fields that you created in Topic 1 for
information to collect for the Munson’s Pickles and Preserves Farm CSA
database.
2. Review the type of data types available in Access.
3. Identify which type of data type you’ll collect for each field.
4. Discuss the options for your choice.
5. Ask clarification questions.
13
Designing and setting up data structure
14
Designing and setting up data structure
3. In the table design grid, select the field or fields to use as the primary
key.
o To select one field, select the row selector for the field that you want,
as depicted in the following screenshot.
o To select more than one field, use CTRL, and then select the row
selector for each field.
4. On the Design tab, in the Tools group, select Primary Key.
A key indicator is found to the left of the field or fields that you specify as the
primary key.
15
Designing and setting up data structure
Additional information
For more information on primary keys, refer to: Specifying
primary keys, Setting a primary key, and Add or change a
table’s primary key in Access
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Participate in the discussion by providing examples of unique identifiers
for a specific database.
2. Ask clarification questions.
Resources
Your list from Topic 1 and Topic 2 of fields to include in the Munson’s
Pickles and Preserves Farm CSA database.
Instructions
You'll perform the following general tasks during this try-it:
1. Review the list of tables and fields that you created for your Munson’s
Pickles and Preserves Farm CSA database tables.
2. Think about the information that would be included in each field column
and identify any issues with using that field column as the primary key.
Wrap-up
Use these questions to check what you learned in this lesson:
1. What is the first step in the design process?
16
Designing and setting up data structure
17
Designing and setting up data structure
Warm-up
Use these questions to find out what you already know about this lesson’s
topics:
1. What happens when you attempt to create a database but do not supply
a file name?
Select the correct option.
a. Access does not create the database.
b. Access creates a temporary, unnamed database.
c. Access creates a database in the default location, with the name
Database followed by a sequential number.
d. Access creates a database in the default location, with the name
MyDatabase followed by a sequential number.
2. In Access, a template is which of the following?
Select the correct option.
a. A database to manage contacts
b. Where a database is stored
c. Two tables linked together
d. A ready-to-use database
18
Designing and setting up data structure
3. When you create a new blank database, Access opens a database that
contains which of the following?
Select the correct option.
a. One of each type of database object
b. A table
c. Sample data
d. A template
19
Designing and setting up data structure
new column to the datasheet in the table. Access automatically sets each
field's data type, based on the data that you enter.
Additional information
For more information about creating databases, refer to:
Create a new database
20
Designing and setting up data structure
Additional information
For more information about compacting and repairing a
database, refer to: Compact and repair a database
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Open Access and follow along as your teacher demonstrates how to
create a database by using a template.
2. Discuss the included template options and the tables and fields in the
template that you choose.
3. Participate in the discussion about when you would choose a template
and when you would choose a blank database.
4. Follow along as your teacher demonstrates the Compact and Repair
database command.
5. Ask clarification questions.
21
Designing and setting up data structure
Resources
None
Instructions
You'll perform the following general tasks during this try-it:
1. Create a new blank database for the Munson’s Pickles and Preserves Farm
CSA program and name the database CSA.
2. Set the database to automatically compact when it closes.
Add a table
You can add new tables to an existing database by using the commands on
the Create tab in the Tables group.
22
Designing and setting up data structure
Additional information
For more information about adding tables, refer to: Creating a
table
23
Designing and setting up data structure
If Access assigns generic field names, you should rename the fields as soon
as possible to avoid confusion. Use the following procedure:
1. On the Home tab, in the Records group, select Save to save the table.
2. On the Home tab, in the View group, select Datasheet View, select
each column heading, and then enter a descriptive field name for each
column.
3. Save the table again.
You can also rename the fields by switching to Design View and editing the
field names there. To switch to Design View, on the Home tab, in the View
group, select Design View.
Additional information
For more information, refer to: Copy data from another
source into an Access table
24
Designing and setting up data structure
For example, if you're importing data from an Excel worksheet, select Excel.
If you don't find the application type that you need, select More.
2. In the Get External Data dialog box, select Browse to find the source
data file, or type the full path of the source data file in the File name box.
3. Select the option that you want. Note that all programs let you import,
and some let you append or link.
4. In the Specify section, choose how and where you want to store the data
in the current database. You can create a new table that uses the
imported data or, with some programs, you can append the data to an
existing table or create a linked table that maintains a link to the data in
the source program.
o If a wizard starts, follow the instructions on the wizard, and on the last
page of the wizard, select Finish.
o If you import objects or link tables from an Access database, either the
Import Objects or Link Tables dialog box is revealed. Choose the
items that you want and then select, OK.
The exact process that you use depends on whether you choose to
import, append, or link data.
25
Designing and setting up data structure
5. Access prompts you about whether you want to save the details of the
import operation that you just completed. If you think that you’ll perform
this same import operation again in the future, select Save import
steps, and then enter the details. You can then easily repeat the
operation in the future by selecting Saved Imports on the External
Data tab in the Import & Link group; if you don't want to save the
details of the operation, select Close.
o If you chose to import a table, Access imports the data into a new table
and then displays the table under the Tables group in the Navigation
Pane.
o If you chose to append data to an existing table, Access adds the data
to that table.
o If you chose to link to data, Access creates a linked table under the
Tables group in the Navigation Pane.
Additional information
For more information, refer to: Import, append, or link to data
from another source
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Follow along as your teacher demonstrates how to create a new blank
table, create a linked table, and import data from an external data source.
2. Participate in the discussion about when you could use the various
options when creating a table.
3. Ask clarification questions.
26
Designing and setting up data structure
Resources
Your [Link] from the previous topic or
L2_T2_try_sample_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
The customer_sample.accdb and order_sample.xlsx in this lesson’s
Learning Activity Resources folder.
Instructions
You'll perform the following general tasks during this try-it:
1. Save customer_sample. accdb and order_sample.xlsx from this
lesson’s Learning Activity Resources folder to your class folder.
2. If it isn't open already, open your [Link] from the previous topic or
L2_T2_try_sample_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
3. Import the content from the customer_sample. accdb and name the
table customer sample.
4. Link the content from the order_sample.xlsx and name the table
order_sample.
27
Designing and setting up data structure
Additional information
For more information, refer to: Add an AutoNumber field as a
primary key
Resources required
None
28
Designing and setting up data structure
Activity instructions
Participate in the activity by following these instructions:
1. Think back to the discussion in Lesson 1, Topic 3 about creating unique
identifiers or primary keys, when creating a database table.
2. How could you uniquely identify records when no natural ID exists?
3. Discuss your ideas about creating the primary key.
4. Ask clarification questions.
Resources
Your [Link] from the previous topic or
L2_T3_try_sample_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
Instructions
You'll perform the following general tasks during this try-it:
1. If it's not open already, open your [Link] from the previous topic or
L2_T3_try_sample_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
2. Open the customer sample table and add a column as the primary key,
and set it as AutoNumber with increment values.
3. Open the order_sample table and add a column as the primary key, and
set it as AutoNumber with random values.
29
Designing and setting up data structure
Wrap-up
Use these questions to check what you learned in this lesson:
1. Entering data in Datasheet view is similar to entering data in a(n)
Select here to enter text.
.
Fill in the blank space.
2. The Templates group is located on which of the following tabs?
Select the correct option.
a. Home
b. Create
c. Database Tools
d. Datasheet
3. Before you rename a table or other database object, you should do which
of the following?
Select the correct option.
a. Save it.
b. Close it.
c. Edit it.
d. Open it.
30
Designing and setting up data structure
Warm-up
1. Which of the following is not a field property?
Select the correct option.
a. Column Template
b. Field Size
c. Caption
d. Allow Zero Length
2. Which field property requires users to enter data in a specific format?
Select the correct option.
a. Validation Text
b. Default Value
c. Required
d. Input Mask
3. Short Text fields can have up to how many characters?
Select the correct option.
a. 50
b. 100
c. 155
d. 255
31
Designing and setting up data structure
Adding fields
Every field has certain essential characteristics, such as a name that
uniquely identifies the field within a table, a data type that defines the data's
nature, the available operations, and the storage space to set aside for each
value.
Before you create fields, try to separate data into its smallest useful parts. It
is much easier to combine data later than it is to separate it. For example,
instead of a Full Name field, consider creating separate fields for Last Name
and First Name. Then, you can easily search or sort by First Name, Last
Name, or both. If you plan to report, sort, search, or calculate on a data item,
put that item in a field by itself.
Additional information
For more information, refer to: Adding fields
32
Designing and setting up data structure
3. Select the field next to the property name. Depending on the property,
you can enter data or select an option from a list.
For information about how to use each field property, select the property
and then Select F1.
33
Designing and setting up data structure
Additional information
For more information, refer to: Create or delete a Short Text
field
3. Select the field next to the property name. Depending on the property,
you can enter data or select an option from a list.
For information about how to use each field property, select the property,
and then select F1.
34
Designing and setting up data structure
Additional information
For more information, refer to: Create or delete a Long Text
field
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Participate in the discussion by sharing fields that should be text, and
then identify it as Short Text or Long Text.
2. Follow along as your teacher demonstrates how to create new fields and
sets the data type and field properties.
Resources
You'll need the following resource for this try-it:
Your [Link] from the previous topic or
L3_T1_try_example_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
35
Designing and setting up data structure
Instructions
You'll perform the following general tasks during this try-it:
1. Refer to your list that you created in Lesson 1 of the tables and fields that
you need for the Munson’s Pickles and Preserves Farm CSA database.
2. Add each table then add each text field needed to the appropriate table
by using the Datasheet view.
3. Set the properties for each field by using the Design View. You should
include a variety of field properties.
36
Designing and setting up data structure
3. Select the field next to the property name. Depending on the property,
you can enter data or select an option from a list.
4. For information about how to use each field property, select the property
and then select F1.
Additional information
For more information, refer to: Create or delete a Number
or Currency field
Resources required
None
37
Designing and setting up data structure
Activity instructions
Participate in the activity by following these instructions:
1. Participate in the discussion by sharing fields that should be numeric, and
then identify how to set the field properties.
2. Follow along as your teacher demonstrates how to create the new fields
and set the data type and field properties.
Resources
You'll need the following resource for this try-it:
Your [Link] from the previous topic or
L3_T2_try_example_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
Instructions
You'll perform the following general tasks during this try-it:
1. Refer to your list that you created in Lesson 1 for the tables and fields
that you need for the Munson’s Pickles and Preserves Farm CSA database.
2. Add each Numeric field needed to the appropriate table by using the
Datasheet view.
3. Set the properties for each field by using the Design View. You should
include a variety of field properties.
38
Designing and setting up data structure
The integer portion of the value, to the left of the decimal point, represents
the date. The fractional portion, to the right of the decimal point, represents
the time.
39
Designing and setting up data structure
3. Select the field next to the property name. Depending on the property,
you can enter data or select an option from a list.
4. For information about how to use each field property, select the property
and then select F1.
Additional information
Learn more from about Date/Time fields through
Microsoft Support. For more information, refer to: Create
or delete a Date/Time field
40
Designing and setting up data structure
Additional information
Learn more from Microsoft Support. For more information,
refer to: Restrict data input by using validation rules
41
Designing and setting up data structure
Resources required
None
Activity instructions
Participate in the activity by following these instructions:
1. Participate in the discussion by sharing fields that should be Date/Time
field and identify validation rules for this field.
2. Follow along as your teacher demonstrates how to create the new fields
and set the data type and field properties.
Resources
You'll need the following resource for this try-it:
Your [Link] from the previous topic or
L3_T3_try_example_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
Instructions
You'll perform the following general tasks during this try-it:
1. Refer to your list that you created in Lesson 1 for the tables and fields
that you need for the Munson’s Pickles and Preserves Farm CSA database.
2. Add each Date/Time field needed to the appropriate table by using the
Datasheet view. If you didn’t initially list a field that will use the
Date/Time data type, review your current tables to identify a table that
requires this information, and then add the field.
3. Set the properties for the field, including a validation rule.
42
Designing and setting up data structure
43
Designing and setting up data structure
3. Select the field next to the property name. Depending on the property,
you can enter data or select an option from a list.
4. For information about how to use each field property, select the property
and then select F1.
Additional information
Learn more about Yes/No fields through Microsoft Support
resources. For more information, refer to: Create or delete a
Yes/No field
Resources required
You'll need the following resource for this activity:
None
Activity instructions
Participate in the activity by following these instructions:
1. Think about how you've added other data type fields in your database,
then predict how you’ll set the field data type as Yes/No.
2. What properties do you think you could set for the Yes/No field?
3. Share your ideas with the class and participate in the discussion.
Resources
You'll need the following resource for this try-it:
Your [Link] from the previous topic or
L3_T4_try_example_csa_starter.accdb in this lesson’s Learning
Activity Resources folder.
Instructions
You'll perform the following general tasks during this try-it:
44
Designing and setting up data structure
1. Refer to your list that you created in Lesson 1 for the tables and fields
that you need for the Munson’s Pickles and Preserves Farm CSA database.
2. Add each Yes/No field needed to the appropriate table by using the
Datasheet view. If you didn’t initially list a field that should use the
Yes/No data type, review your current tables and identify a table that
requires this information, and then add the field.
3. Set the properties for the field.
Wrap-up
Use these questions to check what you learned in this lesson:
1. The Date/Time fields store the dates and times as a system called
Select here to enter text.
Fill in the blank space.
2. To ensure that the information inputted in a field is in the correct format,
Access allows you to create a Select here to enter text.
Fill in the blank space.
3. You should use the Select here to enter text. data type if you would
like to add a Check Box to collect a Boolean value such as True or
False.
Fill in the blank space.
45
Designing and setting up data structure
Glossary
Field A column in a database table.
Validation text The text in the error message that appears when users
violate a validation rule.
46
Designing and setting up data structure
Cornerstone
Overview
This Cornerstone project requires you to plan and create a database. You'll
use the skills that you learned in this module to create an Access file, create
Access tables, use AutoNumber, and set the primary key. You'll also create
table fields, and compact and repair the database.
Objectives
The following table outlines the Cornerstone objectives and their
corresponding Microsoft Office Specialist (MOS) exam objectives.
47
Designing and setting up data structure
Duration
40 minutes
Instructions
1. Complete the tasks for each file.
2. When saving your file, add your name to the end of the filename—for
example, You_pick_day_Dwayne_Espino. Follow your teacher’s
directions for where to save your files.
3. After completing the Cornerstone, assess your completion, and then enter
the points that you think you earned within the task lists in the following
sections. You can ask your teacher for help, if necessary.
Tasks
You'll work with two supporting files in this Cornerstone:
[Link]
[Link]
48
Designing and setting up data structure
49
Designing and setting up data structure
50