Presentation is loading. Please wait.

Presentation is loading. Please wait.

2005.09.12 - SLIDE 1IS 257 – Fall 2005 Database Design: Conceptual and Logical Model Design University of California, Berkeley School of Information Management.

Similar presentations


Presentation on theme: "2005.09.12 - SLIDE 1IS 257 – Fall 2005 Database Design: Conceptual and Logical Model Design University of California, Berkeley School of Information Management."— Presentation transcript:

1 2005.09.12 - SLIDE 1IS 257 – Fall 2005 Database Design: Conceptual and Logical Model Design University of California, Berkeley School of Information Management and Systems SIMS 257: Database Management

2 2005.09.12 - SLIDE 2IS 257 – Fall 2005 Lecture Outline Review (and continuation) –Database Design, Conceptual Model Object-Oriented Modeling Logical Design for the Diveshop database

3 2005.09.12 - SLIDE 3IS 257 – Fall 2005 Lecture Outline Review (and continuation) –Database Design, Conceptual Model Object-Oriented Modeling Logical Design for the Diveshop database

4 2005.09.12 - SLIDE 4IS 257 – Fall 2005 Database Design Process Conceptual Model Logical Model External Model Conceptual requirements Conceptual requirements Conceptual requirements Conceptual requirements Application 1 Application 2Application 3Application 4 Application 2 Application 3 Application 4 External Model External Model External Model Internal Model

5 2005.09.12 - SLIDE 5IS 257 – Fall 2005 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)

6 2005.09.12 - SLIDE 6IS 257 – Fall 2005 Developing a Conceptual Model Building the Conceptual Model for the Diveshop database

7 2005.09.12 - SLIDE 7IS 257 – Fall 2005 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...

8 2005.09.12 - SLIDE 8IS 257 – Fall 2005 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.

9 2005.09.12 - SLIDE 9IS 257 – Fall 2005 Business Operations (cont.) It arranges sub-trips to particular dive sites at the primary location –NOTE: This needs expanding – charter boats, divemasters, local dive companies 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

10 2005.09.12 - SLIDE 10IS 257 – Fall 2005 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. Note: could be expanded with particular charter dates and time, dive boats, etc. 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.

11 2005.09.12 - SLIDE 11IS 257 – Fall 2005 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 –Note: could be expanded to include the boats, etc that go to specific sites

12 2005.09.12 - SLIDE 12IS 257 – Fall 2005 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

13 2005.09.12 - SLIDE 13IS 257 – Fall 2005 Entities Customer Dive Order Line item Shipping information Dive Equipment/ Stock/Inventory Dive Locations Dive Sites Sea Life Shipwrecks

14 2005.09.12 - SLIDE 14IS 257 – Fall 2005 Diveshop Entities: DIVECUST Name Customer no Street State/ProvCity ZIP/Postal Code Country First Contact Phone DiveCust

15 2005.09.12 - SLIDE 15IS 257 – Fall 2005 Diveshop Entities: DIVEORDS Customer No Order no Sale Date Ship Via Destination CCExpDate CCNumber Payment Method DiveOrds No of People Vacation Cost Return Date Depart Date

16 2005.09.12 - SLIDE 16IS 257 – Fall 2005 Diveshop Entities: DIVEITEM Item no Order no Rental/ Sale Qty Line Note DiveItem

17 2005.09.12 - SLIDE 17IS 257 – Fall 2005 Diveshop Entities: SHIPVIA Ship Via Ship Cost ShipVia

18 2005.09.12 - SLIDE 18IS 257 – Fall 2005 Diveshop Entities: DIVESTOK Description Item No Equipment Class Reorder Point On HandCost Sale Price DiveStok Rental Price

19 2005.09.12 - SLIDE 19IS 257 – Fall 2005 Diveshop Entities: DEST Destination name Destination no Avg Temp (F) Spring Temp (F) Avg Temp (C) Summer Temp (C) Summer Temp (F) Travel Cost Winter Temp (C) Fall Temp (F) Fall Temp (C) Dest Winter Temp (F) Accommodations Body of Water Night Life Spring Temp (C)

20 2005.09.12 - SLIDE 20IS 257 – Fall 2005 Diveshop Entities: SITES Destination no Site no Site Name Site Notes Site Highlight Distance From Town (M) Distance From Town (Km) Skill Level Visibility(ft) Depth (m) Depth (ft) Sites Visibility (m) Current

21 2005.09.12 - SLIDE 21IS 257 – Fall 2005 Diveshop Entities: BIOSITE Species No Site No BioSite

22 2005.09.12 - SLIDE 22IS 257 – Fall 2005 Diveshop Entities: BIOLIFE Category Species no Common Name Length (cm) Species Name Length (in) Notes external Graphic external BioLife

