+ All Categories
Home > Documents > I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101...

I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101...

Date post: 04-Jan-2016
Category:
Upload: myrtle-ariel-powers
View: 215 times
Download: 2 times
Share this document with a friend
37
INTRODUCTION TO DATABASE CONCEPTS AND MICROSOFT ACCESS 2007 Eyad M. AlMassri BGMS4101 Introducti on 1
Transcript
Page 1: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

INTRODUCTION TO DATABASE CONCEPTS

AND MICROSOFT ACCESS 2007

Eyad M. AlMassri

BGMS4101

Introduction

1

Page 2: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

ORGANIZING DATA Your first step in organizing data is to identify

the individual fields The specific value, or content, of a field is called

the field value A set of field values is called a record

Next, you group related fields together into tables

2

Page 3: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

DATABASE CONCEPTS AND ACCESS 2007

Introduction Database Microsoft Access

Design and CreationPlan Tables Queries Forms Reports

3

Page 4: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

WHAT IS A DATABASE? A structured collection of related data An filing cabinet, an address book, a

telephone directory, a timetable, etc. In Access, your Database is your

collection of related tables

Page 5: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

DATA VS. INFORMATION

Data – a collection of facts made up of text, numbers and dates:

Murray 35000 7/18/86

Information - the meaning given to data in the way it is interpreted:

Mr. Murray is a sales person whose annual salary is $35,000 and whose hire date is July 18, 1986.

5

Page 6: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BASIC DATABASE CONCEPTS

Table A set of related records

Field

Record– A collection of data

about an individual item

– A single item of data common to all records

Name: Barry HarrisCollege: MedicineTel: 392-5555

Name: Barry HarrisCollege: MedicineTel: 392-5555

Name: Barry Harris

6

Page 7: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

AN EXAMPLE OF A TABLE

Records

Fields

Name GatorLink Phone College

Graff rgraff 392-3900 Pharmacy

Harris bharris 392-5555 Medicine

Ipswich zipswich 846-5656 PHHP

7

Page 8: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

DESIGN AND DOCUMENT YOUR DATABASE

A designers best tools are a pencil and paper It is important to plan what you are going to do

The sooner you touch the computer the sooner you’ll make a mistake If you don’t plan you will often have to

start again

Document what you are doing, will you remember what you did in three months time?

8

Page 9: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

QUESTIONS TO ASK YOURSELF

What have I got? (Inputs)

What do I want? (Outputs)

What do I need to do to get there? (Process)

How am I going to build it? (Application/Program)

9

Page 10: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

DATABASE OPTIONSFreeware/ Shareware

Microsoft Excel

Microsoft Access

Oracle/SQL

Simplicity Basics

Intermediate

AdvancedHire a

programmer

# of Users 1 1 Multiple

Multiple of Multiples

Multiple datasets No No Yes Yes

SecurityAlways consult with your security team if you are going to put any sensitive data on the internet.

10

Page 11: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

WHY USE ACCESS?Familiar look and feel of

Windows

Easy to start building simple databases

Can build sophisticated systems

It’s already on your computer

True relational database11

Page 12: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

WHAT IS A RELATIONAL DATABASE?

A relational database is a collection of tables from which data can be accessed in many different ways without having to reorganize the database tables. That is, once relationships are created, tables can

“talk” to each other. We can link (relate) the tables to find:

Which doctors have seen a patient Which students are in a class Which item is selling the most on Friday’s

Page 13: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BASIC DESIGN RULES Data is broken down into Smallest Logical Parts

PT ID # Home Address

987 123 West Main Street, Gainesville, FL 32601

654 456 South 3rd Road, Apt 12, Newberry, FL 32684

321 846 West Newberry Road, Gainesville, FL 32609

Putting all of the home address in one field may make for convenient data entry, but it makes it very difficult to work with the data. For example, what if I needed to sort by City or Zip Code? Pulling fields together is fairly simple, pulling them apart is very difficult.

You can join fields together in queries, forms and reports. 13

Page 14: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BASIC DESIGN RULES Unique Field Names

PATIENT TABLE

First Name Last Name

Annie Adams

April Appleton

Arnold Arlington

Bobbie Brown

Butch Bruce

You also want to be aware of the field names across tables. For example several tables may use the Field LastName. When you use those fields in other parts of the database things can become very confusing very quickly. DOCTOR TABLE

First Name Last Name

Sallye Shapiro

Samuel Smith

Sidney Samueson

When these two Last Name fields are pulled into the same Query/Form/Report they will appear with the table name in front of the field name: Patient Table.Last Name 14

Page 15: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BASIC DESIGN RULES No Calculated or Derived Fields

EmployeeID Num

HourlyRate

StandardHours

StandardPay

Dept IDNum

Dept Name

123 $10.00 40 $390.00 12 Editing

789 $10.00 20 $200.00 12 Edit

Calculations - If we give an employee a raise, we will need to change both the Hourly Rate and the Standard Pay, and we need to make sure our calculations are correct.

