You are on page 1of 50

1

Chapter 1
File Systems and Databases
Database Systems: Design, Implementation, and Management, 4th Edition

Peter Rob & Carlos Coronel

Introducing the Database

Major Database Concepts

Data and information


q q

Data - Raw facts Information - Processed data

x x x x

Data management Database Metadata Database management system (DBMS)

Sales per Employee for Each of ROBCORS Two Divisions

1
Figure 1.1

Introducing the Database


Importance of DBMS

It helps make data management more efficient and effective. Its query language allows quick answers to ad hoc queries. It provides end users better access to more and better-managed data. It promotes an integrated view of organizations operations -- big picture. It reduces the probability of inconsistent data.

The DBMS Manages the Interaction Between the End User and the Database

1
Figure 1.2

Introducing the Database


Why Database Design Is Important?

A well-designed database facilitates data management and becomes a valuable information generator. A poorly designed database is a breeding ground for uncontrolled data redundancies. A poorly designed database generates errors that lead to bad decisions.

Historical Roots
Why Study File Systems?

x x

It provides historical perspective. It teaches lessons to avoid pitfalls of data management. Its simple characteristics facilitate understanding of the design complexity of a database. It provides useful knowledge for converting a file system to a database system.

Contents of the CUSTOMER File

1
Figure 1.3

Table 1.1 Basic File Terminology


Data

Raw facts that have little meaning unless they have been organized in some logical manner. The smallest piece of data that can be recognized by the computer is a single character, such as the letter A, the number 5, or some symbol such as; ? > * +. A single character requires one byte of computer storage. A character or group of characters (alphabetic or numeric) that has a specific meaning. A field might define a telephone numbers, a birth date, a customer name, a year-to-date (YTD) sales value, and so on. A logically connected set of one or more fields that describes a person, place, or thing. For example, the fields that comprise a record for a customer named J. D. Rudd might consist of J. D. Rudds name, address, phone number, date of birth, credit limit, unpaid balance, and so on. A collection of related records. For example, a file might contain data about ROBCOR Companys vendors; or, a file might contain the records for the students currently enrolled at Gigantic University.

Field

Record

File

Contents of the AGENT File

1
Figure 1.4

A Simple File System

1
Figure 1.5

File System Critique


File System Data Management

File systems require extensive programming in a third-generation language (3GL). As the number of files expands, system administration becomes difficult. Making changes in existing file structures is important and difficult. Security features to safeguard data are difficult to program and usually omitted. Difficulty to pool data creates islands of information.

File System Critique


Structural and Data Dependence
x

Structural Dependence
A change in any files structure requires the modification of all programs using that file.

Data Dependence
A change in any files data characteristics requires changes in all data access programs.

Significance of data dependence is the difference between the data logical format and the data physical format. Data dependence makes file systems extremely cumbersome from a programming and data management point of view.

File System Critique


Field Definitions and Naming Conventions
x

A good (flexible) record definition anticipates reporting requirements by breaking up fields into their components.
q

Example: Customer Name Last Name, First Name, Initial Customer Address Street Address, City, State
CONTENTS Customer last name Customer first name Customer initial Customer area code Customer phone Customer street address or box number Customer city Customer state

FIELD CUS_LNAME CUS_FNAME CUS_INITIAL CUS_AREACODE CUS_PHONE CUS_ADDRESS CUS_CITY CUS_STATE

File System Critique


Field Definitions and Naming Conventions

Selecting proper field names is very important.


q

Names must be as descriptive as possible within restrictions. Naming must reflect designers documentation needs and users reporting and processing requirements.

File System Critique

Data Redundancy: Uncontrolled data redundancy sets the stage for


x x

Data Inconsistency (lack of data integrity) Data anomalies


q q q

Modification anomalies Insertion anomalies Deletion anomalies

Figure 1.6

The Database System Environment

1
Figure 1.7

Figure 1.7

Database Systems
The Database System Components

Hardware
q q

Computer Peripherals

Software
q q q

Operating systems software DBMS software Applications programs and utilities software

Database Systems
The Database System Components
x

1
x x

People
q q q q q

Systems administrators Database administrators (DBAs) Database designers Systems analysts and programmers End users Instructions and rules that govern the design and use of the database system

Procedures
q

Data
q

Collection of facts stored in the database

Database Systems
The Database System Components
x

1
x

The complexity of database systems depends on various organizational factors:


q q q q

Organizations size Organizations function Organizations corporate culture Organizational activities and environment

Database solutions must be cost effective AND strategically effective.

Database Systems
Types of Database Systems
x

1
x

Number of Users
q

Single-user
Desktop database

Multiuser
Workgroup database Enterprise database

Scope
q q q

Desktop Workgroup Enterprise

Database Systems
Types of Database Systems

Location
q q

Centralized Distributed

Use
q q q

Transactional (Production) Decision support Data warehouse

Database Systems
DBMS Functions

1. Data Dictionary Management 2. Data Storage Management 3. Data Transformation and Presentation 4. Security Management 5. Multi-User Access Control 6. Backup and Recovery Management 7. Data Integrity Management 8. Database Access Languages (DDL and DML) and Application Programming Interfaces 9. Database Communication Interfaces

Database Models

A database model is a collection of logical constructs used to represent the data structure and the data relationships found within the database. Two Categories of Database Models
x