23 2005.09.12 - SLIDE 23IS 257 – Fall 2005 Diveshop Entities: SHIPWRCK Site no Ship Name Category InterestTypeTonnage Length (ft) Beam (m) Beam (ft) Length (m) Shipwrck Cause Comments external Date Sunk Passengers/ Crew Graphic external Survivors Condition

24 2005.09.12 - SLIDE 24IS 257 – Fall 2005 Functional areas Ordering Inventory Supplies Shipping Billing Location/Site Selection –We will concentrate on Ordering and Location/Site Selection (these are joined tasks)

25 2005.09.12 - SLIDE 25IS 257 – Fall 2005 Ordering Orders (DIVORDS) Customer (DIVECUST) Customers place Orders Each Order needs Customer information

26 2005.09.12 - SLIDE 26IS 257 – Fall 2005 Ordering DiveOrds Orders DiveCust Customer No ship ShipVia Order No Ship Via DiveItem Repeating attribute Customer No

27 2005.09.12 - SLIDE 27IS 257 – Fall 2005 Ordering Normalization DiveCust Orders Customer No DiveOrds Ship ShipVia Order No Ship Via DiveItem Contains Item No QtyOrder No Customer No Rental/sale

28 2005.09.12 - SLIDE 28IS 257 – Fall 2005 Details of DiveItem DiveStok Supplies Supplier Company# Has DiveItem Item No On Hand Sale Price Order No mn We’re ignoring this part...

29 2005.09.12 - SLIDE 29IS 257 – Fall 2005 Ordering: Full ER Customer No ShipVia Dest ShipVia DiveStok DiveItem DiveOrds DiveCust Customer No ShipVia Order No Order No Item No Item No Destination Name Destination no 1 1 1 1 1 n n n n n

30 2005.09.12 - SLIDE 30IS 257 – Fall 2005 Location/Site Selection Dest Going to? DiveOrds Destination No Destination Name Destination

31 2005.09.12 - SLIDE 31IS 257 – Fall 2005 Destination/ Sites Dest Sites DiveOrds Customer No Order No Destination Name Destination Site No Destination no Destination no 1 1 n n

32 2005.09.12 - SLIDE 32IS 257 – Fall 2005 Sites and Sea Life 1 BioLife Sites Site No Destination no Multiple occurrences of sea life...

33 2005.09.12 - SLIDE 33IS 257 – Fall 2005 Diveshop ER diagram: BioSite Species No Site No BioSite

34 2005.09.12 - SLIDE 34IS 257 – Fall 2005 Sites and Sea Life 2 Sites BioSite BioLife Species No Site No Destination no Species No 1 1 n n

35 2005.09.12 - SLIDE 35IS 257 – Fall 2005 Sites and Shipwrecks Sites ShipWrck Site No Destination no Site No 1/n 1

36 2005.09.12 - SLIDE 36IS 257 – Fall 2005 DiveShop ER Diagram Customer No ShipVia Dest Sites BioSite ShipVia ShipWrck BioLife DiveStok DiveItem DiveOrds DiveCust Customer No ShipVia Order No Order No Item No Item No Destination Name Destination Species No Site No Destination no Site No Destination no Species No Site No 1 1 1 1 1 1 1/n 1 1n n n n n n n n 1

37 2005.09.12 - SLIDE 37IS 257 – Fall 2005 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

38 2005.09.12 - SLIDE 38IS 257 – Fall 2005 What is Missing?? Not really an “enterprise-wide” database –No personnel Sales people Dive masters Boat captains and crew payroll –No Local arrangements Dive Boats –Charter bookings? Hotels? –Suppliers/Wholesalers for dive equipment Orders for new/replacement equipment –No history (only current or last order)

39 2005.09.12 - SLIDE 39IS 257 – Fall 2005 Lecture Outline Review (and continuation) –Database Design, Conceptual Model Object-Oriented Modeling Logical Design for the Diveshop database

40 2005.09.12 - SLIDE 40IS 257 – Fall 2005 Object-Oriented Modeling Becoming increasingly important as –Object-Oriented and Object-Relational DBMS continue to proliferate –Databases become more complex and have more complex relationships than are easily captured in ER or EER diagrams (Most UML examples based on McFadden, “Modern Database Management”, 5 th edition)

41 2005.09.12 - SLIDE 41IS 257 – Fall 2005 Object Benefits Encapsulate both data and behavior Object-oriented modeling methods can be used for both database design and process design –Real-World applications have more than just the data in the database they also involve the processes, calculations, etc performed on that data to get real tasks done –OOM can be used for more challenging and complex problems

