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

Slides:



Advertisements
Similar presentations
Introduction To SQL Lynnwood Brown President System Managers LLC Copyright System Managers LLC 2003 all rights reserved.
Advertisements

Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter Physical Database Design Methodology Software & Hardware Mapping Logical Design to DBMS Physical Implementation Security Implementation Monitoring.
Introduction to Structured Query Language (SQL)
IS 4420 Database Fundamentals Chapter 6: Physical Database Design and Performance Leon Chen.
Chapter 11 Data Management Layer Design
Modern Systems Analysis and Design Third Edition
Structured Query Language Chapter Three (Excerpts) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Structured Query Language Chapter Three DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
SQL's Data Definition Language (DDL) – View, Sequence, Index.
10-1 Chapter 10 Designing Databases Modern Systems Analysis and Design Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Chapter 6 Physical Database Design. Introduction The purpose of physical database design is to translate the logical description of data into the technical.
Introduction to DBMS and SQL Introduction to DBMS and SQL GUIDED BY : MR. YOGESH SAROJ (PGT-CS) MR. YOGESH SAROJ (PGT-CS) Presented By : JAYA XII –COM.
1 C omputer information systems Design Instructor: Mr. Ahmed Al Astal IGGC1202 College Requirement University Of Palestine.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
ASP.NET Programming with C# and SQL Server First Edition
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 2 Slide 1 Chapter 10 Designing Databases.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Concepts and Terminology Introduction to Database.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Introduction to SQL.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 UNIT 6: Chapter 7: Introduction to SQL Modern Database Management 9 th Edition Jeffrey A.
Lecture 12 Designing Databases 12.1 COSC4406: Software Engineering.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
1 © Prentice Hall, 2002 Chapter 6: Physical Database Design and Performance Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Unit 6 Data Storage Design. Key Concepts 1. Database overview 2. SQL review 3. Designing fields 4. Denormalization 5. File organization 6. Object-relational.
Object Persistence (Data Base) Design Chapter 13.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
1 Information Retrieval and Use (IRU) CE An Introduction To SQL Part 1.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
An Introduction To SQL Part 2 (Special thanks to Geoff Leese)
1 Information Retrieval and Use (IRU) An Introduction To SQL Part 2.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Essentials of Systems Analysis and Design Fourth Edition Joseph S. Valacich Joey F.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 9 Designing Databases.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Session 1 Module 1: Introduction to Data Integrity
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
CS 111 – Nov. 8 Databases Database Management Systems (DBMS) Structured Query Language (SQL) Commitment –Please review sections 9.1 – 9.2.
© 2002 by Prentice Hall 1 Structured Query Language David M. Kroenke Database Concepts 1e Chapter 3 3.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 12 Designing.
CSC314 DAY 8 Introduction to SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SQL OVERVIEW  Structured Query Language  The.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Chapter 4 Logical Database Design and the Relational Model
Modern Systems Analysis and Design Third Edition
Database Systems Instructor Name: Lecture-12.
CHAPTER 5: PHYSICAL DATABASE DESIGN AND PERFORMANCE
Chapter 9 Designing Databases
Chapter 9 Designing Databases
Chapter 12 Designing Databases
Chapter 10 Designing Databases
Chapter 9 Designing Databases
Presentation transcript:

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

Chapter Objectives Af ter studying this chapter you should be able to: – Understand the purpose of SQL – Design database fields. – Evaluate denormalization situations. – Design file organization structures. – Design object-relational features.

What Is Physical Database Design? The part of a database design that deals with data integrity, efficiency, referential integrity, data access and security for the access of data Processing speed, storage space, and data manipulation are key issues in physical database design

What Is SQL? Structured Query Language Often pronounced “sequel” The standard language for creating and using relational databases ANSI Standards –SQL-92 – most commonly available –SQL-99 – included object-relational features

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

Example CREATE TABLE Statement Create Table DEPT ( deptno number(2) not null, deptnamevarchar2(14), locationvarchar2(13), constraint DEPT_PK primary key (deptno) ) Here, a table called DEPT is created, with a numeric primary key (deptno) and two text fields (deptname and location).

Example INSERT Statement This statement inserts a new row into the DEPT table: DEPTNO value is 50 DNAME value is “DESIGN” LOCATION value is “MIAMI”

The SELECT Statement SELECT,, *, … FROM,,, … WHERE, and/or … GROUP BY,, … HAVING and/or … ORDER BY, … The SELECT, and FROM clauses are required. All others are optional.

2 tables The EMP table The DEPT table

SELECT Statement Example 1 – Simple SELECT select * from DEPT Result: All fields of all rows in the DEPT table

SELECT Statement Example 2 – with a filter select * from EMP where ENAME = ‘SMITH’ Result: All fields for employee “Smith”

SELECT Statement Example 3 – only 2 cols, and a sort select EMPNO, ENAME from EMP where JOB = ‘SALESMAN’ order by ENAME Result: employee number, name and job for only salesmen from the EMP table, sorted by name

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 A join could also happen between the values of a unique index of one table and a foreign key of another A join could also be on 2 columns that share the same values, and are not keys (although the join operation would be very inefficient)

