49
Essentials of Database Design

Database Design

  • Upload
    learnt

  • View
    190

  • Download
    0

Embed Size (px)

Citation preview

Essentials of Database Design

Database Design

It can be used to describe many different

parts of the design of an overall database

system

Principally, and most correctly, it can be

thought of as the logical design of the

base data structures used to store the

data

Database Design In the relational model these are the tables and

views. In an object database the entities andrelationships map directly to object classes andnamed relationships

However, the term database design could also beused to apply to the overall process of designing,not just the base data structures, but also theforms and queries used as part of the overalldatabase application within the databasemanagement system

Database Design

The process of doing database design

generally consists of a number of steps which

will be carried out by the database designer.

Usually, the designer must:

Determine the relationships between the different

data elements

Overlay a logical structure upon the data on the

basis of these relationships

ER Diagram (Entity Relationship Diagram)

Database designs also include ER (entity-relationship model) diagrams

An ER diagram is a diagram that helps todesign databases in an efficient way

Attributes in ER diagrams are usually modeledas an oval with the name of the attribute, linkedto the entity or relationship that contains theattribute

ER Diagram (Entity Relationship Diagram)

Database designs also include ER (entity-relationship model) diagrams

An ER diagram is a diagram that helps todesign databases in an efficient way

Attributes in ER diagrams are usually modeledas an oval with the name of the attribute, linkedto the entity or relationship that contains theattribute

A Sample Entity-relationship Diagram

Database design process

1. Determine the purpose of the database -

This helps prepare for the remaining

steps

2. Find and organize the information

required - Gather all of the types of

information to record in the database, such

as product name and order number

Database design process

3. Divide the information into tables - Divideinformation items into major entities or subjects,such as Products or Orders. Each subject thenbecomes a table

4. Turn information items into columns - Decidewhat information needs to be stored in eachtable. Each item becomes a field, and isdisplayed as a column in the table. Forexample, an Employees table might includefields such as Last Name and Hire Date

Database design process

5. Specify primary keys - Choose each table’s

primary key. The primary key is a column, or a

set of columns, that is used to uniquely identify

each row. An example might be Product ID or

Order ID.

6. Set up the table relationships - Look at each

table and decide how the data in one table is

related to the data in other tables. Add fields to

tables or create new tables to clarify the

relationships, as necessary.

Primary Key and table

relationship in a database

Database design process

7.Refine the design - Analyze the design for

errors. Create tables and add a few records

of sample data. Check if results come from

the tables as expected. Make adjustments

to the design, as needed.

8. Apply the normalization rules - Apply the

data normalization rules to see if tables are

structured correctly. Make adjustments to

the tables

Designing Inputs, Outputs and Control

Input Integrity ControlsUse with all input mechanism from specific

electronic device to standard keyboard inputs

Additional level of verification that helps reduceerrors on input data

For example a system need a certain amount ofinformation for a valid entry, but an input devicecannot ensure that all the necessary fields havebeen entered

An additional level of verification, which will call acontrol is necessary to check for completeness

Common input control techniquesError Detection and Elimination

Field Combination Control. Verifies data in

one field based on data in another field or

fields

Value limit Control. Identify when a value in a

field is too large or too small

Completeness Control. Ensures all necessary

fields in an input form have been entered

Data validation Control. Validate the input data

for correctness and appropriateness

Common input control techniquesTransaction Logging

A technique by which any update to the

database is logged with audit information

such as user ID, date, time, input data, and

type of update

So that it can trace any errors or problems

that occur. The more advanced database

systems- such as those that run on servers,

workstations, and mainframes

Common Input Control techniquesTransaction Logging

It has 2 main objective:

Helps discourage fraudulent transactions, If personknows that every transaction is logged, then thatperson is less apt to attempt a fraudulenttransaction

Provide recovery mechanism for erroneoustransaction, more sophisticated systems canprovide a “before” and “after” image of he fieldthat are change by the transaction, as well as audittrail of all transactions. Typically used only forhighly sensitive or critical data files, but they dorepresent an important control mechanism that isavailable when necessary

