Conventional Files versus the Database. Files versus Database. Pros and Cons of Conventional Files. Pros and Cons of Databases. Fields (continued)



Similar documents
How To Create A Table In Sql (Ahem)

SQL Server An Overview

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design


Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

Using SQL Server Management Studio

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

Chapter 13 File and Database Systems

Chapter 13 File and Database Systems

IT2305 Database Systems I (Compulsory)

IT2304: Database Systems 1 (DBS 1)

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

4. The Third Stage In Designing A Database Is When We Analyze Our Tables More Closely And Create A Between Tables

MS ACCESS DATABASE DATA TYPES

Instant SQL Programming

CSC 443 Data Base Management Systems. Basic SQL

Fundamentals of Database Design

ISM 318: Database Systems. Objectives. Database. Dr. Hamid R. Nemati

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Oracle Database 10g Express

Foundations of Business Intelligence: Databases and Information Management

BCA. Database Management System

4 Simple Database Features

SQL. Short introduction

Introduction to Databases

10. Creating and Maintaining Geographic Databases. Learning objectives. Keywords and concepts. Overview. Definitions

- Suresh Khanal. Microsoft Excel Short Questions and Answers 1

Chapter 1: Introduction

Chapter 6 FOUNDATIONS OF BUSINESS INTELLIGENCE: DATABASES AND INFORMATION MANAGEMENT Learning Objectives

Introduction This document s purpose is to define Microsoft SQL server database design standards.

7. Databases and Database Management Systems

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

DBMS / Business Intelligence, SQL Server

Chapter 1: Introduction. Database Management System (DBMS) University Database Example

Foundations of Business Intelligence: Databases and Information Management

Database Query 1: SQL Basics

Developing Microsoft SQL Server Databases 20464C; 5 Days

4 Logical Design : RDM Schema Definition with SQL / DDL

Part A: Data Definition Language (DDL) Schema and Catalog CREAT TABLE. Referential Triggered Actions. CSC 742 Database Management Systems

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design

20464C: Developing Microsoft SQL Server Databases

Databases with Microsoft Access. Using Access to create Databases Jan-Feb 2003

Guide to Upsizing from Access to SQL Server

Databases What the Specification Says

Course MIS. Foundations of Business Intelligence

Database Migration from MySQL to RDM Server

LearnFromGuru Polish your knowledge

Performance Tuning for the Teradata Database

Topics. Database Essential Concepts. What s s a Good Database System? Using Database Software. Using Database Software. Types of Database Programs

1. INTRODUCTION TO RDBMS

ETL Process in Data Warehouse. G.Lakshmi Priya & Razia Sultana.A Assistant Professor/IT

CHAPTER 2 DATABASE MANAGEMENT SYSTEM AND SECURITY

Oracle Database 10g: Introduction to SQL

Course 20464: Developing Microsoft SQL Server Databases

MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/-

SQL Server. 1. What is RDBMS?

Geodatabase Programming with SQL

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Oracle Architecture, Concepts & Facilities

Foundations of Business Intelligence: Databases and Information Management

Database as a Service (DaaS) Version 1.02

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals

ETL PROCESS IN DATA WAREHOUSE

Chapter 3. Database Environment - Objectives. Multi-user DBMS Architectures. Teleprocessing. File-Server

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Database Database Management System (DBMS)

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Introduction to Microsoft Jet SQL

Utility Software II lab 1 Jacek Wiślicki, jacenty@kis.p.lodz.pl original material by Hubert Kołodziejski

A McKnight Associates, Inc. White Paper: Effective Data Warehouse Organizational Roles and Responsibilities

Physical Data Organization

Oracle SQL. Course Summary. Duration. Objectives

ETL Overview. Extract, Transform, Load (ETL) Refreshment Workflow. The ETL Process. General ETL issues. MS Integration Services

Oracle Database: Introduction to SQL

Database System Concepts

Foreign and Primary Keys in RDM Embedded SQL: Efficiently Implemented Using the Network Model

Chapter 1: Introduction. Database Management System (DBMS)

Foundations of Business Intelligence: Databases and Information Management

Developing Microsoft SQL Server Databases

A Brief Introduction to MySQL

Oracle Database 12c: Introduction to SQL Ed 1.1

Basic Concepts of Database Systems

Oracle Database: Introduction to SQL

Database Design and Programming

1 File Processing Systems

CERULIUM TERADATA COURSE CATALOG

ORACLE DATABASE 11G: COMPLETE

TIM 50 - Business Information Systems

Objectives. Distributed Databases and Client/Server Architecture. Distributed Database. Data Fragmentation

SQL, PL/SQL FALL Semester 2013

Table and field properties Tables and fields also have properties that you can set to control their characteristics or behavior.

Linas Virbalas Continuent, Inc.

Files. Files. Files. Files. Files. File Organisation. What s it all about? What s in a file?