SELECT Statement Example 4 – Joining 2 tables select EMPNO, ENAME, DNAME from EMP, DEPT where EMP.dept_no = DEPT.dept_no and DEPT.LOC = ‘CHICAGO’; Result: All employees’ number and name (from the EMP table, and their associated department names, obtained by joining the tables based on DEPT_NO. Only employees housed in department located in Chicago will be included

SELECT Statement Example 4 (continue) Join queries almost always involve matching the primary key of the dominant (parent) table with the foreign key of the dependent (child) table.

What Is an Aggregation Query? A query results in summary information about a group of records, such as sums, counts, or averages These involve using aggregate functions in the SELECT clause such as (SUM, AVG, COUNT, MIN and MAX) Aggregations can be grouped using the GROUP BY clause and can/or can be filtered using the HAVING clause

SELECT Statement Example 5 – Using Aggregation select JOB, AVG(SALARY) from EMP group by JOB Select the job category and average salary of employees in the EMP table. Group (sub-total) the result for each JOB category

SELECT Statement Example 6 – Filter after Aggregation select JOB, AVG(SALARY) from EMP group by JOB having AVG(SALARY) >= 3000; Only jobs with average salaries exceeding $3000 will be displayed Using Having instead of Where

SELECT Statement Example 6 (continue) Note that job categories CLERK and SALESMAN were not included, because the average salaries for these jobs are below $3000.

Example Data Manipulation UPDATE EMP set SAL = 3000 where EMPNO = 7698; –Modifies the existing employee’s 7698 salary DELETE from EMP where EMPNO = 7844 –Removes employee 7844 from the EMP table

Designing Fields Field – the smallest unit of named data element recognized by system software such as a DBMS Fields map roughly onto attributes in the conceptual data model Field design involves consideration of identity, data types, sizes, and constraints

A codification scheme recognized by the software for representing types of data Data Types

Considerations for Choosing Data Types Balance these four objectives: 1. Minimize storage space 2. Represent all possible values of the field 3. Improve data integrity for the field 4. Support all data manipulations desired for the field (e.g. mathematical, text)

Data Integrity Controls Null Value Controls – determines whether fields can be left empty Default Values – specifies values for fields if no explicit values are entered Range Controls – forces values to be among an acceptable set of values Format Controls – restricts data entry values in specific character positions

Data Integrity Controls (cont) Referential Integrity – forces foreign keys to align with primary keys (or other unique indexes) Unique Control – forces each value within the column to be unique Indexing – forces the column to be indexed for faster retrieval

Referential integrity is important for ensuring that data relationships are accurate and consistent Referential Integrity Ensures that no value in the cust_order (customer_id) field exists without a corresponding value in customer table.

What Is Denormalization? The process of combining columns from various normalized tables into a combined table based on usage and retrieval frequencies Results in better speed of access for SELECT However, reduces data integrity and increases data redundancy

This will result in null values for all students who have not applied for a scholarship Example of 1:1 Denormalization

This will result in Duplicate regionManager data Example of 1:N Denormalization

Example of M:N Denormalization

If I combine both Item and CanSupply into CanSupplyDR, this will result in duplication of item descriptions (We’re assuming that an item can be supplied by many different vendors) Example of Denormalization

What Is a File Organization? A technique for physically organizing the data in a DBMS. It includes determining tablespace sizes, index sizes, the placement of tables and indexes, etc. Main purpose of file organization which is a DBA function, is to optimize speed of data access and modification

What Is Hashing? A technique that uses an algorithm to convert a key value to an memory address Useful for random access, but not for sequential access (e.g. using a phone number) Best suited for densely populated data

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

Best suited for randomly balanced data. Random Access Using a B-Tree Organization

Which Fields should be Indexed? Primary Keys are always indexed Yes No Number of rows in the object Number small?

Design of Object Relational Features Object-relational databases support creation of custom data types. (available in recent releases of DBMS) – Composite attributes – Multi-valued attributes – Generalization and inheritance – Aggregation/Composition relationships

Allows you to map a composite attribute onto a custom data type Composite Attributes Person_Type is a composite data type, and so is Name_Type and Address_Type Table Employee uses the composite data type

Composite Attributes in Oracle 11g Creating Using

Composite Attributes in Oracle 11g (Continue) Create table employee ( empid number, emp person_type ); Insert into employee values (123, person_type( name_type(‘Sultan’, ‘Sam’, ‘E’), addr_type(‘123 main street’, ‘New York’, ‘NY’, ‘12345’), ‘01-May-1984’, ‘ ’) ); Select e.empid, e.emp.name.lastname, e.emp.name.firstname, e.emp.address.street, e.emp.address.city, e.emp.birthdate from employee e

Multivalued Attributes in Oracle 11g create type PH_AR as varray(10) of varchar2(15); create table CONTACT ( contactNo number, name varchar2(50), phones PH_AR ); insert into CONTACT values (53, ‘Sam Sultan’, PH_AR(‘ ’, ‘ ’) ); select t1.contactNo, t1.name, t2.column_value from CONTACT t1, table(phones) t2; Use the array Create an array

Generalization in Oracle 11g create type EMP_TYPE as object ( empNonumber, empNamevarchar2(50), empAddrvarchar2(100) ) not final; create type HOURLY_TYPE under EMP_TYPE ( hourlyRatenumber ) ; create table HR_EMPLOYEE of HOURLY_TYPE; insert into HR_EMPLOYEE values (100, ‘Sam Sultan’, ‘123 Main St’, 24.50); Create a type as an object Create a subtype Use the subtype Allow for subtype

Aggregation/Composition in Oracle 11g create cluster ORDER_CLUSTER ( orderNonumber ) ; create table ORDER_TABLE ( orderNonumber, orderDatedate ) cluster order_cluster (orderNo); create table ORDER_LINE_TABLE ( orderNonumber, productNovarchar2(10), pricenumber, quantitynumber ) cluster order_cluster (orderNo); create index ord_idx on cluster order_cluster; Request a common cluster Index the cluster Create a cluster

Recap Af ter studying this chapter we learned to: – The purpose and usage of SQL – Design database fields. – Evaluate denormalization situations. – Design file organization structures. – Design object-relational features.