Output Integrity Control

Output from a system comes in various

forms such as output that is used by

other systems, printed reports, and

data output on computer screens.

The main purpose of it is to ensure

that output arrives at the proper

destination and is correct,

accurate, current, and complete.

Destination Control

Ensure that output information is channeled to the

correct person

Systems with good controls printed

destination and routing information on a

report cover page along with the report

Today ,business accomplish the same

function of a control desk by placing

printers in each of the locations that need

printed reports

Completeness, Accuracy and Correctness Control

This are the main function primarily of the

internal processing of the system rather than

any set of controls

To ensure this, printing of control fields on

the output report

Every report must have a date and time

stamp, both for the time the report was

printed and the date of the report is

reprinted due to previous error

Completeness, Accuracy and Correctness Control

The following items are controls that should

be printed on reports:Date and time of report printing

Date and time of data on the report

Time period covered by the report

Beginning header with report identification and

description

Destination of routing information

Pagination in the form “page-of-”

Control totals and cross footings

“End of Report” trailer

Report version number and version date

Design of System Inputs

When designing inputs for the

system, the system developer

must perform four tasks:

o Identify the devices and mechanisms

that will be used to enter inputs

o Identify all system inputs and develop a

list with data content of each

o Design and prototype the electronic

forms(the window the user works with)

and other inputs

Design of System Inputs

Identifying Device MechanismOften when analysts begin developing a system,

they assume that all input will be entered via

electronic, graphical forms because they are now

so common on a personal computers and

workstations

All data must be error-free, it must be validated;

avoid reentering the information as much as

possible avoid human involvement

Identifying device mechanism

Devices that allow data captured without

human keystroking:

Magnetic Card strip readers

Bar Code readers

Optical-character recognition reader and

scanner

Touch screens and devices

Electronic pens and writing surfaces

Digitizers, such as digital cameras and

digital audio devices

Developing list of Inputs and data requirement

Provides check of the quality of analysis

models

It also identify the flows that cross the

system boundary

Analysis Model: Structured approach and

Object Oriented Approach

Developing list of Inputs and data requirement

Structured Approach

The first task is to define the automation

boundary

The point is not all processing done with

computer, However, the input data flows

crossing the boundary are clearly defined,

so the required inputs will be the new order

information data flow

DFD showing automation boundary

Developing list of Inputs and data requirement

Object Oriented Approach

Sequence diagrams identify each incoming

message, and the Design class diagrams

contain the pseudocode to verify the

characteristic of the input

Developing list of Inputs and data requirement

Object Oriented Approach

Sequence diagram

Developing list of Inputs and data requirement

Object Oriented Approach

Design class diagrams

Designing and Prototyping Input Forms

Good design principles dictate that the

paper form and its electronic

counterpart should have the same

general layout and sequence of data

fields

In other words, this will be use to

enter the information into the system

Designing of System Outputs

Determining type of output

Making list of specific reports

based on the application design

Designing and prototyping reports

Designing of System OutputsDetermining Type of OutputDetailed Report

Carry out the day-to-day processing of thebusiness, contain detailed information about thetransaction

Summary Report

Recaps or summarize detailed information overa period of time or some category

Exception Report

A Report that contains only information aboutnonstandard, conditions

Executive Report

A report use for information resources that isnormally used for strategic decisions

Designing of System OutputsMaking list of specific report

oThe objective is to ensure that each of

the required outputs from the system is

specified correctly

oWhereas the data content of the input

forms must support the needs of the

database, the data content of the

outputs must support the information

requirements of the report users.

Designing of System OutputsDesigning and Prototyping Reportso Key principles during design of output reports:

What is the objective of the report? Who is the

intended audience?

o Designer must decide on the level of detail and

format of the report, they can decide if they know

the objective of the report

o Labels and headings should be used to ensure the

correct interpretation of the report data and

make sure that every report must have a

meaningful title to indicate data content.

