You are on page 1of 16

All Powder Board and Ski

Microsoft Access Workbook


Chapter 2: Database Design
Jerry Post
Copyright 2003

DBDesign: An Expert System


http://time-post.com/dbdesign
Benefits

Makes it easy to create database diagrams


Saves data in central location, so changes can be
made from almost any computer
Provides immediate detailed feedback on the design

Requirements

Instructors must ask for a free account


Instructors and students need a Java-enabled Web
browser

Access Data Types (Domains)


Name

Data

Bytes

Text (characters)
fixed
variable
memo

NA
Text
Memo

255
64 K

Variable
Variable

Numeric
Byte (8 bits)
Integer (16 bits)
Long (32 bits)
(64 bits)
Fixed precision
Float
Double
Currency
Yes/No

Number: Byte
Number: Integer
Number: Long Integer
NA
Number: Decimal
Number: Single
Number: Double
Currency
Yes/No

0-255
+/- 32767
+/- 2 billion
+/- 1 E 28
+/- 1 E 38
+/- 1 E 308
+/- 900.0000 trillion
0/1

1
2
4
12
4
8
8
1 bit

Date/Time

Date/Time

1/1/100 12/31/9999 (1 sec)

Image

OLE Object

1 gigabyte

Variable

AutoNumber

AutoNumber

Long (+/- 2 billion)

Initial Business Objects


Sale
SaleID
SaleDate
CustomerID
EmployeeID
Employee
EmployeeID
TaxpayerID
LastName
FirstName
Address
City
State
ZIP

Customer
CustomerID
LastName
FirstName
Phone
Address
City
State
ZIP

Rental
RentID
RentDate
CustomerID
ExpectedReturn

Associations or Relationships
Sale
SaleID
SaleDate
CustomerID
EmployeeID

11
0*

Employee
EmployeeID
TaxpayerID
LastName
FirstName
Address
City
State
ZIP

Customer
CustomerID
LastName
FirstName
Phone
Address
City
State
ZIP

Rental
RentID
RentDate
CustomerID
ExpectedReturn

Getting Started
Enter the key
numbers you
received
Create a
username and
password.
Enter your
correct name,
e-mail address
and StudentID

Class Registration
Successful
account creation

Select your
university and class
Enter the admit
code

DBDesign: Example

Menu

Class
(entity)
Status line

Corrections

Available
columns

Relationships
Drag-anddrop column

Select min and


max for both
sides of the
relationship

Design Errors
Add SKU to
the Sale table
Connect the
Inventory table to
the Sale table

Double click the


diagnostic
message

Possible errors
are highlighted

More Errors
Try setting SKU
as a key

It still causes problems


because SaleDate does not
depend on the SKU

Split Many-to-Many Relationship


Many-to-Many
Inventory
SKU
Size
QOH

Sale
11

11

SaleItem
0*

SaleID
SKU
QuantitySold
SalePrice

1*

SaleID
SaleDate
CustomerID
EmployeeID

Ski Shop Inventory


Item: 196 cm

Item: 181 cm
Ski shops carry multiple lengths
of each ski or board model.

Model information refers to the


overall type of board or ski.

Model:
Rossignol Axium
Photo: www.rossignol.com

Inventory information refers to


an individual ski or board
defined by its length.

Models and Items

Customer Skill Level


CustomerID, LastName, Style, SkillLevel
CustomerID, LastName, Style, SkillLevel
Business rule: Each customer can have one skill in many styles.
Business rule: Each style can apply to more than one customer.
Need a table with both attributes as keys.
CustomerID, LastName, Style, SkillLevel
But you cannot include LastName, FirstName and so on, because
then you would have to re-enter that data for each customer skill.

Customer Style Skills


Customer

Style

CustomerID
LastName
FirstName
Phone
Address
City
State
ZIP

Style
StyleDescription

CustomerSkill
CustomerID
Style
SkillLevel

SkillLevel
SkillLevel
SkillDescription

You might also like