Programming with SQL

Introduction to Triggers using SQL

Transcription:

Conventional Files versus the Database Files versus Database File a collection of similar records. Files are unrelated to each other except in the code of an application program. Data storage is built around the applications that use the files. 14-1 Database a collection of interrelated files Records in one file (or table) are physically related to records in another file (or table). Applications are built around the integrated database 14-2 14-3 Pros and Cons of Conventional Files Pros Easy to design because of their single-application focus Excellent performance due to optimized organization for a single application Cons Harder to adapt to sharing across applications Harder to adapt to new requirements Need to duplicate attributes in several files. 14-4 Pros and Cons of Databases Pros Data independence from applications increases adaptability and flexibility Superior scalability Ability to share data across applications Less, and controlled redundancy (total non-redundancy is not achievable) Cons More complex than file technology Somewhat slower performance Investment in DBMS and database experts Need to adhere to design principles to realize benefits Increased vulnerability due to consolidating in a centralized database Fields Fields (continued) Field the smallest unit of meaningful data to be stored in a database the physical implementation of a data attribute Primary key a field that uniquely identifies a record. Secondary key a field that identifies a single record or a subset of related records. Foreign key a field that points to records in a different file. Descriptive field any nonkey field. 14-5 14-6 Chapter 14 Database Design 1

Records Record a collection of fields arranged in a predetermined format. Fixed-length record structures Variable-length length record structures Blocking factor the number of logical records included in a single read or write operation (from the computer s perspective). Files and Tables File the set of all occurrences of a given record structure. Table the relational l database equivalent of a file. 14-7 14-8 14-9 Types of conventional files and tables Master files Records relatively permanent though values may change Transaction files Records describe business events Document files Historical data for review without overhead of regenerating document Archival files Master and transaction records that have been deleted Table lookup files Relatively static data that can be shared to maintain consistency Audit files Special records of updates to other files 14-10 File and Table Design Older file design methods required analyst to specify precisely how records should be: Sequenced (File organization) Accessed (File access) Database technology usually predetermines and/or limits this Trained database administrator may be given some control over organization, storage location, and access methods for performance tuning. Data Architecture Data Architecture (continued) 14-11 Data architecture a definition of how: Files and databases are to be developed and used to store data The file and/or database technology to be used The administrative structure set up to manage the data resource 14-12 Data is stored in some combination of: Conventional files Operational databases databases that support day-to-day operations and transactions for an information system. Also called transactional databases. Data warehouses databases that store data extracted from operational databases. To support data mining Personal databases Work group databases Chapter 14 Database Design 2

A Modern Data Architecture Administrators Data administrator a database specialist responsible for data planning, definition, architecture, and management. Database administrator a specialist responsible for database technology, database design,construction, security, backup and recovery, and performance tuning. A database administrator will administer one or more databases 14-13 14-14 Database Architecture Typical DBMS Architecture Database architecture the database technology used to support data architecture Including the database engine, database utilities, CASE tools, and database development tools. 14-15 Database management system (DBMS) special software used to create, access, control, and manage a database. The core of the DBMS is its database engine. A data definition language (DDL) is used to physically define tables, fields, and structural relationships. A data manipulation language (DML) is used to create, read, update, and delete records in database and navigate between records. 14-16 Relational Databases From Logical Data Model 14-17 Relational database a database that implements stored data in a series of twodimensional tables that are related to one another via foreign keys. The physical ldata model lis called a schema. The DDL and DML for a relational database is called SQL (Structured Query Language). Triggers programs embedded within a database that are automatically invoked by updates. Stored procedures programs embedded within a database that can be called from an application program. 14-18 Chapter 14 Database Design 3

To Physical Data Model (Relational Schema) User Interface for a Relational PC DBMS 14-19 14-20 What is a Good Data Model? Database Normalization (also see Chapter 8) A good data model is simple The data attributes that describe an entity should describe only that entity A logical entity (or physical table) is in first normal form if there are no attributes (fields) that can have more than one value for a single instance (record). 14-21 A good data model is essentially nonredundant Each data attribute exists in at most one entity (except for foreign keys) A good data model should be flexible and adaptable to future needs These goals are achieved through database normalization. 14-22 A logical entity (or physical table) is in second normal form if it is in first normal form and if the values of all nonprimary key attributes are dependent on the full primary key. A logical entity (or physical table) is in third normal form if it is in second normal form and if the values of all nonprimary key attributes are not dependent on other nonprimary key attributes. Conventional File Design Goals of Database Design 14-23 Output and input designs typically completed first Fundamental entities from data model designed as master or transaction records Master files are typically fixed-length records Associative entities from data model are joined into transaction records as variable-length records File access and organization selected Sequential Indexed Hashed ISAM/VSAM 14-24 A database should provide for efficient storage, update, and retrieval of data. A database should be reliable the stored data should have high integrity and promote user trust in that data. A database should be adaptable and scalable to new and unforeseen requirements and applications. A database should support the business requirements of the information system. Chapter 14 Database Design 4