Output Design Objectives

Output is information delivered to users through

information system by the ways of networks

Some data require extensive processing before they

become suitable output

Output can take many forms; Traditional hard copy

of printed reports and soft copy such as computer

screens, microforms and audio output

To create most useful output possible, system

analyst works closely with the user through an

interactive process until the result is considered to

be satisfactory

6 Objectives for Output Design

Designing output to serve a specific purpose

Making output meaningful to the user

Delivering the appropriate quantity of output

Providing appropriate output distribution

Providing output on time

Choosing the most effective output method

Objectives for Output design

Designing output to serve a specific purpose

o Output is designed based on the

purpose that the system analyst find

out during information requirement

determination phase of analysis

Objectives for Output design

Designing output to fit the usero It is more practical to create user-specific or user-

customizable output when designing for a decision

support system or highly interactive applications

such as those mounted on the web

o On the basis of interview, observation, cost

considerations and perhaps prototypes, it will be

possible to design output that addresses what

many, if not all, users need and prefer.

Objectives for Output design

Delivering appropriate Quantity of Output

o More is not always better, especially where the

amount of output is concerned. Part of the task of

designing output is deciding what quantity of

output is correct from users

o The Problem with information overload is so

prevalent as to have become a cliché, but it

remains a valid concern

o No one is served if excess information is given

only to flaunt the capabilities of the system

Objectives for Output design

Making sure the output is where it is needed

o Output is often produced at one location(for

example, in the data-processing department)

and then distributed to the user

o Appropriate distribution is still an important

objective for the system analyst, to be used

and useful, output must be presented to the

right user

Objectives for Output design

Providing output on timeo Many reports are required on a daily basis,

some only monthly, other annually, and others

only by exception

o Using well-publicized Web-based output can

alleviate some problems with the timing of

output distribution as well. Accurate timing of

output can be critical to business operation

Objectives for Output design

Choosing the right output method

o Output can come in many forms,

with the movement to online

systems, much output now appears

on display screen, and users have

the option of printing it out with

their own printer.

Output Technologies

Printer

Advantages: Affordable in most organization

Flexible in time, location, and capabilities

Handles large volume of outputs

Reaches many inexpensively

Highly reliable with little down time

Disadvantages: May be noisy, Compatibility problems

with computer software, May require special,

expensive supplies, Still requires operator intervention,

Depending on model, may be slow

Output Technologies

Display Screen

Advantages: Interactive, Works online, real-

time transmission, Quiet, Takes advantage of

computer capabilities for movement within

databases and files, Good for frequently

accessed

Disadvantages: Require cabling and setup space, Still

may require printed documentation, Can be expensive

if required for many users

Output Technologies

Audio Output

Advantages: Good for individual user, Transient

message, worker needs hands free, output is

highly relative

Disadvantages: Expensive to develop, needs dedicated

room where output will not interfere with other tasks,

has limited application

Output Technologies

DVD, CD-ROM, and CD-RW

Advantages: Has large capacity, Allow

multimedia output, has speedy retrieval, less

vulnerable to damage

Disadvantages: Expensive to develop, more difficult to

use on a network

Output Technologies

Electronic Output (email, faxes, and web pages)

Advantages: Reduces paper, can be updated

very easily, Eliminates “telephone tag”, can be

“broadcast”, can be more interactive

Disadvantages: Has generally lower resolution, Not

conducive to formatting, difficult to convey context of

messages (email), Web sites need diligent maintenance

Factors to considered

when choosing output technology1. Who will use the output(requisite quality)?

2. How many people need the output?

3. Where is the output needed (distribution/ logistics)?

4. What is the purpose of output?

5. What is the speed with which output is needed?

6. How frequently will the output be accessed?

7. How long will(or must) the output be stored?

8. Under what special regulation is the output produced, stored, and

distributed?

9. What are the initial and ongoing costs of maintenance supplies?

10. What are the environmental requirements (noise absorption, controlled

temperature, space for equipment, and cabling) for output technologies?