42 2005.09.12 - SLIDE 42IS 257 – Fall 2005 Unified Modeling Language (UML) Combined three competing methods Can be used for graphically depicting –Software designs and interaction –Database –Processes

43 2005.09.12 - SLIDE 43IS 257 – Fall 2005 CLASS A class is a named description of a set of objects that share the same attributes, operations, relationships, and semantics. –An object is an instance of a class that encapsulates state and behavior. These objects can represent real-world things or conceptual things. –An attribute is a named property of a class that describes a range of values that instances of that class might hold. –An operation is a named specification of a service that can be requested from any of a class's objects to affect behavior in some way or to return a value without affecting behavior

44 2005.09.12 - SLIDE 44IS 257 – Fall 2005 UML Relationships An relationship is a connection between or among model elements. The UML defines four basic kinds of relationships: –Association –Dependency –Generalization –Realization

45 2005.09.12 - SLIDE 45IS 257 – Fall 2005 UML Diagrams The UML defines nine types of diagrams: –activity diagram –class diagram Describes the data and some behavioral (operations) of a system –collaboration diagram –component diagram –deployment diagram –object diagram –sequence diagram –statechart diagram –use case diagram

46 2005.09.12 - SLIDE 46IS 257 – Fall 2005 Class Diagrams A class diagram is a diagram that shows a set of classes, interfaces, and/or collaborations and the relationships among these elements.

47 2005.09.12 - SLIDE 47IS 257 – Fall 2005 UML Class Diagram DIVEORDS Order No Customer No Sale Date Shipvia PaymentMethod CCNumber No of People Depart Date Return Date Destination Vacation Cost CalcTotalInvoice() CalcEquipment() Class Name List of Attributes List of operations

48 2005.09.12 - SLIDE 48IS 257 – Fall 2005 Object Diagrams 307:DIVORDS Order No = 307 Customer No = 1480 Sale Date = 9/1/99 Ship Via = UPS PaymentMethod = Visa CCNumber = 12345 678 90 CCExpDate = 1/1/01 No of People = 2 Depart Date = 11/8/00 Return Date = 11/15/00 Destination = Fiji Vacation Cost = 10000

49 2005.09.12 - SLIDE 49IS 257 – Fall 2005 Differences from Entities in ER Entities can be represented by Class diagrams But Classes of objects also have additional operations associated with them

50 2005.09.12 - SLIDE 50IS 257 – Fall 2005 Operations Three basic types for database –Constructor –Query –Update

51 2005.09.12 - SLIDE 51IS 257 – Fall 2005 Associations An association is a relationship that describes a set of links between or among objects. An association can have a name that describes the nature of this relationship. You can put a triangle next to this name to indicate the direction in which the name should be read.

52 2005.09.12 - SLIDE 52IS 257 – Fall 2005 Associations An association contains an ordered list of association ends. –An association with exactly two association ends is called a binary association –An association with more than two ends is called an n-ary association.

53 2005.09.12 - SLIDE 53IS 257 – Fall 2005 Associations: Unary relationships Person Is-married-to 0..1 Employee manages * 0..1 manager

54 2005.09.12 - SLIDE 54IS 257 – Fall 2005 Associations: Binary Relationship Employee Parking Place One-to-one Is-assigned0..1 Product Line Product One-to-many contains1 * StudentCourse Many-to-many Registers-for* *

55 2005.09.12 - SLIDE 55IS 257 – Fall 2005 Associations: Ternary Relationships VendorWarehouse * * Supplies Part *

56 2005.09.12 - SLIDE 56IS 257 – Fall 2005 Association Classes StudentCourse Registers-for * * Registration ________________ Term Grade ________________ CheckEligibility() Computer Account _________________ acctID Password ServerSpace *0..1 issues

57 2005.09.12 - SLIDE 57IS 257 – Fall 2005 Derived Attributes, Associations, and Roles Student _________ name ssn dateOfBirth /age Course Offering ____________ term section time location Registers-for * 1 Course ____________ crseCode crseTitle creditHrs * * Scheduled-for {age = currentDate – dateOfBirth} * * /Takes /participant Derived attribute Derived role Derived association

58 2005.09.12 - SLIDE 58IS 257 – Fall 2005 Generalization Employee ____________ empName empNumber address dateHired ____________ printLabel() Hourly Employee _______________ HourlyRate _______________ computeWages() Salaried Employee _______________ Annual Sal stockoption _______________ Contributepension() Consultant _______________ contractNumber billingRate _______________ computeFees()

59 2005.09.12 - SLIDE 59IS 257 – Fall 2005 Other Diagramming methods SOM (Semantic Object Model) Object Definition Language (ODL) –Not really diagramming Access relationships display Hybrids

