Anda di halaman 1dari 19

Relational

Database Design
Training Module

Sherri Orwick Ogden


VCT5660
November, 2009

Exit Begin
Relational Database Design

What is a database?
How is it different than a spreadsheet?
Why would you want to use one?

This learning module will provide the answers and walk


you through the steps to properly design a database!

Click “Next” to start


from the beginning or
click “Quick Links” to go
to a specific section.

Quick Links Back Next


Relational Database Design

Quick Links

Click one of the Navigation Tips


selections to
quickly link to a
What is a database?
section of the
module
Designing a Database

Try it!

Back Next
Relational Database Design

First, a few helpful tips on how to navigate this


module

Navigation
hint
Not sure what to do next? Look for these navigation
hints!
Look for this icon to test your skills in an interactive
exercise!

Click this icon to hear an explanation!

Orange sections and buttons provide visual samples


and explanations!
Click Next
to
Green buttons and arrows will take you to another page in the module! continue

Back Next
Relational Database Design

What is a database?

Definition:
A database groups data
in separate tables by
related categories. The
tables are linked
together using key
fields in each table.
This structure allows
quick data retrieval and
eliminates entry of
duplicate information.

Quick Links Back Next


Relational Database Design

Why wouldn’t I use a spreadsheet?

In
In aa database,
database, aa key
key field
field is
is created
created to
to
A
A Spreadsheet
Spreadsheet is is “flat.”
“flat.” InIn represents
represents thethe person’s
person’s name.
name. TheThe
other
other words,
words, toto track
track multiple
multiple information
information about
about the
the person
person is is
types
types of
of information
information for
for one
one entered
entered inin related
related tables.
tables. The
The
person,
person, you
you must
must enter
enter the
the database
database automatically
automatically links
links the
the
person’s
person’s name
name multiple
multiple times.
times. information
information using
using the
the key
key field.
field. You
You
only
only have
have to
to enter
enter the
the person’s
person’s namename
once!
once!

Show me

Quick Links Back Next


Relational Database Design

Spreadsheet

John Smith
Work: 555-222-8888
Database Home: 555-333-2222
Cell: 555-999-4444

Instead
Instead of
of having
having oneone flat
flat
spreadsheet,
spreadsheet, the
the name
name isis separated
separated
from
from the
the phone
phone numbers
numbers and and linked
linked
by
by the
the NameID.
NameID. EnterEnter the
the name
name
once
once and
and the
the NameID
NameID is is created.
created.
When
When thethe phone
phone numbers
numbers are are
entered,
entered, the
the NameID
NameID automatically
automatically
links
links them
them toto the
the appropriate
appropriate name!
name! Back Next
Relational Database Design

When would I need to use a database instead of a


spreadsheet?
If you are unsure whether a database or spreadsheet would be best, ask
yourself one question…

Is there a one-to-many
relationship?
If the answer is yes, then most likely a database will be the best option.

What is one-to-many
relationship?

Quick Links Back Next


Relational Database Design

Relationships
A
A one-to-many
one-to-many relationship
relationship means
means you
you have
have one
one value
value (the
(the person),
person), but
but have
have more
more than
than
one
one type
type of
of information
information (phones)
(phones) to
to track
track for
for that
that person.
person.
Spreadsheet Database
One-to-One Relationship One-to-Many Relationship

If you are only tracking social security numbers, A person can have multiple phone numbers which
then use a spreadsheet! A person can’t have means a person has a one-to-many relationship with
more than one social security number. the phone numbers. To track phone numbers, it is
better to use a database!

Quick Links Back Next


Relational Database Design Plan…plan…plan!

I’ve decided I need a database…


Where do I start?
Before
Before you
you sit
sit down
down at
at the
the computer,
computer, plan
plan your
your database.
database. Below
Below are
are the
the steps!
steps!

• Define Purpose Purpose

• Define Fields What are fields?

• Design Tables What are tables?

What are
• Define Relationships relationships?

Quick Links Back Next


Relational Database Design

Define the purpose – stay on track!


In one sentence, write down the Purpose Sample
purpose of your database. You My database will allow me to record multiple
may want to manage your phone numbers, addresses and birthdays for all
of my friends and associates.
contacts, record phone numbers
or track expenses. Keep it
simple. Defining the purpose will
keep you on track while
designing the rest of the
database.

Quick Links Back Next


Relational Database Design

Define the fields – what information do I need?


The fields are containers that hold As indicated in the Purpose Sample, the
the data. When defining the database design used for practice will
track associates’ addresses, birthdays
fields, think about the information and phone numbers. Click the icon
you would like to see in a report. below to define the appropriate fields in
Create a field for each piece of an interactive exercise!
information you identify.

Quick Links Back Next


Fields Exercise

PROPERTIES
On passing, 'Finish' button: Goes to Next Slide
On failing, 'Finish' button: Goes to Next Slide
Allow user to leave quiz: At any time
User may view slides after quiz: At any time
User may attempt quiz: Unlimited times
Relational Database Design

Tables – categorize the fields


After creating a list of fields,
categorize them into related areas
by designing tables for each of the
categories. Create a key “ID” field
for each table.

Quick Links Back Next


tables

PROPERTIES
On passing, 'Finish' button: Goes to Next Slide
On failing, 'Finish' button: Goes to Next Slide
Allow user to leave quiz: After user has completed quiz
User may view slides after quiz: At any time
User may attempt quiz: Unlimited times
Relational Database Design

Define the relationships

Group the fields into categories

Quick Links Back Next


Relational Database Design

Now you try!

Practice by going through the


exercises again…

Quick Links Back Next


Relational Database Design

Summary

Quick Links Back Exit

Anda mungkin juga menyukai