Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Application Design and Data Integrity AIMS 3710 R. Nakatsu.

Similar presentations


Presentation on theme: "Database Application Design and Data Integrity AIMS 3710 R. Nakatsu."— Presentation transcript:

1 Database Application Design and Data Integrity AIMS 3710 R. Nakatsu

2 E-R Diagram © 2000 Prentice Hall

3 Relational Design Page 240 © 2000 Prentice Hall

4 Relational Design (w/ Surrogate Keys) Page 240 © 2000 Prentice Hall

5 Relational Diagram Page 241 © 2000 Prentice Hall

6 Chaptr 10 View “A structured list of data items (attributes) from the entities defined in the ER model” A view can be materialized or formatted as a form or report

7 View Materialization © 2000 Prentice Hall

8 Chaptr 10 Sample View Two Paths: (1) Customer to Transactions, and (2) Customer to Artist Interests Customer.name Customer.AreaCode Customer.LocalNumber Transaction.PurchaseDate Transaction.SalesPrice Work.Title Artist.Name Customer_Artist_Int. ArtistID Artist.Name

9 Chaptr 10 Database Systems, 9th Edition 9 Design Case #1: Maintaining History of Time-Variant Data Normally, existing attribute values are replaced with new value without regard to previous value Time-variant data: –Values change over time –Must keep a history of data changes Must create a M:N relationship between the two entities Intersection table contains date of change

10 Chaptr 10 Database Systems, 9th Edition 10

11 Chaptr 10 Database Systems, 9th Edition 11

12 Chaptr 10 Database Systems, 9th Edition 12 Design Case #2: Fan Traps A Fan trap occurs when one entity is the parent in two or more 1:M relationships to other entities There is no way to join the related entities together.

13 Chaptr 10 Database Systems, 9th Edition 13

14 Chaptr 10 Database Systems, 9th Edition 14

15 Chaptr 10 Database Systems, 9th Edition 15 Design Case #3: Redundant Relationships Redundancy is seldom a good thing in database environment Occurs when there are multiple relationship paths between related entities Some designs use redundant relationships to simplify the design

16 Chaptr 10 Form A screen display used for data entry and edit. Forms should... reflect the view structure make data associations graphically clear encourage appropriate action

17 Chaptr 10 Structuring Information Navigability: Information should be designed so that it is easy to navigate through. Grouping: Data on the screen should be grouped and ordered into meaningful parts.

18 Chaptr 10 Recognition vs. Recall One of the most well-established findings in memory research is that we can recognize material far more easily than we can recall it from memory. Designing interfaces using this fact: We want to reduce the amount of information users are required to recall in favor of requiring them to recognize the information.

19 Chaptr 10 GUI controls used in Forms Option buttons in groups Check boxes Drop-down lists: –List Boxes –Combo Boxes

20 Chaptr 10 Report Design Reports should... reflect the structure of the underlying view follow many of the same design principles used for forms. It is useful to break your data into meaningful groups and calculate summary statistics (where appropriate).

21 Chaptr 10 Integrity of a Database It is important that the data in a database is correct and consistent. Data integrity problems can occur due to: incorrect data entry data redundancy poor database design

22 Chaptr 10 Ways to Maintain Data Integrity: A Summary Enforcing domain constraints Enforcing uniqueness Enforcing relationship constraints Enforcing business rule constraints Check digits

23 Domain Definitions Page 204 © 2000 Prentice Hall

24 Chaptr 10 Domain Constraints Field types (text, numeric, date, memo, etc.) Field size Field validation rules Lookup fields (i.e., drop-down lists) Input masks (e.g., SSN, phone#) Required field? (are nulls allowed?)

25 Chaptr 10 Uniqueness This constraint enforces uniqueness (duplicates not allowed) on an attribute. Specify a primary key to enforce Entity Integrity (A primary key must have a unique value and null values are not allowed). Set Indexed property to Yes (No duplicates) on fields that are not primary keys.

26 Chaptr 10 Relationship Constraints Enforce referential integrity (foreign key must either have a null or matching entry to related table) For 1:1 relationships, foreign key must be unique Enforce cardinality constraints through the application code (1,1) cardinalities on the child side of 1:M relationships are enforced by making the foreign key a required field.

27 Chaptr 10 Business Rule Constraints These constraints are particular to the logic and requirements of a given application. They arise from procedures and policies that exist in the organization.

28 Chaptr 10 Check Digit Example Add a check digit to validate a clerk’s data entry. The check digit is determined by some mathematical algorithm. Example: Multiply the first digit by 2; multiply the second digit by 3; multiply the third by 4; add the results; divide by 10 and take the remainder. 127 yields (1*2 + 2*3 + 7*4) / 10 = 36 / 10 for a check digit of 6.


Download ppt "Database Application Design and Data Integrity AIMS 3710 R. Nakatsu."

Similar presentations


Ads by Google