60 2005.09.12 - SLIDE 60IS 257 – Fall 2005 Application of SOM to Diveshop DIVECUST Address Street City StateProvince ZIPPostalCode Country Phone FirstContact Name DIVEORDS 1.1 1.N 1.1

61 2005.09.12 - SLIDE 61IS 257 – Fall 2005 DIVEORDS id OrderNo SaleDate SHIPVIA DESTINATION DIVEITEM PaymentMethod CCNumber CCExpDate NoOfPeople DepartDate ReturnDate VacationCost DIVECUST

62 2005.09.12 - SLIDE 62IS 257 – Fall 2005 Lecture Outline Review (and continuation) –Database Design, Conceptual Model Object-Oriented Modeling Logical Design for the Diveshop database

63 2005.09.12 - SLIDE 63IS 257 – Fall 2005 Database Design Process Conceptual Model Logical Model External Model Conceptual requirements Conceptual requirements Conceptual requirements Conceptual requirements Application 1 Application 2Application 3Application 4 Application 2 Application 3 Application 4 External Model External Model External Model Internal Model

64 2005.09.12 - SLIDE 64IS 257 – Fall 2005 DiveShop ER Diagram Customer No ShipVia Dest Sites BioSite ShipVia ShipWrck BioLife DiveStok DiveItem DiveOrds DiveCust Customer No ShipVia Order No Order No Item No Item No Destination Name Destination Species No Site No Destination no Site No Destination no Species No Site No 1 1 1 1 1 1 1/n 1 1n n n n n n n n 1

65 2005.09.12 - SLIDE 65IS 257 – Fall 2005 Logical Design: Mapping to a Relational Model Each entity in the ER Diagram becomes a relation. A properly normalized (next time) ER diagram will indicate where intersection relations for many-to-many mappings are needed. Relationships are indicated by common columns (or domains) in tables that are related. We will examine the tables for the Diveshop derived from the ER diagram

66 2005.09.12 - SLIDE 66IS 257 – Fall 2005 Customer = DIVECUST

67 2005.09.12 - SLIDE 67IS 257 – Fall 2005 Dive Order = DIVEORDS

68 2005.09.12 - SLIDE 68IS 257 – Fall 2005 Line item = DIVEITEM

69 2005.09.12 - SLIDE 69IS 257 – Fall 2005 Shipping information = SHIPVIA

70 2005.09.12 - SLIDE 70IS 257 – Fall 2005 Dive Equipment Stock= DIVESTOK

71 2005.09.12 - SLIDE 71IS 257 – Fall 2005 Dive Locations = DEST

72 2005.09.12 - SLIDE 72IS 257 – Fall 2005 Dive Sites = SITE

73 2005.09.12 - SLIDE 73IS 257 – Fall 2005 Sea Life = BIOLIFE

74 2005.09.12 - SLIDE 74IS 257 – Fall 2005 BIOSITE -- linking relation

75 2005.09.12 - SLIDE 75IS 257 – Fall 2005 Shipwrecks = SHIPWRK

76 2005.09.12 - SLIDE 76IS 257 – Fall 2005 Mapping to Other Models Hierarchical –Need to make decisions about access paths Network –Need to pre-specify all of the links and sets Object-Oriented –What are the objects, datatypes, their methods and the access points for them Object-Relational –Same as relational, but what new datatypes might be needed or useful (more on OR later)

77 2005.09.12 - SLIDE 77IS 257 – Fall 2005 Advantages of RDBMS Possible to design complex data storage and retrieval systems with ease (and without conventional programming). Support for ACID transactions –Atomic –Consistent –Independent –Durable

78 2005.09.12 - SLIDE 78IS 257 – Fall 2005 Advantages of RDBMS Support for very large databases Automatic optimization of searching (when possible) RDBMS have a simple view of the database that conforms to much of the data used in businesses. Standard query language (SQL)

79 2005.09.12 - SLIDE 79IS 257 – Fall 2005 Disadvantages of RDBMS Until recently, no real support for complex objects such as documents, video, images, spatial or time-series data. (ORDBMS add (or make available) support for these). Often poor support for storage of complex objects from OOP languages (Disassembling the car to park it in the garage) Still no efficient and effective integrated support for things like text searching within fields.

80 2005.09.12 - SLIDE 80IS 257 – Fall 2005 Next Time Normalization and the relational model Implementing DBs in Access


Download ppt "2005.09.12 - SLIDE 1IS 257 – Fall 2005 Database Design: Conceptual and Logical Model Design University of California, Berkeley School of Information Management."

Similar presentations


Ads by Google