29
Microsoft Access 2003 Microsoft Access 2003 Illustrated Introductory Illustrated Introductory Using Tables and Using Tables and Queries Queries

Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

Embed Size (px)

Citation preview

Page 1: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

Microsoft Access 2003 Microsoft Access 2003 Illustrated IntroductoryIllustrated Introductory

Using Tables and Using Tables and QueriesQueries

Page 2: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

2Using Tables and Queries

Organize fieldsOrganize fields Plan related tablesPlan related tables Create a tableCreate a table Modify a tableModify a table Format a datasheetFormat a datasheet

ObjectivesObjectives

Page 3: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

3Using Tables and Queries

ObjectivesObjectives

Understand sorting, filtering, and Understand sorting, filtering, and findingfinding

Sort records and find dataSort records and find data Filter recordsFilter records Create a queryCreate a query Modify a queryModify a query

Page 4: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

4Using Tables and Queries

Organizing FieldsOrganizing Fields

Design the reports that you want the Design the reports that you want the database to producedatabase to produce

Collect the raw data that is required Collect the raw data that is required to produce the reportsto produce the reports

Identify a name and data type for Identify a name and data type for each fieldeach field

Page 5: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

5Using Tables and Queries

Creating FieldsCreating Fields

Select a short but descriptive field Select a short but descriptive field namename

Select the appropriate data typeSelect the appropriate data type Add field descriptions and properties Add field descriptions and properties

as neededas needed

Page 6: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

6Using Tables and Queries

Choosing the right Data TypeChoosing the right Data Type

Data Type: sample fieldsData Type: sample fields

TextText: FirstName, Zip, Phone: FirstName, Zip, Phone MemoMemo: Comment, Note: Comment, Note NumberNumber: Quantity, Units: Quantity, Units Date/TimeDate/Time: BirthDate : BirthDate

Page 7: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

7Using Tables and Queries

Choosing the right Data TypeChoosing the right Data Type

Data Type: sample fieldsData Type: sample fields

CurrencyCurrency: Price, Tax: Price, Tax AutoNumberAutoNumber: CustomerID: CustomerID Yes/NoYes/No: Veteran, Exempt: Veteran, Exempt OLE ObjectOLE Object: Photo, Resume: Photo, Resume HyperlinkHyperlink: HomePage, Email: HomePage, Email

Page 8: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

8Using Tables and Queries

Choosing between the Text Choosing between the Text and Number Data Typeand Number Data Type

Choose Text for Telephone, Choose Text for Telephone, ZipCode, etc. fields that contain ZipCode, etc. fields that contain numbers but do not represent numbers but do not represent numerical valuesnumerical values

Text preserves leading zeros such as Text preserves leading zeros such as a 01234 zip codea 01234 zip code

Text allows you to use the Input Text allows you to use the Input Mask property to control data entryMask property to control data entry

Page 9: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

9Using Tables and Queries

Planning Related Tables Planning Related Tables

Separate the fields into specific Separate the fields into specific subject areassubject areas

Create sample records and examine Create sample records and examine the entriesthe entries

Identify a primary key field for each Identify a primary key field for each tabletable

Identify a common field to link tables Identify a common field to link tables in a one-to-many relationshipin a one-to-many relationship

Page 10: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

10Using Tables and Queries

One-to-Many Relationship One-to-Many Relationship

1

many

Page 11: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

11Using Tables and Queries

Planning Related Tables Planning Related Tables

The field on the “one” side of the The field on the “one” side of the relationship is usually the relationship is usually the primary primary keykey field for that table field for that table

The field on the “many” side of the The field on the “many” side of the relationship is called the relationship is called the foreign keyforeign key field for that tablefield for that table

Page 12: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

12Using Tables and Queries

Creating a TableCreating a Table

Methods:Methods:

Database WizardDatabase Wizard Table WizardTable Wizard Table Design ViewTable Design View Importing dataImporting data

Page 13: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

13Using Tables and Queries

Modifying a TableModifying a Table

Required Entries for a new field:Required Entries for a new field: Field NameField Name Data TypeData Type

Optional Entries for a new field:Optional Entries for a new field: DescriptionDescription Property ChangesProperty Changes

