Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology.

Similar presentations


Presentation on theme: "1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology."— Presentation transcript:

1 1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology

2 2 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Objectives u Discuss the general process and goals of database design u Define user views and explain their function u Define database design language and use it to document database designs u Create an entity-relationship diagram to visually represent a database design u Present a methodology for database design at the information level and view examples illustrating this methodology

3 3 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Objectives u Explain the physical-level design process u Examine some alternative approaches to entity-relationship diagrams u Discuss top-down and bottom-up approaches to database design and examine the advantages and disadvantages of both methods u Use a survey form to obtain information from users prior to beginning the database design process

4 4 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Objectives u Review existing documents to obtain information from users prior to beginning the database design process u Discuss special issues related to implementing one-to-one relationships and many-to-many relationships involving more than two entities u Discuss entity subtypes and their relationships to nulls u Learn how to avoid potential problems when merging third normal form relations

5 5 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Database Design u User Views l Requirements necessary to support a particular user’s operations u Information-level Design Methodology l Represent user view as collection of tables l Normalize these tables l Identify all keys l Merge the result into design

6 6 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Represent User View as Collection of Tables Step 1: Determine entities involved and create separate table for each type Step 2: Determine primary key for each table Step 3: Determine properties for each entities Step 4: Determine relationships among entities

7 7 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Normalize the Tables u Represent all keys l Primary, alternate, secondary, foreign u Database Design Language (DBDL) l Mechanism for representing tables and keys

8 8 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski DBDL Notation u Table name followed by columns in parentheses l Primary key column(s) underlined u AK identifies alternate keys u SK identifies secondary keys u FK identifies foreign keys

9 9 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Entity-Relationship Diagrams Figure 6.2

10 10 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Merge the Result into the Design Figure 6.3

11 11 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski User View Examples View #1: Sales Rep View Rep (RepNum, LastName, FirstName, Street, City, State, Zip, Commission, Rate)

12 12 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski User View Examples (con’t.) Figure 6.5 View #2: Customer View

13 13 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski User View Examples (con’t.) Figure 6.6 View #3: Part View

14 14 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski User View Examples (con’t.) Figure 6.8 View #4: Order View

15 15 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Second Set User View Examples View #1: Publisher View Publisher (PublisherCode, PublisherName, City) SK PublisherName

16 16 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Second Set User View Examples (con’t.) View #2: Branch View Publisher (PublisherCode, PublisherName, City) SK PublisherName Branch (BranchNum, BranchName, BranchLocation, NumEmployees) SK BranchName

17 17 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Second Set User View Examples (con’t.) Figure 6.11 View #3: Book View

18 18 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Second Set User View Examples (con’t.) Figure 6.12 View #4: Author View

19 19 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Second Set User View Examples (con’t.) Figure 6.13 View #5 and View #6: Inventory View

20 20 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Physical-Level Design u Undertaken after information-level design completion u Most DBMSs support primary, candidate, secondary, and foreign keys u DB programmers must include logic to ensure the uniqueness of primary keys and enforce other conditions

21 21 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski ERD Relationship Alternative Figure 6.14

22 22 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Symbols for Columns Figure 6.15

23 23 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Composite Entity Figure 6.16

24 24 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Crow’s Foot Symbol Figure 6.17

25 25 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Representing Cardinality Figure 6.18

26 26 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Top-Down vs. Bottom-Up u Bottom-up l Design starts at low level l Specific user requirements drive design process u Top-down l Begins with general database that models overall enterprise l Refines the model until design is achieved

27 27 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Survey Form u Used to collect information from users u Must contain particular elements l Entity information l Attribute information l Relationships l Functional dependencies l Processing information

28 28 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Existing Documents u Aid in collecting user requirements u Collect information similar to that collected with survey forms l Entity information l Attribute information l Relationships l Functional dependencies l Processing information

29 29 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure 6.25 Include primary key of each table as foreign key in the other

30 30 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure 6.26 Implementation when information does not match.

31 31 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure 6.27 Implemented in a single table.

32 32 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski 1:1 Relationship Considerations Figure 6.28 1:1 relationship implemented by including primary key of one table as foreign key (and alternative key) in the other.

33 33 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski M:M Relationship Considerations Figure 6.29 Sample Sales Data

34 34 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski M:M Relationship Considerations Figure 6.30 Result obtained by splitting Sales table into three tables

35 35 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski M:M Relationship Considerations Figure 6.31 Result obtained by joining three tables--2 rows are in error. Must be converted to 4NF.

36 36 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Table Split to Avoid Nulls Figure 6.32 Nulls are absence of values

37 37 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Entity Subtypes Figure 6.34

38 38 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Student Table Split to Avoid Nulls Figure 6.36

39 39 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Two Entity Subtypes— Incomplete Categories Figure 6.37

40 40 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Two Entity Subtypes— Complete Categories Figure 6.38


Download ppt "1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology."

Similar presentations


Ads by Google