Beruflich Dokumente
Kultur Dokumente
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lesson Objectives
• Identify the purpose and nature • Create tables in Table Design
of tables view
• Plan tables for a database • Modify field properties and
• Plan table fields field descriptions
• Understand naming conventions • Define primary keys
• Draw a model of a table • Modify table structure
• Understand data types • Insert, delete and rename
• Understand how the Field Size fields
property affects storage • Create tables in Datasheet view
requirements
Lecture 03
Microsoft Office
Access 2013
Lesson Objectives
• Use Quick Start fields
• Enter records in Datasheet view
• Modify the layout of a datasheet
• Create relationships
• Create lookup fields
• Add records to related tables using sub-datasheets
Lecture 03
Microsoft Office
Access 2013
Table Basics
• A table is a collection
of data about a
specific topic
• The data is organized
into rows and
columns
• Each column is a field
and each row is a
record
Lecture 03
Microsoft Office
Access 2013
Planning Tables
• A well-planned database • Remember that a table
ensures that data is should store data about
complete, unique and one thing, and only one
accurate thing
• Be sure to have a clear
picture of how the
database will be used
• Begin by listing the data
you want to capture
– The subject matter
categories that are
generated in your list will
become the tables
Lecture 03
Microsoft Office
Access 2013
Planning Fields
• Use the smallest fields that
make sense – this allows
you great flexibility for
sorting and searching the
data
• Remember that it is easier
to build in flexibility during
the design stage than it is to
redesign tables after records
have been added or queries
and reports have been
created based on table data
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Data Types
• The properties of a field describe the characteristics and
behavior of the data entered into that field
• A field’s data type determines the type of data the field
can store
• A field can contain only type of data
• You set the data type for a field in Table Design view
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Table Views
• Datasheet view – used primarily for working with table
data (although you can create tables in Datasheet view).
This is the “open” view for a table
• Design view – used to create, view or edit a table’s
structure. You cannot see the data in Design view.
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Primary Keys
• A primary key is a field (or combination of fields) that
uniquely identifies each record stored in a table
• No two records in a table may be exact duplicates – two
records may, however, contain duplicate data other than
the primary key
• Primary key must be unique
• Primary key cannot contain a null value
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Manipulating a Datasheet
• Size and Position Datasheet Columns
– Hide or Unhide Columns
– Resize Fields
– Rearrange Fields
– Freeze and Unfreeze Fields
• Customize the Appearance of Datasheet Data
– Add table descriptions
– Change field captions
– Insert total rows
– Change data formats
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Lecture 03
Microsoft Office
Access 2013
Constraining Input
Default Values
• Specify a default value for a field to speed data entry
• Type the default value in the Default Value row of the
General tab in the Field Properties pane in Table Design
view
Auto-incrementing Fields
• To set a field to auto-increment, set the data type to
AutoNumber
• There can be only one AutoNumber field in a table
Lecture 03
Microsoft Office
Access 2013
Table Relationships
• A column in a table
that references the
primary key of
another table is
called a foreign key
• Foreign keys and
primary keys
represent data
relationships
Lecture 03
Microsoft Office
Access 2013
Table Relationships
• A relationship is made by matching data in key fields
between two tables
• When creating relationships, remember:
– Related fields may or may not have the same name but
must have the same data type
– When related fields are Number fields, they must have the
same Field Size property setting
– To define a relationship using an AutoNumber primary key
field, the foreign key must be a Number field with a Field
Size property setting of Long Integer
Lecture 03
Microsoft Office
Access 2013
Relationship Types
One-to-one A relationship in which each record in Table A can have only
one matching record in Table B, and vice versa.
One-to-many A relationship in which a record in Table A can have many
Parent-child matching records in Table B, but a record in Table B has
only one matching record in Table A. The relationship is
established only if the common field is the primary key in
Table A and the foreign key in Table B.
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lecture 03
Microsoft Office
Access 2013
Lesson Summary
• Create tables in Table Design • Identify the purpose and
view nature of tables
• Modify field properties and • Plan tables for a database
field descriptions • Plan table fields
• Define primary keys • Understand naming
• Modify table structure conventions
• Insert, delete and rename • Draw a model of a table
fields • Understand data types
• Create tables in Datasheet view • Understand how the Field Size
property affects storage
requirements
Lecture 03
Microsoft Office
Access 2013
Lesson Summary
• Modify the layout of a datasheet
• Create relationships
• Create lookup fields
• Add records to related tables using sub-datasheets
• Use Quick Start fields
• Enter records in Datasheet view
Lecture 03
Microsoft Office
Access 2013
Review Questions
1. For a relationship between fields in two tables to be created, the
fields must:
a. have the same data type.
b. have the same name.
c. be stored in separate databases.
d. be defined as lookup fields.
2. Which of the following is the smallest Field Size setting that will
allow a number field to store the value 1,452,137.5?
a. Integer
b. Long Integer
c. Single
d. Double
Lecture 03
Microsoft Office
Access 2013
Review Questions
3. What is the default Field Size setting for a Short Text field in
Access?
a. 12
b. Single
c. Double
d. 255
4. A primary key:
a. should use social security numbers whenever possible
b. cannot be a composite key.
c. should be null whenever possible.
d. should be a value that will never change.
Lecture 03
Microsoft Office
Access 2013
Lecture 03