Presentation is loading. Please wait.

Presentation is loading. Please wait.

Principles of Database Design, Conclusions MBAA 609 R. Nakatsu.

Similar presentations


Presentation on theme: "Principles of Database Design, Conclusions MBAA 609 R. Nakatsu."— Presentation transcript:

1 Principles of Database Design, Conclusions MBAA 609 R. Nakatsu

2 Principles of Database Design Normalization is a process that assigns attributes (fields) to tables such that data redundancies are eliminated or reduced. Four Rules of Thumb: 1. Single Themes: Break up a large table into separate themes, or subjects. 2. Field Uniqueness: Each field in a table should represent a unique type of information (e.g., break up complex fields, and eliminate repeating groups).

3 Principles of Normalization, Continued 3. Primary Keys: Each table must have a unique identifier, or primary key, that is made up of one or more fields in the table. 4. Field Independence: You must be able to make a change to the data in any field (other than a field in the primary key) without affecting the data in any other field.

4 Rule 4: Field Independence Employee (Employee Number, Last Name, First Name, Job Class, Hourly Rate) In this example, Hourly Rate is dependent on Job Class. Employee NumberLast NameFirst NameJob ClassHourly Rate 11SmithJohnMechanic20 12JonesSusanTechnician18 13McKayBobMechanic20 14OwensPaulaClerk15 ChangSteveMechanic20 16SarandonSarahMechanic20

5 Solution: Create Two Tables Employee (Employee Number, Last Name, First Name, Job Class ID) Job Class ID is the link to the Job Class table. Employee NumberLast NameFirst NameJob Class ID 11SmithJohn2 12JonesSusan3 13McKayBob2 14OwensPaula1 15ChangSteve2 16SarandonSarah2

6 Job Class (Job Class ID, Job Class, Hourly Rate) There are no more field dependencies!

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

8 Ways to Maintain Data Integrity n Entity Integrity (primary key must be unique and must not be null) n Referential Integrity (see previous slide) n Field types (e.g., text, numeric, date, yes/no) n Input masks (e.g., ISBN number, dates) n Field validation rules (What are some examples?) n Good design of input screens (user interfaces) n Check digits

9 User Interface Design © 2000 Prentice Hall

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.

11 Concurrency Control Concurrency control is the management of concurrent transaction execution. Why is it important? The simultaneous execution of transactions over a shared database may create several data- integrity and consistency problems.

12 Lost Updates: An Example Note that the first transaction has not been permanently recorded when the second transaction is executed.

13 Concurrency Control with Locking A lock guarantees exclusive use of a data item to a current transaction. In the previous example, transaction T2 will not have access to the data item that is currently used by transaction T1. The lock is released when the transaction T1 is completed.

14 Data Warehouse n support OLAP (online analytical processing) n support data mining (data in a data warehouse are analyzed to reveal hidden patterns and trends in historical business activity) stores data that have been extracted from the various operational, external, and other databases of an organization Data warehouses...

15 Data Warehouse

16 Recap n Why do we need a database? n What is a database? n What are the main functions of a DBMS? n Entity-Relationship Modeling n Linking two tables: 1:1, 1:M, and M:N n Four principles of database design n Data Integrity n Concurrency Control n Data Warehouses


Download ppt "Principles of Database Design, Conclusions MBAA 609 R. Nakatsu."

Similar presentations


Ads by Google