Top Banner
9/7/1999 Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information Management and Systems SIMS 202: Information Organization and Retrieval
44

9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

Dec 20, 2015

Download

Documents

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: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Database Design: Conceptual Model and ER Diagramming

University of California, Berkeley

School of Information Management and Systems

SIMS 202: Information Organization and Retrieval

Page 2: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Review

• Database Design Process

• Basics of ER Diagrams

Page 3: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Database Design Process

ConceptualModel

LogicalModel

External Model

Conceptual requirements

Conceptual requirements

Conceptual requirements

Conceptual requirements

Application 1

Application 1

Application 2 Application 3 Application 4

Application 2

Application 3

Application 4

External Model

External Model

External Model

Internal Model

Page 4: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Entity

• An Entity is an object in the real world (or even imaginary worlds) about which we want or need to maintain information– Persons (e.g.: customers in a business,

employees, authors)– Things (e.g.: purchase orders, meetings, parts,

companies)

Employee

Page 5: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Attributes

• Attributes are the significant properties or characteristics of an entity that help identify it and provide the information needed to interact with it or use it. (This is the Metadata for the entities.)

Employee

Last

Middle

First

Name SSN

Age

Birthdate

Projects

Page 6: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Relationships

• Relationships are the associations between entities. They can involve one or more entities and belong to particular relationship types

Page 7: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Relationships

ClassAttendsStudent

PartSuppliesproject

partsSupplier

Project

Page 8: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Types of Relationships

• Concerned only with cardinality of relationship

TruckAssignedEmployee

ProjectAssignedEmployee

ProjectAssignedEmployee

1 1

n

n

1

m

Page 9: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

More Complex Relationships

ProjectEvaluationEmployee

Manager

1/n/n

1/1/1

n/n/1

ManagesEmployee

ProjectAssignedEmployee 4(2-10) 1

SSN ProjectDate

Manages

Is Managed By

1

n

Page 10: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Weak Entities

• Owe existence entirely to another entity

Order-lineContainsOrder

Invoice #

Part#

Rep#

QuantityInvoice#

Page 11: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Supertype and Subtype Entities

ClerkIs one ofSales-rep

Invoice

Other

Employee

Sold

Manages

Page 12: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Many to Many Relationships

Employee

ProjectIsAssigned

ProjectAssignment

Assigned

SSN

Proj#

SSN

Proj#Hours

Page 13: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Today

• Building the Conceptual Model for the Diveshop database

• Names for the Diveshop company?

Page 14: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Developing a Conceptual Model

• We will look at a small business -- a diveshop that offers diving adventure vacations

• Assume that we have done interviews with the business and found out the following information about the forms used and types of information kept in files and used for business operations...

Page 15: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Primary Business Operations• The shop takes orders from customers for dive

vacations.

• It ships information about the dive vacation to the customers.

• It rents diving equipment for the divers going on the trips (these may include additional people other than the customer)

• It bills the customer for the vacation and for equipment rental or sales.

Page 16: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Business Operations (cont.)

• It arranges sub-trips to particular dive sites at the primary location.

• It provides information about the features of various sites to help customers choose their destinations.– Features include sea life found at the location

and shipwrecks

Page 17: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Business Operations (cont.)• Each dive order (or sale or trip) is on an invoice

to one customer.– Invoices contain:

• Line items for each type of equipment ordered,• Total amount due for the invoice,• Customer information:

– Name, address, phone, credit card info.

• Information must be kept on inventory of dive equipment.

• There are multiple types of dive equipment:– The prices charged for sale or rental are maintained.

Page 18: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Business Operations (cont.)• Destination information includes:

– Name of the destination– information about the location (accomodations,

night life, travel cost, average temperatures for different times of the year

• Destinations have associated dive sites.• Dive Sites have associated features

– Sea life – Shipwrecks

Page 19: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Business Operations (cont.)

• One record is kept for each order by a customer and will include the method of payment, total price, and location information. (I.e. Customers may have multiple orders)

• The company needs to know how an order is to be shipped.

• The shop has to keep track of what equipment is on-hand and when replacements or additional equipment is needed

Page 20: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Entities

• Customer• Dive Order• Line item• Shipping information• Dive Equipment/

Stock/Inventory• Dive Locations

• Dive Sites• Sea Life• Shipwrecks

Page 21: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: DiveCust

Name

Customer no

Street

State/ProvCityZIP/Postal

Code

Country

First Contact

PhoneDiveCust

Page 22: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: DiveOrds

CustomerNo

Order no

SaleDate

ShipVia

TotalInvoice

DestinationCCExpDate

CCNumber

PaymentMethodDiveOrds

No ofPeople

VacationCost

ReturnDate

DepartDate

Page 23: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: DiveItem

Item no

Order no

Rental/Sale

Qty

Line Note

DiveItem

Page 24: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: ShipViaShip Via

ShipCost

ShipVia

Page 25: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: DiveStok

Description

Item No

EquipmentClass

ReorderPoint

On Hand Cost

SalePrice

DiveStokRentalPrice

Page 26: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: Dest

Destinationname

Destination no

Avg Temp (F)

SpringTemp (F)

Avg Temp (C)

Summer Temp (C)

SummerTemp (F)

TravelCost

WinterTemp (C)

FallTemp (F)

FallTemp (C)Dest

WinterTemp (F)

Accommodations

Body ofWater

NightLife

Page 27: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: Sites

Destinationno

Site no

Site Name

SiteNotes

SiteHighlight

DistanceFrom Town (M)

DistanceFrom Town (Km)

Skill Level

Visibility(ft)

Depth (m)

Depth (ft)Sites

Visibility (m)

Page 28: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: Biolife

Category

Species no

CommonName

Length(cm)

SpeciesName

Length(in)

Notes

GraphicBioLife

Page 29: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER Entities: Shipwrck

Site no

Ship Name

Category

InterestType Tonnage

Length (ft)

Beam(m)

Beam(ft)

Length(m)Shipwrck

Cause

CommentsDateSunk

Passengers/Crew

Graphic

Survivors

Condition

Page 30: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Functional areas

• Ordering• Inventory• Supplies• Shipping• Billing• Location/Site Selection

– We will concentrate on Ordering and Location/Site Selection (these are joined tasks)

Page 31: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Ordering

Orders(DIVORDS)

Customer(DIVECUST)

Customers place OrdersEach Order needs Customer information

Page 32: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Ordering

DiveOrdsOrdersDiveCust

Customer No ship

ShipVia

Order No

Ship Via

DiveItem Repeatingattribute

Customer No

Page 33: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Ordering Normalization

DiveCust Orders

Customer No

DiveOrds

Ship

ShipVia

Order No

Ship Via

DiveItemContains

Item No

QtyOrder No

Customer NoRental/sale

Page 34: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Details of DiveItem

DiveStokSuppliesSupplier

Company# Has

DiveItem

Item No

Item No

On Hand

Sale Price

Order No

m n

We’re ignoring this part...

Page 35: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Ordering: Full ERCustomer

No

ShipVia

DestShipVia

DiveStok

DiveItem

DiveOrds

DiveCust

CustomerNo

ShipVia

OrderNo

OrderNo

ItemNo

ItemNo

DestinationName

Destination

Destinationno 1

1

1

1

1n

n

n

n

n

Page 36: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Location/Site Selection

DestGoing

to?DiveOrds

DestinationNo

DestinationName

Destination

Page 37: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Destination/ Sites

Dest

Sites

DiveOrds

CustomerNo

OrderNo

DestinationName

DestinationSite No

Destinationno

Destinationno

1

1

n

n

Page 38: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Sites and Sea Life 1

BioLife

Sites

Site NoDestination

no

Multiple occurrencesof sea life...

Page 39: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Diveshop ER diagram: BioSiteSpecies

NoSiteNo

BioSite

Page 40: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Sites and Sea Life 2

Sites

BioSite

BioLifeSpeciesNo

Site No

Site No

Destinationno

SpeciesNo

1

1

n

n

Page 41: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

Sites and Shipwrecks

Sites

ShipWrck

Site NoDestination

no

Site No

1/n

1

Page 42: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

DiveShop ER DiagramCustomer

No

ShipVia

Dest

Sites

BioSite

ShipVia

ShipWrck

BioLife DiveStok

DiveItem

DiveOrds

DiveCust

CustomerNo

ShipVia

OrderNo

OrderNo

ItemNo

ItemNo

DestinationName

Destination

SpeciesNo

Site No

Destinationno

Site No

Destinationno

SpeciesNo

Site No

1

1

1

1

1

1

1/n

1

1n

n

n

n

n

n

n

n

1

Page 43: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

What must be calculated?

• Total price for equipment rental?

• Total price for equipment sale?

• Total price of an order?– Vacation price– Equipment (rental or sale)– Shipping

Page 44: 9/7/1999Information Organization and Retrieval Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information.

9/7/1999 Information Organization and Retrieval

What is Missing??

• Not really an “enterprise-wide” database– No personnel

• Sales people• Dive masters• Boat captains and crew• payroll

– Local arrangements• Dive Boats• Hotels

– Suppliers/Wholesalers for dive equipment• Orders for new/replacement equipment