Conceptual models focus on the logical nature of the data representation. They are concerned with what is represented rather than how it is represented. Implementation models place the emphasis on how the data are represented in the database or on how the data structures are implemented.

Database Models
Three Types of Relationships
x

One-to-many relationships (1:M)


q

A painter paints many different paintings, but each one of them is painted by only that painter.
PAINTER (1) paints PAINTING (M)

Many-to-many relationships (M:N)


q

An employee might learn many job skills, and each job skill might be learned by many employees.
EMPLOYEE (M) learns SKILL (N)

One-to-one relationships (1:1)


q

Each store is managed by a single employee and each store manager (employee) only manages a single store.
EMPLOYEE (1) manages STORE (1)

Database Models

Three Types of Implementation Database Models


x x x

Hierarchical database model Network database model Relational database model

A Hierarchical Structure

1
Figure 1.8

Database Models
Hierarchical Database Model

Basic Structure
q

Collection of records logically organized to conform to the upside-down tree (hierarchical) structure. The top layer is perceived as the parent of the segment directly beneath it. The segments below other segments are the children of the segment above them. A tree structure is represented as a hierarchical path on the computers storage media.

Database Models
Hierarchical Database Model
x

Advantages
q q q q q

1
x

Conceptual simplicity Database security Data independence Database integrity Efficiency dealing with a large database Complex implementation Difficult to manage Lacks structural independence Applications programming and use complexity Implementation limitations Lack of standards

Disadvantages
q q q q q q

Child with Multiple Parents

1
Figure 1.9

Database Models
Network Database Model

Basic Structure
q

Set -- A relationship is called a set. Each set is


composed of at least two record types: an owner (parent) record and a member (child) record.

A set is represents a 1:M relationship between the owner and the member.

A Network Database Model

1
Figure 1.10

Database Models
Network Database Model
x

1
x

Advantages
q q q q q q

Conceptual simplicity Handles more relationship types Data access flexibility Promotes database integrity Data independence Conformance to standards

Disadvantages
q q

System complexity Lack of structural independence

Database Models
Relational Database Model
x

Basic Structure
q

RDBMS allows operations in a human logical environment. The relational database is perceived as a collection of tables. Each table consists of a series of row/column intersections. Tables (or relations) are related to each other by sharing a common entity characteristic. The relationship type is often shown in a relational schema. A table yields complete data and structural independence.

Linking Relational Tables

1
Figure 1.11

Database Models
Relational Database Model
x

1
x

Advantages
q q q

q q

Structural independence Improved conceptual simplicity Easier database design, implementation, management, and use Ad hoc query capability (SQL) Powerful database management system

Disadvantages
q q q

Substantial hardware and system software overhead Possibility of poor design and implementation Potential islands of information problems

A Relational Schema

1
Figure 1.12

Database Models
Entity-Relationship Data Model

It is one of the most widely accepted graphical data modeling tools. It graphically represents data as entities and their relationships in a database structure. It complements the relational data model concepts.

Database Models
Entity Relationship Data Model
x

Basic Structure
q

q q

E-R models are normally represented in an entity relationship diagram (ERD). An entity is represented by a rectangle. Each entity is described by a set of attributes. An attribute describes a particular characteristics of the entity. A relationship is represented by a diamond connected to the related entities.

Figure 1.13 Relationship Depiction: The ERD

Figure 1.14

Relationship Depiction: The Crows Foot

Database Models
Entity-Relationship Data Model
x

1
x

Advantages
q q q q

Exceptional conceptual simplicity Visual representation Effective communication tool Integrated with the relational database model

Disadvantages
q q q q

Limited constraint representation Limited relationship representation No data manipulation language Loss of information content

Database Models
Object-Oriented Database Model
x

Characteristics
q q

An object is described by its factual content. An object includes information about relationships between the facts within the object, as well as with other objects. An object is a self-contained building block for autonomous structures.

Database Models
Object-Oriented Database Model

Basic Structure
q

Objects are abstractions of real-world entities or events. Attributes describe the properties of an object. Objects that share similar characteristics are grouped in classes. A class is a collection of similar objects with shared structure (attributes) and behavior (methods). Classes are organized in a class hierarchy. An object can inherit the attributes and methods of the classes above it.

q q

q q

A Comparison: The OO Data Model and the ER Model

1
Figure 1.15

Database Models
Object-Oriented Database Model

Advantages
q q q q

Add semantic content Visual presentation includes semantic content Database integrity Both structural and data independence

Disadvantages
q q q q

Lack of OODM standards Complex navigational data access Steep learning curve High system overhead slows transactions

The Development of Data Models

1
Figure 1.16

Wrap-Up: The Evolution of Data Models

Common characteristics required for data models:


x

A data model must show some degree of conceptual simplicity without compromising the semantic completeness. A data model must represent the real world as closely as possible. The representation of the real-world transformations (behavior) must be in compliance with the consistency and integrity characteristics of any data model.

Wrap-Up: The Evolution of Data Models


Database Models and the Internet

The use of the Internet as a prime business tool is shifting focus to database products that interface efficiently and easily with the Internet.
x

Successful Internet age databases are characterized by:


q q q q q q

Flexible, efficient, and secure Internet access. Support for complex data types and relationships. Seamless interfacing with multiple data sources and structures. Simplicity of the conceptual database model. An abundance of available database tools. A powerful DBMS to help make the DBAs job easier.

You might also like