Derivations - Since we have the Dept ID, there is no need to include the Dept Name, it can be pulled from the Dept Table. Listing it in both places leads to data entry errors.

Access will let you create calculations in queries, forms and reports. 15

Page 16: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BASIC DESIGN RULES Unique Records

LastName GatorLink Phone College

Smith rsmith 3-5051 Pharmacy

Smith rsmith 273-5051 COP

Smith rsmith 273-5051 Pharmacy

Thomas bthomas 392-5555 Medicine

Van Winkle sleepyguy 846-5656 PHHP

If you don’t have unique records, your database can’t tell which record you may be referring to.

LastName

EmergencyContact

Smith Mary Anne Smith16

Page 17: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

PRIMARY KEYSLastName GatorLink Phone College

Smith rsmith 273-5051 Pharmacy

Thomas bthomas 392-5555 Medicine

Van Winkle sleepyguy 846-5656 PHHP

To ensure that each record is unique in each table, we can set one field to be a Primary Key field.

A Primary Key is a field that that will contain no duplicates and no blank values.

Looking at the table above, what would be the best Primary Key? 17

Page 18: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

PRIMARY KEYSLastName GL ID Phone College

Smith rsmith 273-5051 Pharmacy

Thomas Bthomas 392-5555 Medicine

Van Winkle sleepyguy 846-5656 PHHP

While each column in this particular data set has unique data, the field that will work best for us is GL ID (GatorLink). Many employees will work for the same college, have the same last name and possibly even share telephone numbers, but each employee should have a unique GatorLink ID.

When there is not a unique field in your data set, you can use an AutoNumber. Access can create incremented or random AutoNumbers for your primary key. 18

Page 19: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BASIC DESIGN RULES Unique Records

ID LastName GatorLink Phone College

1 Smith rsmith 3-5051 Pharmacy

2 Smith rsmith 273-5051 COP

3 Smith rsmith 273-5051 Pharmacy

4 Thomas bthomas 392-5555 Medicine

5 Van Winkle sleepyguy 846-5656 PHHP

We use the unique primary key as our link between our tables, this helps ensure we connect to the correct record.

Emp ID EmergencyContact

2 Mary Anne Smith 19

Page 20: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

LET’S START PLANNING

Patients Appointments

20

Page 21: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

NAVIGATING A DATASHEET

The navigation buttons provide another way to move vertically through the records

21

Page 22: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

22

DATABASE TERMINOLOGY

Field Record Table Database

A database is made up of one or more tables

Individual tables in a database

Records

Individual fields

Page 23: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

23

OBJECTS

Tables Queries Reports Forms Macros Modules

Objects

Page 24: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

OPENING A DATABASE

To open a database when you start Access

– Choose the database you wish to open from the left hand panel, or choose More… to browse for another database

To Create a database, click on the Blank Database at the top of the middle panel

You can also use the Microsoft button to open existing databases or create new ones.

24

Page 25: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

THE ACCESS DATABASE WINDOW

The menu on the left hand side provide access to all database objects

25

Page 26: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

DATA VIEW/DESIGN VIEW

Datasheet View

Design View

26

Page 27: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

NAVIGATING FIELDS AND RECORDS

To move through records and fields

To move through records

First Record

Previous Record

Last Record

New Record

Current Record

Next Record

Tab Shift+Tab Enter

Home/End Ctrl+Home Ctrl+End

Page Up Page Down The Arrow Keys

27

Page 28: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

INTRODUCING TABLES Database is a collection of TABLES Tables store the data

28

Page 29: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

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

29

Page 30: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

INTRODUCING FORMS A friendlier view of the database Used for data input, menus, display and printing Can perform Calculations and Combine fields

30

Page 31: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

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

31

Page 32: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

WORKING TOGETHER

Employees

Customers

Tables Queries

Customer

Company Name

Address

City

Telephone

Contact Name

Forms

Reports

32

Page 33: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

VIEWING OBJECTS IN THE NAVIGATION PANE

33

Page 34: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

COMPACTING AND REPAIRING A DATABASE Compacting a database rearranges the data

and objects in a database to decrease its file size

34

Page 35: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

COMPACTING AND REPAIRING A DATABASE Make sure the database file you want to

compact and repair is open Click the Office Button, point to Manage, and

then click Compact and Repair Database

35

Page 36: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

BACKING UP AND RESTORING A DATABASE Backing up a database is the process of

making a copy of the database file to protect your database against loss or damage

The Back Up Database command enables you to back up your database file from within the Access program, while you are working on your database

To restore a backup database file, you simply copy the backup from the drive on which it is stored to your hard drive

36

Page 37: I NTRODUCTION TO D ATABASE C ONCEPTS AND M ICROSOFT A CCESS 2007 Eyad M. AlMassri BGMS4101 Introduction 1.

37

ACCESS OR EXCEL?

You are working with large amounts of data

You need to create relationships between your data

You rely on external databases to analyze data

Your data is of a manageable data size

There is no need for relationships between data

You are primarily creating calculations and statistics

Use Access when: Use Excel when:


Recommended