Presentation is loading. Please wait.

Presentation is loading. Please wait.

11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,

Similar presentations


Presentation on theme: "11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,"— Presentation transcript:

1 11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer

2 Chapter 11 11-2 © Prentice Hall, 2004 Chapter Objectives Af ter studying this chapter you should be able to: – Design database fields. – Evaluate denormalization situations. – Design file organization structures. – Design object-relational features.

3 Chapter 11 11-3 © Prentice Hall, 2004

4 Chapter 11 11-4 © Prentice Hall, 2004 What Is Physical Database Design? The part of a database design that deals with efficiency considerations for access of data Processing speed, storage space, and data manipulation are key issues in physical database design

5 Chapter 11 11-5 © Prentice Hall, 2004 Sometimes, the analyst and the designer are the same person, Deliverables

6 Chapter 11 11-6 © Prentice Hall, 2004

7 Chapter 11 11-7 © Prentice Hall, 2004 What Is SQL? Structured Query Language The standard language for creating and using relational databases ANSI Standards – SQL-92 – most commonly available – SQL-99 – included object-relational features

8 Chapter 11 11-8 © Prentice Hall, 2004 Common SQL Commands CREATE TABLE – used to define table structures and link tables together SELECT – used to retrieve data using specified formats and selection criteria INSERT – used to add new rows to a table UPDATE – used to modify data in existing table rows DELETE – used to remove rows from tables

9 Chapter 11 11-9 © Prentice Hall, 2004 Example CREATE TABLE Statements Here, a table called DEPT is created, with one numeric and two text fields. The numeric field is the primary key.

10 Chapter 11 11-10 © Prentice Hall, 2004 SELECT The SELECT, and FROM clauses are required. All others are optional. WHERE is used very commonly.

11 Chapter 11 11-11 © Prentice Hall, 2004 Example SELECT Statements Select * from EMP where ENAME = ‘SMITH’; Select EMPNO, ENAME From EMP where JOB = ‘SALESMAN’ order by ENAME;

12 Chapter 11 11-12 © Prentice Hall, 2004 What Is a Join Query? A query in which the WHERE clause includes a match of primary key and foreign key values between tables that share a relationship Select EMPNO, ENAME, DNAME from EMP, DEPT where EMP.DEPT_NO = DEPT.DEPT_NO;

13 Chapter 11 11-13 © Prentice Hall, 2004 Example Data Manipulation Commands Insert into DEPT values (50, ‘DESIGN’, ‘MIAMI’); Update EMP set SAL = 3000 where EMPNO = 7698; Delete from EMP where EMPNO = 7844

14 Chapter 11 11-14 © Prentice Hall, 2004 Designing Fields Field – the smallest unit of named application data recognized by system software such as a DBMS Fields map roughly onto attributes in conceptual data models Field design involves consideration of identity, data types, sizes, and constraints

15 Chapter 11 11-15 © Prentice Hall, 2004

16 Chapter 11 11-16 © Prentice Hall, 2004 Mapping a composite attribute onto multiple fields with various data types

17 Chapter 11 11-17 © Prentice Hall, 2004 Creating and Using Composite Attribute Types

18 Chapter 11 11-18 © Prentice Hall, 2004 Data Integrity Controls Default Values – used if no explicit value is entered Format Controls – restricts data entry values in specific character positions Range Controls – forces values to be among an acceptable set of values Referential Integrity – forces foreign keys to align with primary keys Null Value Controls – determines whether fields can be empty of value

19 Chapter 11 11-19 © Prentice Hall, 2004

20 Chapter 11 11-20 © Prentice Hall, 2004 What Is Denormalization? The process of combining normalized relations into physical tables based on affinity of use of rows and fields, and on retrieval and update frequencies on the tables Results in better speed of access, but reduces data integrity and increases data redundancy

21 Chapter 11 11-21 © Prentice Hall, 2004 This will result in null values in several rows’ application data.

22 Chapter 11 11-22 © Prentice Hall, 2004

23 Chapter 11 11-23 © Prentice Hall, 2004 This will result in duplications of item descriptions in several rows of the CanSupplyDR table.

24 Chapter 11 11-24 © Prentice Hall, 2004 Duplicate regionManager data

25 Chapter 11 11-25 © Prentice Hall, 2004 What Is a File Organization? A technique for physically arranging the row objects of a file Main purpose of file organization is to optimize speed of data access and modification

26 Chapter 11 11-26 © Prentice Hall, 2004

27 Chapter 11 11-27 © Prentice Hall, 2004 Determining Table Scan Time A table scan is a complete read of the file block by block, regardless of the number of row objects in the answer to a query Block – a unit of data retrieval from secondary storage Blocking factor – the number of row objects that fit in one block

28 Chapter 11 11-28 © Prentice Hall, 2004 Determining Table Scan Time (Continued) Block read time is determined by seek, rotation and transfer. Average table scan time equals #rows in table divided by blocking factor multiplied by block read time

29 Chapter 11 11-29 © Prentice Hall, 2004 What Is a Heap? A file with no organization Requires full table scan for data retrieval Only use this for small, cacheable tables

30 Chapter 11 11-30 © Prentice Hall, 2004 What Is Hashing? A technique that uses an algorithm to convert a key value to a row address Useful for random access, but not for sequential access

31 Chapter 11 11-31 © Prentice Hall, 2004 What Is an Indexed File Organization? A storage structure involving indexes, which are key values and pointers to row addresses Indexed file organizations are structured to enable fast random and sequential access Index files are fast for queries, but require additional overhead for inserts, deletes, and updates

32 Chapter 11 11-32 © Prentice Hall, 2004 Random Access Processing Using B+ Tree Indexes Indexes are usually implemented as B+ trees These are balanced trees, which preserve a sequential ascending order of items as they are added.

33 Chapter 11 11-33 © Prentice Hall, 2004 Issues to Consider When Selecting a File Organization File size Frequency of data retrievals Frequency of updates Factors related to primary and foreign keys Factors related to non-key attributes

34 Chapter 11 11-34 © Prentice Hall, 2004

35 Chapter 11 11-35 © Prentice Hall, 2004 Recap Af ter studying this chapter we learned to: – Design database fields. – Evaluate denormalization situations. – Design file organization structures. – Design object-relational features.


Download ppt "11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,"

Similar presentations


Ads by Google