Logical data Model in Third Normal Form Database Schema Database schema a model or blueprint representing the technical implementation of the database. Also called a physical data model 14-25 14-26 14-27 A Method for Database Design 1. Review the logical data model. 2. Create a table for each entity. 3. Create fields for each attribute. 4. Create index for each primary & secondary key. 5. Create index for each subsetting criterion. 6. Designate foreign keys for relationships. 7. Define data types, sizes, null settings, domains, and defaults for each attribute. 8. Create or combine tables to implement supertype/subtype structures. 9. Evaluate/specify referential integrity constraints. 14-28 Database Integrity Key integrity Every table should have a primary key. Domain integrity Appropriate controls must be designed to ensure that no field takes on an inappropriate value Referential integrity the assurance that a foreign key value in one table has a matching primary key value in the related table. No restriction Delete: cascade Delete: restrict Delete: set null Data Types for Different Database Technologies Logical Data Type to be stored in field) Fixed length character data (use for fields with relatively fixed length character data) Variable length character data (use for fields that require character data but for which size varies greatly--such as ADDRESS) Very long character data (use for long descriptions and notes--usually no more than one such field per record) 14-29 MS Access MS SQL Server TEXT CHAR (size) or character (size) TEXT VARCHAR (max size) or character varying (max size) Oracle CHAR (size) VARCHAR (max size) MEMO TEXT LONG VARCHAR or LONG VARCHAR2 Data Types for Different Database Technologies (cont.) Logical Data Type to be stored in field) MS Access MS SQL Server Oracle Integer number NUMBER INT (size) or INTEGER (size) or integer or NUMBER (size) smallinteger or tinuinteger Decimal number NUMBER DECIMAL (size, decimal places) or DECIMAL (size, decimal places) or NUMERIC (size, decimal places) NUMERIC (size, decimal places) or NUMBER Financial Number CURRENCY MONEY see decimal number Date (with time) DATE/TIME DATETIME or DATE SMALLDATETIME Depending on precision needed Current time (use to store the data and time from the computer s 14-30 system clock) not supported TIMESTAMP not supported Chapter 14 Database Design 5

Data Types for Different Database Technologies (cont.) Logical Data Type to be stored in field) Yes or No; or True or False MS Access MS SQL Server Oracle YES/NO BIT use CHAR(1) and set a yes or no domain Image OLE OBJECT IMAGE LONGRAW Hyperlink HYPERLINK VARBINARY RAW Can designer define NO YES YES new data types? Database Distribution and Replication Data distribution analysis establishes which business locations need access to which logical data entities and attributes. 14-31 14-32 14-33 Database Distribution and Replication (continued) Centralization Entire database on a single server in one physical location Horizontal distribution (also called partitioning) Tables or row assigned to different database servers/locations. Efficient access and security Cannot always be easily recombined for management analysis Vertical distribution (also called partitioning) Specific table columns assigned to specific databases/servers Similar advantages and disadvantages of Horizontal Replication Data duplicated in multiple locations DBMS coordinates updates and synchronization Performance and accessibility advantages Increases complexity 14-34 Database Capacity Planning For each table sum the field sizes. This is the record size. For each table, multiply the record size times the number of entity instances to be included in the table (planning for growth). This is the table size. Sum the table sizes. This is the database size. Optionally, add a slack capacity buffer (e.g. 10percent) to account for unanticipated factors. This is the anticipated database capacity. SQL DDL Code CREATE TABLE [dbo].[classcodes] ( [ClassID] [Integer] Identity(1,1) NOT NULL, [DepartmentCodeID] [varchar] (3) NOT NULL, [SectionCodeID] [varchar] (2) NOT NULL, [ClassCodeID] [varchar] (5) NOT NULL, [GroupCodeID] [varchar] (1) NOT NULL, [ClassDescription] [varchar] (50) NOT NULL, [ValidOnLine] bit NULL, ) ON [PRIMARY] GO [LastUpdated] [smalldatetime] NULL Alter Table [dbo].[classcodes] Add Constraint pk_classcodes Primary Key (ClassID) Alter Table [dbo].[classcodes] Add Constraint df_classcodes_groupcodeid Default 'A' for GroupCodeID Alter Table [dbo].[classcodes] Add Constraint fk_classcodes_sectioncodes Foreign Key (DepartmentCodeID,SectionCodeID) References SectionCodes(DepartmentCodeID,SectionCodeID) Alter Table [dbo].[classcodes] Add Constraint un_classcodes_dept_section_class 14-35 Unique (DepartmentCodeID,SectionCodeID,ClassCodeID) GO Chapter 14 Database Design 6