Anda di halaman 1dari 31

Microsoft Access Recap

Tables

• Store the data in a database – similar to a


spreadsheet, but more organized.
Contains records (rows) and fields
(columns).
Example of a Table

Fields

Records
Name GatorLink Phone College
Smith rsmith 392-3900 Pharmacy
Thomas bthomas 392-5555 Medicine
Van Winkle sleepyguy 846-5656 PHHP

Can be referred to as rows and columns


as in Excel
3
Introducing Queries
• A means of asking questions (querying) of your data
• Can look across a number of Tables and other Queries
• Can perform Calculations and Combine fields
Design view

Datasheet view

4
Introducing Forms
• A friendlier view of the database
• Used for data input, menus, display and printing
• Can perform Calculations and Combine fields

5
Introducing Reports
• Output of information in a printed report
• Allows you to group and summarize data
• Can perform Calculations and Combine fields
• Cannot Edit Data
• Can Make Labels

6
Working Together
Tables Queries

Employees
Customers

Reports

Forms
Customer

Company Name
Address
City
Telephone
Contact Name

7
Relational Databases

The real power of Access is


derived from multiple tables
and the relationships between
those tables.
Home Ribbon

• Views
• Clipboard
• Sort & Filter
• Records
• Find
Create Ribbon

• Create
– Tables
– Queries
– Forms
– Reports

11
Which to use?

• Creating a new table Table design


• Queries Query Design
• Form connected to a table Form Wizard
• Main Menu Form Form Design
• Report Report Wizard
External Data Ribbon

• Allows you to enter data from


– Excel
– Other Databases
– Text file

13
DataBase Tools Ribbon

• Set up relationships
• Repair databases

14
Terminology
Phone book: Fields (columns)
Anderson Thomas A 123 Marine View Dr. 237-1234
Records Benson Karen C 1300 California Ave 237-1098
(rows) Casserly Rick W 12492 Rd 19 342-0502
Drummond Lynn M 12059 30th Ave W 931-1105
Table

Field  Smallest unit of information in a table  First name


(the columns in a table)  Also called “attributes”  Last name
 Middle initial
 Street address
 Phone number(s)
Record  All related fields are collectively called  All fields for one person
(the rows in a table) a record or tuple. are a record
Table  A collection of records is a data table  Collection of everyone’s
records

15
Keys: Primary Key
• Primary Key
– The primary key of a relational table uniquely
identifies each record in the table.
– Primary keys may consist of a single attribute or
multiple attributes in combination
• Example:
– StudentID in table STUDENT which has collection of the
data for each student.
– CourseID in table COURSES.

16
Database Schema
• Way to define a table
– Collection of table
definitions that gives
the name of the table,
lists the attributes and
their data types, and
identifies the primary
key

17
Database Management System (DBMS)
• A DBMS is a suite of software applications that together
make it possible to store, modify, and extract information
from a database.

• Examples of DBMS:
– Access
– Oracle

18
Data Types

19
Data Types
Attachment Files, such as digital photos. Multiple files
can be attached per record.
AutoNumber Numbers that are automatically generated
for each record.
Currency Monetary values.
Date/Time Dates and times.
Hyperlink Hyperlinks, such as e-mail addresses and
websites.
Number Byte, Integer, Long Integer, Single, Double
Short Text Short, alphanumeric values, such as a last
name or a street address (max 255 chars).
Long Text Long text alphanumeric values, such as a
paragraph of text.
Yes/No Boolean values.

20
Work with Properties

Field Size
property
Caption
property

• Field Properties can be used to specify


characteristics for individual fields
• Located in the lower pane of Table Design
View 21
Class Exercise: select a data type

22
Table Design Considerations – Field Size
Property

Set field size in the Field Properties


grid of Table Design View

• Access treats all text as variable length


• So leaving it as 255 does not waste space.

23
Table Design Considerations – Input Mask

Input Mask: controls the data entered

• Use an Input Mask to control data entry in an


Access database.
• For example, you can force users to enters a
phone number with an area code
24
25
Input Mask Examples
• (000)-000-0000 will force the user to enter a
phone number with an area code.
• (999)000-0000! will force to user to enter a 7
digit phone number but is optional for the
area code. The exclamation mark causes the
input mask read the numbers from left to
right.
• LL-000 will force the user to enter 2 letters
followed by 3 numbers.
• >L<??????????????? will make the first letter 26
Class Exercise: write input masks
for

27
Customize input masks from the
Input Mask Wizard
1. Open the object in Design
View, and click the field where
you want to add the custom
input mask.
2. Click the Build to start the
Input Mask Wizard.
3. Click Edit List. ...
4. Move to a new record in the
dialog and enter a new
description in the Description
text box.
28
Table Design Considerations – Validation
Rules

Set validation rules in the Field Properties


grid of Table Design View

• Used to avoid data entry errors by restricting what can be


entered
• Validation text can be used to provide an explanation of
the type of data that is allowed in a field

29
Validation

30
The End

Anda mungkin juga menyukai