Database Design Conceptual Model and ER Diagramming University

Database Design: Conceptual Model and ER Diagramming University of California, Berkeley School of Information Management and Systems SIMS 202: Information Organization and Retrieval IS 257 - Fall 2002. 08. 29 - SLIDE 1

Lecture Outline • Review – Information Systems Planning – Information Systems Architecture – Information Engineering • Database Design • ER Diagrams • Developing the Conceptual Model IS 257 - Fall 2002. 08. 29 - SLIDE 2

Lecture Outline • Review – Information Systems Planning – Information Systems Architecture – Information Engineering • Database Design • ER Diagrams • Developing the Conceptual Model IS 257 - Fall 2002. 08. 29 - SLIDE 3

Review • • Information Systems Planning Information Systems Architecture Information Engineering Database Design IS 257 - Fall 2002. 08. 29 - SLIDE 4

Information Systems Architecture • Zachman ISA Framework components – Data • The “what” of the information system – Process • The “how” of the information system – Network • The “where” of the information system – People • Who performs processes and are the source and receiver of data and information. – Events and Points in time • When processes are performed – Reasons • For events and rules that govern processing IS 257 - Fall 2002. 08. 29 - SLIDE 5

Information Engineering • A formal methodology that is used to create and maintain information systems • Starts with the Business Model and works in a Top-Down fashion to build supporting data models and process models for that business model IS 257 - Fall 2002. 08. 29 - SLIDE 6

Information Engineering Planning Analysis Design Implementation IS 257 - Fall 2002. 08. 29 - SLIDE 7

Lecture Outline • Review – Information Systems Planning – Information Systems Architecture – Information Engineering • Database Design • ER Diagrams • Developing the Conceptual Model IS 257 - Fall 2002. 08. 29 - SLIDE 8

Database Design Process Application 1 External Model Application 2 Application 3 Application 4 External Model Application 1 Conceptual requirements Application 2 Conceptual requirements Application 3 Conceptual requirements Conceptual Model Logical Model Internal Model Application 4 Conceptual requirements IS 257 - Fall 2002. 08. 29 - SLIDE 9

Stages in Database Design • • Requirements formulation and analysis Conceptual Design -- Conceptual Model Implementation Design -- Logical Model Physical Design --Physical Model IS 257 - Fall 2002. 08. 29 - SLIDE 10

Database Design Process • Requirements formulation and analysis – Purpose: Identify and describe the data that are used by the organization – Results: Metadata identified, Data Dictionary, Conceptual Model-- ER diagram IS 257 - Fall 2002. 08. 29 - SLIDE 11

Database Design Process • Requirements Formulation and analysis – Systems Analysis Process • Examine all of the information sources used in existing applications • Identify the characteristics of each data element – – numeric text date/time etc. • Examine the tasks carried out using the information • Examine results or reports created using the information IS 257 - Fall 2002. 08. 29 - SLIDE 12

Database Design Process • Conceptual Model – Merge the collective needs of all applications – Determine what Entities are being used • Some object about which information is to maintained – What are the Attributes of those entities? • Properties or characteristics of the entity • What attributes uniquely identify the entity – What are the Relationships between entities • How the entities interact with each other? IS 257 - Fall 2002. 08. 29 - SLIDE 13

Database Design Process • Logical Model – How is each entity and relationship represented in the Data Model of the DBMS • • IS 257 - Fall 2002 Hierarchic? Network? Relational? Object-Oriented? 2002. 08. 29 - SLIDE 14

Database Design Process • Physical (AKA Internal) Model – Choices of index file structure – Choices of data storage formats – Choices of disk layout IS 257 - Fall 2002. 08. 29 - SLIDE 15

Database Design Process • External Model – User views of the integrated database – Making the old (or updated) applications work with the new database design IS 257 - Fall 2002. 08. 29 - SLIDE 16

Lecture Outline • Review – Information Systems Planning – Information Systems Architecture – Information Engineering • Database Design • ER Diagrams • Developing the Conceptual Model IS 257 - Fall 2002. 08. 29 - SLIDE 17

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 IS 257 - Fall 2002. 08. 29 - SLIDE 18

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. ) Birthdate First Middle Last IS 257 - Fall 2002 Age Name Employee SSN Projects 2002. 08. 29 - SLIDE 19

Relationships • Relationships are the associations between entities. They can involve one or more entities and belong to particular relationship types IS 257 - Fall 2002. 08. 29 - SLIDE 20

