Chap 012

  • Uploaded by: Daryl Ivan Hisola
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Chap 012 as PDF for free.

More details

  • Words: 2,085
  • Pages: 29
SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

C H A P T E R

12

Irwin/McGraw-Hill

DATABASE DESIGN

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Chapter 12

Whitten Bentley Dittman

Database Design & Modeling

• Compare and contrast conventional files and modern, relational databases. • Define and give examples of fields, records, files, and databases. • Describe a modern data architecture that includes files, operational databases, data warehouses, personal databases, and work group databases. • Compare the roles of systems analysts, data administrators, and database administrators as they relate to database and database design. • Describe the architecture of a database management system • Describe how a relational database implements entities, attributes, and relationships from a logical data model. • Transform a logical data model into a physical, relational database schema. • Generate SQL code to create the database structure in a schema.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Chapter Map

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Files versus Database

A file is a collection of similar records. A database is a collection of interrelated files (meaning that records in one file are physically related to records in another file).

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Files versus Database

Information System

File

File

Information System

Irwin/McGraw-Hill

File

File

Information System

Database (consolidated & integrated data from files)

Information System

Information System

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Pros and Cons of Conventional Files

Pros

Cons

• Easy to design because of their single-application focus • Excellent performance due to optimized organization for a single application

Irwin/McGraw-Hill

• Harder to adapt to sharing across applications • Harder to adapt to new requirements • Need to duplicate attributes in several files.

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Pros and Cons of Databases

Cons

Pros • Ability to share data across applications • Less, and controlled redundancy (total nonredundancy is not achievable) • Data independence from applications increases adaptability • Superior scalability

Irwin/McGraw-Hill

• Harder to adapt to sharing across applications • Harder to adapt to new requirements • Need to duplicate attributes in several files • Somewhat slower performance • Higher development costs • Greater data vulnerability

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Fields

A field is the physical implementation of a data attribute. They are the smallest unit of meaningful data. A primary key is a field whose values identify one and only one record in a file.

A descriptive field is any other (nonkey) field that stores business data.

A secondary key is an alternate identifier for a record. A foreign key is a pointer to a record in a different file.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Records

A record is a collection of fields arranged in a predefined format. – Fixed-length record structures – Variable-length record structures

A blocking factor is the number of logical records included in a single read or write operation (from the computer’s perspective).

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Files

A file is the set of all occurrences of a given record structure. A table is the relational database equivalent of a file. – Types • • • • • •

Master files Transaction files Document files Archival files Table lookup files Audit files

– File organization – File access

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Data Architecture

A business’s data architecture defines how that business will develop and use files and databases to store all of the organization’s data; the file and database technology to be used; and the administrative structure set up to manage the data resource. Data is stored in some combination of: – Conventional files – Operational databases (also called transactional databases) – Data warehouses • To support data mining

– Personal databases – Work group databases

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

A Modern Data Architecture Users and Programmers Information System File A legacy file-based information system Users and Programmers

(built in-house)

File

(built in-house)

Information System (built in-house)

Operational Database

End-User Tools Data Warehouse

File

Users and Programmers

End-User Applications

Personal DB

Users

File

(purchased)

Irwin/McGraw-Hill

(built in-house)

File

File

A legacy file-based information system

Information System

File

Operational Database

Information System (purchased)

Work-Group Database End-User Work Group

Users and Programmers

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Administrators

A data administrator is responsible for the data planning, definition, architecture, and management. One or more database administrators are responsible for the database technology, database design and construction, security, backup and recovery, and performance tuning.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Database Architecture

Database architecture refers to the database technology including the database engine, database utilities, CASE tools, and database development tools. A database management system (DBMS) is specialized software that is used to create, access, control, and manage the database. The core of the DBMS is a database engine. – A data definition language (DDL) is that part of the engine used to physically define tables, fields, and structural relationships. – A data manipulation language (DML) is that part of the engine used to create, read, update, and delete records in the database, and navigate between different files (tables) in the database.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Typical DBMS Architecture Systems Analysts and Database Designers

Irwin/McGraw-Hill

Application Programmers

End Users

Transaction Processing (TP) Monitor

PC DBMS and/or Query tools

