Unit 6 Data Storage Design. Key Concepts 1. Database overview 2. SQL review 3. Designing fields 4. Denormalization 5. File organization 6. Object-relational.

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.
9/26/2000SIMS 257: Database Management Physical Database Design University of California, Berkeley School of Information Management and Systems SIMS 257:
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
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.
Data Storage Formats Files Databases
Physical Database Monitoring and Tuning the Operational System.
Chapter 11 Data Management Layer Design
Modern Systems Analysis and Design Third Edition
Introduction to Structured Query Language (SQL)
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
10-1 Chapter 10 Designing Databases Modern Systems Analysis and Design Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
Database Technical Session By: Prof. Adarsh Patel.
© 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.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 7 SQL HUANG XUEHUA. SQL SQL server2005 introduction Install components  management studio.
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.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
Using Special Operators (LIKE and IN)
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.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
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.
Database Management COP4540, SCS, FIU Physical Database Design (ch. 16 & ch. 3)
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Session 2: SQL (A): Parts 1 and 2 Original materials supplied by the Oracle Academic Initiative (OAI). Edited for classroom use by Professor Laku Chidambaram.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Data Types Lesson 4. Skills Matrix Table A table stores your data. Tables are relational in that they are organized as rows and columns (a matrix). Each.
SQL Server 2005 Implementation and Maintenance Chapter 3: Tables and Views.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Sql DDL queries CS 260 Database Systems.
IMS 4212: Data Modeling—Attributes and Domains 1 Dr. Lawrence West, Management Dept., University of Central Florida Attributes and Domains.
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.
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
SQL: Structured Query Language It enables to create and operate on relational databases, which are sets of related information stored in tables. It is.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 12 Designing.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Chapter 6 - Database Implementation and Use
Modern Systems Analysis and Design Third Edition
CHAPTER 5: PHYSICAL DATABASE DESIGN AND PERFORMANCE
ORACLE SQL Developer & SQLPLUS Statements
Chapter 9 Designing Databases
Chapter 12 Designing Databases
Chapter 10 Designing Databases
The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited)
Presentation transcript:

Unit 6 Data Storage Design

Key Concepts 1. Database overview 2. SQL review 3. Designing fields 4. Denormalization 5. File organization 6. Object-relational database features

What Is Physical Database Design? The part of a database design that deals with efficiency considerations for access of data Key issues include: Processing speed Storage space Data manipulation and data access patterns

Sometimes, the analyst and the designer are the same person, Deliverables

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 used to create databases and database objects. examples: CREATE TABLE CREATE DATABASE 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 Here, a table called DEPT is created, with one numeric and two text fields. The numeric field is the primary key.

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

SELECT The SELECT, and FROM clauses are required. All others are optional. WHERE is used very commonly.

SELECT Statement: Example 1 Result: all fields of all rows in the DEPT table Select * from DEPT;

SELECT Statement: Example 2 Result: all fields for employee “Smith” Select * from EMP where ENAME = 'SMITH';

SELECT Statement: Example 3 Result: employee number, name and job for only salesmen from the EMP table, sorted by name Select EMPNO, ENAME From EMP where JOB = 'SALESMAN' order by ENAME;

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 Statement: Example 4 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 EMPNO, ENAME, DNAME from EMP, DEPT where EMP.DEPT_NO = DEPT.DEPT_NO and DEPT.LOC = 'CHICAGO';

SELECT Statement: Example 4 (cont.) Join queries almost always involve matching the primary key of the dominant table with the foreign key of the dependent 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 aggregate functions in the SELECT clause (SUM, AVG, COUNT) Aggregations can be filtered using the HAVING clause and/or grouped using the GROUP BY clause

SELECT Statement: Example 5 The job name and average salary for each job of employees in the EMP table. Only jobs with average salaries exceeding $3000 will be included Select JOB, Avg(SALARY) from EMP Group by JOB Having Avg(SALARY) >= 3000;

SELECT Statement: Example 5 (cont.) Note that clerks and salesmen are not included, because the average salaries for these jobs are below $3000.

Example Data Manipulation Modifies the existing employee’s (7698) salary Removes employee 7844 from the EMP table Update EMP set SAL = 3000 where EMPNO = 7698; Delete from EMP where EMPNO = 7844

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 When designing fields, consider: identity data types sizes constraints

Data type – A coding scheme recognized by system software for representing organizational data

SQL Server Data Types Storage typeData types date and time valuessmalldatetime, datetime integralbit, tinyint, smallint, int, bigint non-whole numbersdecimal, numeric, money, smallmoney, float, real characters and stringschar, varchar, text Unicode characters and strings nchar, nvarchar, ntext Binary stringsbinary, varbinary, image Othercursor, sql_variant, table, timestamp, uniqueidentifier, xml

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

Mapping a composite attribute onto multiple fields with various data types

Creating and Using Composite Attribute Types

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

Referential integrity is important for ensuring that data relationships are accurate and consistent

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

This will result in null values in several rows’ application data.

This will result in duplications of item descriptions in several rows of the CanSupplyDR table.

Duplicate regionManager data

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

11-35

Secondary Storage Concepts Block a unit of data retrieval from secondary storage Extent a set of contiguous blocks Scan a complete read of a file block by block Blocking factor the number of row objects that fit in one block

Determining Table Scan Time Block read time is determined by seek, rotation and transfer. Average_table_scan_time = (#rows/blocking_factor) * block_ read_time

What Is a Heap? A file with no organization Requires full table scan for data retrieval Only use this for small, cacheable tables

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

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

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.

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

Which Fields should be Indexed?

Design of Object Relational Features Object-relatonal databases support: Generalization and inheritance Aggregation Multivalued attributes Object identifiers Relationships by reference (pointers)

Generalization in Oracle 9i/10g

Aggregation in Oracle 9i/10g

Multivalued Attributes in Oracle 9i/10g

Object Identifiers in Oracle 9i/10g

SQL Server Object-Relational Features SQL Server 2005SQL Server 2008 Common Language Runtime (CLR) integration Spatial and geographic data types.NET Language Integrated Query (LINQ) Object-Relational Designer