Relationships Student Attends Class Project Supplier IS 257 - Fall 2002 Supplies project parts Part 2002. 08. 29 - SLIDE 21

Types of Relationships • Concerned only with cardinality of relationship Employee 1 Assigned n Assigned 1 1 m Assigned n Truck Project Chen ER notation IS 257 - Fall 2002. 08. 29 - SLIDE 22

Other Notations Employee Assigned Truck Employee Assigned Project “Crow’s Foot” IS 257 - Fall 2002. 08. 29 - SLIDE 23

Other Notations Employee Assigned Truck Employee Assigned Project IDEFIX Notation IS 257 - Fall 2002. 08. 29 - SLIDE 24

More Complex Relationships Manager 1/1/1 Employee 1/n/n Evaluation n/n/1 Project SSN Date Project Employee 4(2 -10) Assigned 1 Manages Employee IS 257 - Fall 2002 Is Managed By Project 1 Manages n 2002. 08. 29 - SLIDE 25

Weak Entities • Owe existence entirely to another entity Part# Invoice # Order Invoice# Contains Quantity Order-line Rep# IS 257 - Fall 2002. 08. 29 - SLIDE 26

Supertype and Subtype Entities Employee Sales-rep Sold Is one of Manages Clerk Other Invoice IS 257 - Fall 2002. 08. 29 - SLIDE 27

Many to Many Relationships SSN Proj# Hours Project Assignment Is Assigned Project Assigned Employee IS 257 - Fall 2002 SSN 2002. 08. 29 - SLIDE 28

Lecture Outline • Review – Information Systems Planning – Information Systems Architecture – Information Engineering • Database Design • ER Diagrams • Developing the Conceptual Model IS 257 - Fall 2002. 08. 29 - SLIDE 29

Developing a Conceptual Model • Overall view of the database that integrates all the needed information discovered during the requirements analysis. • Elements of the Conceptual Model are represented by diagrams, Entity-Relationship or ER Diagrams, that show the meanings and relationships of those elements independent of any particular database systems or implementation details. • Can also be represented using other modeling tools (such as UML) IS 257 - Fall 2002. 08. 29 - SLIDE 30

Developing a Conceptual Model • Building the Conceptual Model for the Diveshop database • Names for the Diveshop company? IS 257 - Fall 2002. 08. 29 - SLIDE 31

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. . . IS 257 - Fall 2002. 08. 29 - SLIDE 32

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. IS 257 - Fall 2002. 08. 29 - SLIDE 33

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 IS 257 - Fall 2002. 08. 29 - SLIDE 34

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. IS 257 - Fall 2002. 08. 29 - SLIDE 35

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 IS 257 - Fall 2002. 08. 29 - SLIDE 36

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 when replacements or additional equipment is needed IS 257 - Fall 2002. 08. 29 - SLIDE 37

Entities • • Customer Dive Order Line item Shipping information • Dive Equipment/ Stock/Inventory • Dive Locations IS 257 - Fall 2002 • Dive Sites • Sea Life • Shipwrecks 2002. 08. 29 - SLIDE 38

Diveshop Entities: DIVECUST City State/Prov Street Name Customer no IS 257 - Fall 2002 ZIP/Postal Code Country Dive. Cust Phone First Contact 2002. 08. 29 - SLIDE 39

Diveshop Entities: DIVEORDS Ship Via Sale Date Customer No Dive. Ords Order no CCNumber Vacation Cost Destination Return Date IS 257 - Fall 2002 Payment Method CCExp. Date No of People Depart Date 2002. 08. 29 - SLIDE 40

Diveshop Entities: DIVEITEM Rental/ Sale Item no Qty Dive. Item Line Note Order no IS 257 - Fall 2002. 08. 29 - SLIDE 41

Diveshop Entities: SHIPVIA Ship Via Ship Cost Ship. Via IS 257 - Fall 2002. 08. 29 - SLIDE 42

Diveshop Entities: Dive. Stok On Hand Reorder Point Equipment Class Description Cost Sale Price Dive. Stok Rental Price Item No IS 257 - Fall 2002. 08. 29 - SLIDE 43

Diveshop Entities: DEST Spring Avg Temp (C)Temp (F) Summer Temp (C) Avg Temp (F) Destination name Summer Temp (F) Destination no Accommodations Travel Cost Body of Water IS 257 - Fall 2002 Fall Temp (C) Fall Temp (F) Winter Temp (C) Temp (F) Night Life 2002. 08. 29 - SLIDE 44

