Top Banner
Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition
43

Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

Jan 04, 2016

Download

Documents

Esther Dean
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

Database Processing with Microsoft Access

Appendix

DAVID M. KROENKE’S

DATABASE CONCEPTS, 2nd Edition

Page 2: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-2

Chapter Objectives

• Learn how to use Microsoft Access to:– Create tables– Create relationships– Create queries using the query design tool– Create basic forms– Create forms with lookup combo boxes– Create basic reports– Create parameterized reports

Page 3: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-3

Creating the Database Design

• Before you begin using Microsoft Access, you must know what to create

• This entails creating a data model and the corresponding data schema

• The DBMS will not help you in this process

Page 4: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-4

Create the E-R Diagram[No help from the DBMS]

Category

Description

ItemNumber

ITEM

Phone

Address

SuppID

SUPPLIER

Comment

Date

OrdNumber

ORDER

1:N N:M | | 0 0

Page 5: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-5

Database Schema

• A database schema is a design of database tables, relationships, and constraints

• Schemas are developed by analyzing user requirements such as forms, queries, and reports, and then constructing a data model

Page 6: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-6

Create the Schema Design [No help from the DBMS]

SuppID (FK)

Category

Description

ItemNumber

ITEM

Phone

Address

SuppID

SUPPLIER

Comment

Date

OrdNumber

ORDER

1:N

1:N

| 0

0

Quantity

OrdNumber

ItemNumber

ORD_ITEM

0

N:1

|

|

Page 7: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-7

Create the Data Dictionary [no help from the DBMS]

Category

SuppID

Description

ItemNumber

Text(5)

Long Integer

Text(30)

Autonumber

ITEM

Foreign Key refers to SUPPLIER

Not Null

ITEM Table:

Page 8: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-8

Create the Data Dictionary [no help from the DBMS]

MemoComment

Date/TimeDate

Not NullAutonumberOrdNumber

ORDER

ORDER Table:

Page 9: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-9

Create the Data Dictionary [no help from the DBMS]

Text(12)Phone

Text(30)Address

Not NullAutonumberSuppID

SUPPLIER

SUPPLIER Table:

Page 10: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-10

Create the Data Dictionary [no help from the DBMS]

Quantity

OrdNumber

ItemNumber

Long Integer

Long Integer

Long Integer

ORD_ITEM

Not Null, Foreign Key refers to ORDER

Not Null, Foreign Key refers to ITEM

ORD_ITEM Table:

Page 11: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-11

Enter the DBMS

• Now that the tables and relationships have been conceptually defined, the DBMS may be used to actually create the database objects

Page 12: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-12

Creating a Table with Microsoft Access

Double-Click the “Create table in Design view” Option

Page 13: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-13

Entering Field Characteristics

• Enter the Field Name, Data Type, and Description (optional) for each field

• Click and Drag to include all Fields that are part of the Primary Key

• With all fields making up the Primary Key highlighted, click the Primary Key Button

Page 14: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-14

Microsoft AccessTable Define View

Primary Key Button

Page 15: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-15

Close the Table Design View and Save

• To save the table, simply close the design view window and type a name for the table

Page 16: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-16

Microsoft AccessSaving the Table

Page 17: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-17

Creating the Remaining Tables

• Follow the above procedure for the remaining tables

Page 18: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-18

Defining a Composite Primary Key

All fields defining the Primary Key are highlightedbefore clicking the Primary KeyButton

Page 19: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-19

Informing the DBMS of the Foreign Key Constraints

• The DBMS must be informed about what Primary Key is mapped to what Foreign Key.

• This defines the database’s Referential Integrity

Page 20: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-20

Microsoft Access: Relationships View

• Within Microsoft Access the referential integrity constraints are defined in the Relationship View Window by:– clicking on the Primary Key, then– dragging it to the Foreign Key, and– dropping it on the Foreign Key

Page 21: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-21

Relationships View

Click to enter the Relationships View

Page 22: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-22

Select the Tables to be Included

Add each table to the Relationships View Window by highlighting the table nameand clicking the Add button

Page 23: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-23

Arrange Tables in Relationships View

Click and Drag to arrange the tables

to avoid crossing relationship lines.

Page 24: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-24

Creating a Relationship

Table Names

Field Names

Enforce ReferentialIntegrity = Checked

Define Cascading Rules

Page 25: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-25

The Resulting Relationship

Page 26: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-26

Create the Remaining Relationships

• Drag each Primary Key Field and drop on the appropriate Foreign Key field to create the remaining relationships

• Enforce referential integrity for each remaining relationship

Page 27: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-27

The Final Relationships View Window

Page 28: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-28

Creating Queries

Click the Queries Tab

Page 29: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-29

Creating a Query inDesign View

Double-Click“Create query in Design view”

Page 30: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-30

Defining the Query

Sorting and Specifying Search Criteria

Drag & Drop Fields to Display

Click to Show results

Page 31: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-31

Changing the View to see the SQL Statement

Dropdown ButtonClick SQL View

Page 32: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-32

The SQL View of the Query

Page 33: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-33

Action Queries

Dropdown ButtonChoose Action type

Page 34: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-34

Forms

A form a graphical display for adding, updating, viewing, and deleting data from one or more tables

Page 35: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-35

Creating a Form

Click to Create a Form

Page 36: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-36

Create Form using the Form Wizard

Double-Click to Launch the Form Wizard

Page 37: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-37

Choosing the Table/Query and Fields to Include

Select the Tableor Query on which to base the Form

Select the Field(s)to include on the Form

Page 38: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-38

Select the Form Style and Colors

A finished form

Page 39: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-39

Creating a Report

Click to Create a Report

Page 40: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-40

Create a Report using the Report Wizard

Click to Create a Report using the Report Wizard

Page 41: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-41

Choosing the Table/Query and Fields to Include

Select the Fields toInclude in the Report

Select the Table or Querythat provides information for the Report

Page 42: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition © 2005 Pearson Prentice Hall

Appendix-42

Select the Report Style and Colors

A finished report

Page 43: Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.

Database Processing with Microsoft Access

End of Presentation on Appendix

DAVID M. KROENKE’S

DATABASE CONCEPTS, 2nd Edition