DBMS Data Definition Language (DDL)

Proprietary Language and Tools

Data Manipulation Language (DML)

DATABASE ENGINE

METADATA

USER DATA

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Relational Databases

Relational databases implement stored data in a series of two-dimensional tables that are “related” to one another via foreign keys. – The physical data model is called a schema. – The DDL and DML for a relational database is called SQL (Structured Query Language). – Triggers are programs embedded within a table that are automatically invoked by updates to another table. – Stored procedures are programs embedded within a table that can be called from an application program.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Logical Data Model

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Physical Data Model (Relational Schema)

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Data Normalization (also see Chapter 8)

• An 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). • An logical entity (or physical table) is in second normal form if it is already in first normal form and if the values of all nonprimary key attributes are dependent on the full primary key. • An logical entity (or physical table) is in third normal form if it is already in second normal form and if the values of all nonprimary key attributes are not dependent on other nonprimary key attributes .

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Goals of Database Design

• 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.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Data and Database Models

An entity relationship diagram is the logical model of the data requirements. – Chapter 7

A database schema is the physical model or blueprint of the planned implementation of the logical model. – Also called a physical data model

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

SoundStage Logical Data Model

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Sample Physical Data Types Logical Data Type to be stored in field)

Physical Data Type Microsoft Access

Physical Data Type Microsoft SQL Server

Physicall Data Type Oracle

Fixed length character data (use for fields with relatively fixed length character data)

TEXT

CHAR (size) or character (size)

CHAR (size)

Variable length character data (use for fields that require character data but for which size varies greatly--such as ADDRESS)

TEXT

VARCHAR (max size) or character varying (max size)

VARCHAR (max size)

Very long character data (use for long descriptions and notes--usually no more than one such field per record)

MEMO

TEXT

LONG VARCHAR or LONG VARCHAR2

Integer number

NUMBER

INT (size) or integer or smallinteger or tinuinteger

INTEGER (size) or NUMBER (size)

Decimal number

NUMER

DECIMAL (size, decimal places) or NUMERIC (size, decimal places)

DECIMAL (size, decimal places) or NUMERIC (size, decimal places) or NUMBER

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Sample Physical Data Types (concluded)

Logical Data Type to be stored in field)

Physical Data Type Microsoft Access

Physical Data Type Microsoft SQL Server

Physicall Data Type Oracle

Financial Number

CURRENCY

MONEY

see decimal number

Date (with time)

DATE/TIME

DATETIME or SMALLDATETIME Depending on precision needed

DATE

Current time (use to store the data and time from the computer’s system clock)

not supported

TIMESTAMP

not supported

Yes or No; or True or False

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 new data types?

NO

YES

YES

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

SoundStage Physical Database Schema

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

A Method for Database Design

• • • • • • •

Review the logical data model. Create a table for each entity. Create fields for each attribute. Create an index for each primary and secondary key. Create an index for each subsetting criterion. Designate foreign keys for relationships. Define data types, sizes, null settings, domains, and defaults for each attribute. • Create or combine tables to implement supertype/ subtype structures. • Evaluate and specify referential integrity constraints.

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Database Integrity

• Key integrity • Domain integrity • Referential integrity A referential integrity error exists when a foreign key value in one table has no matching primary key value in the related table. – – – –

No restriction Delete: cascade Delete: restrict Delete: set null

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

SoundStage Referential Integrity Constraints

Irwin/McGraw-Hill

Copyright © 2000 The McGraw-Hill Companies. All Rights res

SYSTEMS ANALYSIS AND DESIGN METHODS 5th Edition

Whitten Bentley Dittman

Database Distribution and Replication

Data distribution analysis establishes which business locations need access to which logical data entities and attributes. – The analysis drives distribution decisions: • • • •

Irwin/McGraw-Hill

Centralization Horizontal distribution (also called partitioning) Vertical distribution (also called partitioning) Replication

Copyright © 2000 The McGraw-Hill Companies. All Rights res

Related Documents

Chap 012
May 2020 11
Chap 012
May 2020 6
Chap 012
June 2020 4
Chap 012
May 2020 3
Chap 012
November 2019 7
012
November 2019 32

More Documents from "Shawn McCastle"