Page 14: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

14Using Tables and Queries

Modifying a TableModifying a Table

Field Names Data Types

Properties

Page 15: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

15Using Tables and Queries

Formatting a DatasheetFormatting a Datasheet

Formatting (Datasheet) Toolbar

Font

FontSize

Bold

Italic

Font/ForeColor

Line/BorderColor

Grid-lines

SpecialEffects

Underline Fill/BackColor

Page 16: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

16Using Tables and Queries

Understanding Sorting,Understanding Sorting,Filtering, and FindingFiltering, and Finding

SortingSorting: : reorganizingreorganizing records in an records in an ascending or descending order based ascending or descending order based on a fieldon a field

FilteringFiltering: : isolatingisolating a subset of a subset of recordsrecords

FindingFinding: : locatinglocating a specific piece of a specific piece of datadata

Page 17: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

17Using Tables and Queries

Sorting, Filtering, and FindingSorting, Filtering, and Finding

Table Datasheet Toolbar

SortAscending

SortDescending

Filter BySelection

Filter ByForm

Add orRemoveFilter

Find

Page 18: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

18Using Tables and Queries

Find and Replace OptionsFind and Replace Options

Find WhatFind What Look InLook In MatchMatch SearchSearch Match CaseMatch Case

Page 19: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

19Using Tables and Queries

WildcardsWildcards

Asterisk (*) = any group of charactersAsterisk (*) = any group of characters Question mark (?) = any single Question mark (?) = any single

charactercharacter Pound sign (#) = any single number Pound sign (#) = any single number

digitdigit

Page 20: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

20Using Tables and Queries

Sorting RecordsSorting Records

Primary sort field Primary sort field Secondary sort fieldSecondary sort field Telephone book exampleTelephone book example

– LastName = Primary sort fieldLastName = Primary sort field– FirstName = Secondary sort fieldFirstName = Secondary sort field– Middle Initial = Third sort fieldMiddle Initial = Third sort field

Page 21: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

21Using Tables and Queries

Finding DataFinding Data

Search Criterion

SearchOptions

Find and Replace dialog box

Page 22: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

22Using Tables and Queries

Filtering DataFiltering Data

Apply Filter buttonClear Filter button

Wildcard asterisk character is used

Greater than or equal to operator is used

Filter by Form window

Page 23: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

23Using Tables and Queries

Comparison OperatorsComparison Operators

Page 24: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

24Using Tables and Queries

Searching for Blank fieldsSearching for Blank fields

Is NullIs Null criteria will find all records criteria will find all records where no entry has been made in the where no entry has been made in the fieldfield

Is Not NullIs Not Null criteria will find all criteria will find all records where there is any entry in records where there is any entry in the field, even if the entry is 0the field, even if the entry is 0

Primary key fields cannot have a null Primary key fields cannot have a null entryentry

Page 25: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

25Using Tables and Queries

Creating a QueryCreating a Query

Methods:Methods:

Simple Query WizardSimple Query Wizard Query Design ViewQuery Design View

MethodsMethods

Page 26: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

26Using Tables and Queries

Query Design ViewQuery Design View

Field Lists

Query grid identifies fieldsin query

Criteria to limit records

Page 27: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

27Using Tables and Queries

Queries versus FiltersQueries versus Filters

Page 28: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

28Using Tables and Queries

Modifying a QueryModifying a Query

Change sort ordersChange sort orders Add Add AND criteriaAND criteria (two criterion on (two criterion on

the same row)the same row) Add Add OR criteriaOR criteria (two criterion on (two criterion on

different rows)different rows) Add or remove fields from the query Add or remove fields from the query

gridgrid

Page 29: Microsoft Access 2003 Illustrated Introductory Using Tables and Queries

29Using Tables and Queries

SummarySummary

Build tables to store dataBuild tables to store data Use Table Design View to define the Use Table Design View to define the

fields of your tablesfields of your tables Use table and query datasheets to Use table and query datasheets to

view, sort, filter, and find dataview, sort, filter, and find data Create queries to answer “questions” Create queries to answer “questions”

about your dataabout your data