Diveshop Entities: SITES Site Highlight Site Notes Distance From Town (Km) Site Name Destination no Distance From Town (M) Depth (ft) Sites Site no Depth (m) Visibility(ft) Skill Level Visibility (m) Current IS 257 - Fall 2002. 08. 29 - SLIDE 45

Diveshop Entities: BIOSITE Species No Site No Bio. Site IS 257 - Fall 2002. 08. 29 - SLIDE 46

Diveshop Entities: BIOLIFE Species Name Length (cm) Length (in) Common Name Notes external Category Graphic external Bio. Life Species no IS 257 - Fall 2002. 08. 29 - SLIDE 47

Diveshop Entities: SHIPWRCK Type Interest Tonnage Length (ft) Category Site no Shipwrck Ship Name Graphic external IS 257 - Fall 2002 Condition Passengers/ Cause Crew Survivors Comments Date external Sunk Length (m) Beam (ft) Beam (m) 2002. 08. 29 - SLIDE 48

Functional areas • • • Ordering Inventory Supplies Shipping Billing Location/Site Selection – We will concentrate on Ordering and Location/Site Selection (these are joined tasks) IS 257 - Fall 2002. 08. 29 - SLIDE 49

Ordering Customer (DIVECUST) Orders (DIVORDS) Customers place Orders Each Order needs Customer information IS 257 - Fall 2002. 08. 29 - SLIDE 50

Ordering Ship Via Customer No Dive. Cust Ship. Via ship Orders Dive. Ords Customer No Order No Dive. Item IS 257 - Fall 2002 Repeating attribute 2002. 08. 29 - SLIDE 51

Ordering Normalization Ship Via Ship. Via Item No Customer No Dive. Cust Ship Orders Dive. Ords Order No Contains Qty Dive. Item Order No Rental/sale Customer No IS 257 - Fall 2002. 08. 29 - SLIDE 52

Details of Dive. Item No Company# Supplier Order No Has m Supplies We’re ignoring this part. . . n Dive. Stok Item No On Hand Sale Price IS 257 - Fall 2002. 08. 29 - SLIDE 53

Ordering: Full ER Customer No Destination Name Destination no Dest Dive. Cust 1 Customer No 1 n Ship. Via n Dive. Ords n 1 Ship. Via 1 Destination Order No n Dive. Item n Order No Item No 1 Dive. Stok IS 257 - Fall 2002 Item No 2002. 08. 29 - SLIDE 54

Location/Site Selection Destination Name No Destination Dive. Ords IS 257 - Fall 2002 Going to? Dest 2002. 08. 29 - SLIDE 55

Destination/ Sites Destination Name Customer No Destination no 1 Destination no Site No n Dive. Ords 1 n Destination Order No Sites IS 257 - Fall 2002. 08. 29 - SLIDE 56

Sites and Sea Life 1 Site No Destination no Sites Bio. Life IS 257 - Fall 2002 Multiple occurrences of sea life. . . 2002. 08. 29 - SLIDE 57

Diveshop ER diagram: Bio. Site Species No Site No Bio. Site IS 257 - Fall 2002. 08. 29 - SLIDE 58

Sites and Sea Life 2 Site No 1 Site No Species No Destination no Sites n Bio. Site n 1 Species No IS 257 - Fall 2002 Bio. Life 2002. 08. 29 - SLIDE 59

Sites and Shipwrecks Site No Destination no Sites 1 1/n Ship. Wrck Site No IS 257 - Fall 2002. 08. 29 - SLIDE 60

Dive. Shop ER Diagram Customer No Dive. Cust 1 Destination Name Destination no Customer No Ship. Via n Dest n 1 Dive. Ords n 1 Ship. Via 1 Destination no Site No 1 n Site No Species No Bio. Site 1 Destination n Sites Order No n 1 1/n Ship. Wrck Dive. Item n Order No Item No n Site No 1 Species No Bio. Life IS 257 - Fall 2002 1 Dive. Stok Item No 2002. 08. 29 - SLIDE 61

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 IS 257 - Fall 2002. 08. 29 - SLIDE 62

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 – No history (only current or last order) IS 257 - Fall 2002. 08. 29 - SLIDE 63

Next Time • TUESDAY: – More on UML database modeling – Designing the Logical Model IS 257 - Fall 2002. 08. 29 - SLIDE 64
- Slides: 64