ISM 318: Database Systems Objectives Database

advertisement

Intro to

Databases

File Systems and

Databases ISM 318:

Database Systems

Dr. Hamid R. Nemati

Department of Information Systems and

Operations Management

Bryan School of Business and Economics

Intro to

Databases

File Systems and

Databases

Objectives

4 Understand the basics of data and databases

4 Understand characteristics of a file system

4 Understand advantages of using a database

4 Understand characteristics of database systems

4

Understand basic database concepts

4 Understand three different types of database models

Intro to

Databases

File Systems and

Databases

Database l A conceptual data model.

l It is used by the decision maker to recall the needed information.

l It specifies the entities about which the database contains data.

l It provides a description of the way in which these entities are related.

Data, information, and knowledge

Intro to

Databases

File Systems and

Databases l Data u Raw, unsummarized, and unanalyzed facts l Information u Data processed into a meaningful form u One person's information can be another's data l Knowledge u Knowing what information is required u Knowing what the information means

Intro to

Databases

File Systems and

Databases

Hierarchy of Data

Data

Field

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

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

Rudd’s name, address, phone number, date of birth, credit limit, unpaid balance, and so on.

File A collection of related records. For example, a file might contain data about ROBCOR Company’s vendors; or, a file might contain the records for the students currently enrolled at

Gigantic University.

Hierarchy of Data

Intro to

Databases

File Systems and

Databases

Database

Project database

Database File

Personal File

Database File

Department File

Database File

Payroll File

Record 1 Record 2 Record 3

Field 1 Field 2

Intro to

Databases

File Systems and

Databases

Database Managers l File Processing Systems (FPS) u Is used when working with a SINGLE database file l Database Management Systems (DBMS) u A collection of interrelated data and a collection of programs that provide access to the data.

u The primary goal of a DBMS is to provide an environment which is both convenient and efficient to use in retrieving information from and storing information into the database.

Intro to

Databases

File Systems and

Databases

Contrasting Database and

File System Designs

Intro to

Databases

File Systems and

Databases

Functions of DBMS l Storage and Retrieval of data l Processing data l Generation of reports and forms l

Issues to consider when dealing with DBMS u Data Redundancy u Data Inconsistency u Data Dependency u Data Integrity u Data Security

Intro to

Databases

File Systems and

Databases

Introducing the Database l Importance of DBMS u It helps make data management more efficient and effective.

u Its query language allows quick answers to ad hoc queries.

u It provides end users better access to more and better-managed data.

u It promotes an integrated view of organization’s operations -- “big picture”.

u It reduces the probability of inconsistent data.

Intro to

Databases

File Systems and

Databases

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

Intro to

Databases

File Systems and

Databases

File System Critique l File System Data Management u File systems require extensive programming in 3GL.

u As file systems become more complex, managing files gets more difficult.

u Making changes in existing file structures is important and difficult.

u Data access programs are subject to change with file structure changes (structural dependence).

u Security features are difficult to implement and are lacking.

Intro to

Databases

File Systems and

Databases

File System Critique l Structural and Data Dependence u Structural Dependence

A change in any file’s structure requires the modification of all programs using that file.

u Data Dependence

A change in any file’s data characteristics requires changes of all data access programs.

u Data dependence makes file systems extremely cumbersome from a programming and data management point of view.

Intro to

Databases

File Systems and

Databases

File System Critique l Field Definitions and Naming Conventions u A good (flexible) record definition anticipates reporting requirements by breaking up fields into their components.

l Example: v Customer Name î Last Name, First Name, Initial v Customer Address î Street Address, City, State u Selecting proper field names is very important.

l

Descriptive l

Self-documenting

Intro to

Databases

File Systems and

Databases

File System Critique l Data Redundancy:

Uncontrolled data redundancy sets the stage for u Data Inconsistency (lack of data integrity) u Data anomalies l Modification anomalies l

Insertion anomalies l Deletion anomalies

Intro to

Databases

File Systems and

Databases

Database Systems l In a database system, logically related data are stored in a single data repository.

l The database represents a change in the way end user data are stored, accessed, and managed.

l DBMS makes it easier to eliminate most of the file system’s data inconsistency, data anomalies, and data structural dependency problems.

l Current DBMS stores not only the data structure, but also the relationships.

l DBMS takes care of defining all the required access paths.

Intro to

Databases

File Systems and

Databases

Database Systems Environment

Intro to

Databases

File Systems and

Databases

Database Systems l The Database System Components u Hardware l Computer l

Peripherals u Software l

Operating systems software l DBMS software l Applications programs and utilities software

Intro to

Databases

File Systems and

Databases

Database Systems l The Database System Components u People l

Systems administrators l Database administrators l Database designers l

Systems analysts and programmers l End users u Procedures l Instructions and rules that govern the design and use of the database system u Data l

Collection of facts stored in the database

Intro to

Databases

File Systems and

Databases

Database Systems l Database Systems and Organizational Factors u The complexity of database systems depends on various organizational factors: l Organization’s size l Organization’s function l Organization’s corporate culture l

Organizational activities and environment u Database solutions must be cost effective and strategically effective.

Intro to

Databases

File Systems and

Databases

Database Systems l Types of Database Systems u Number of Users l Single-user l

Multi-user u Scope l

Desktop l Workgroup l Enterprise

Intro to

Databases

File Systems and

Databases

Database Systems l Types of Database Systems u Location l

Centralized l Distributed u Use l Transactional (Production) l Decision support l Data warehouse

Intro to

Databases

File Systems and

Databases

Database Systems l DBMS Functions u Data Dictionary Management l

Data dictionary stores definitions of the data elements and their relationships (metadata).

l It provides data abstraction and removes structural and data dependency from the system.

u Data Storage Management l DBMS creates data storage structure and relieves us from the task of defining and programming physical data characteristics.

Intro to

Databases

File Systems and

Databases

Database Systems l DBMS Functions u Data Transformation and Management l DBMS relieves us from the chore of making distinction between logical format and physical format of data.

u Security Management l

DBMS provides user security and data privacy within the database.

l

Data security is especially important in multi-user database.

Intro to

Databases

File Systems and

Databases

Database Systems l DBMS Functions u Multi-User Access Control l

DBMS ensures that multiple users can access the database concurrently and still guarantees the integrity of the database.

u Backup and Recovery Management l

DBMS provides backup and recovery procedures to ensure data safety and integrity.

u Data Integrity Management l DBMS promotes and enforces integrity rules to eliminate data integrity problems.

l Ensuring data integrity is especially important in transaction-oriented database systems.

Intro to

Databases

File Systems and

Databases

Introducing the Database l Why Database Design Is Important?

u A poorly designed database is a breeding ground for uncontrolled data redundancies.

u A poorly designed database generates errors that lead to bad decisions.

l A Practical Approach to Database Design u Focus on principles and concepts of practical database design u Use of two complete applications through the logical design stage

Intro to

Databases

File Systems and

Databases

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

l Two Categories of Database Models u Conceptual models focus on the logical nature of the data representation. They are concerned with what is represented rather than how it is represented.

u Implementation models place the emphasis on how the data are represented in the database or on how the data structures are implemented.

Intro to

Databases

File Systems and

Databases

Database Models l Three Types of Relationships in Conceptual

Database Models u One-to-many relationships

Intro to

Databases

File Systems and

Databases

Database Models l Three Types of Relationships in Conceptual

Database Models u Many-to-many relationships

Intro to

Databases

File Systems and

Databases

Database Models l Three Types of Relationships in Conceptual

Database Models u One-to-one relationships

Intro to

Databases

File Systems and

Databases

Database Models l Three Types of Implementation Database

Models u Hierarchical database model u Network database model u Relational database model

Intro to

Databases

File Systems and

Databases

Hierarchical Database Models l Basic Structure u Collection of records perceived as organized to conform to the upside-down tree structure.

u A tree structure is represented as a hierarchical path on the computer’s storage media.

u One-to-Many (1:M) Relationship l

Each parent can have many children.

l

Each child has only one parent.

Hierarchical Data Structure

Intro to

Databases

File Systems and

Databases l Uses a Tree-like hierarchical structure. It links records of different types in a strict hierarchy form top to bottom.

l Each record, except those at the top, is associated with a specific parent.

l Each parent record can have several child records l One-to-many relations l Well suited for representing simple data structures

Intro to

Databases

File Systems and

Databases

Hierarchical Structure for Database

Hierarchical Database Models

Intro to

Databases

File Systems and

Databases l Advantages u Data sharing and security provision u Data independence - Reduced programming and maintenance effort u Database integrity u Efficiency dealing with a large database u Large installed (mainframe) base, Abundant business applications l Disadvantages u Requirement of knowledge of physical level of data storage u Inability to represent relationships that do not conform to the hierarchical 1:M standard u Complex and inflexible to manage u Time consuming and complicated application programming u Lack of ad hoc query capability for end users u Lack of standard concepts and implementation -- limited portability u Requirement of extensive programming activities

Intro to

Databases

File Systems and

Databases

Database Models l Network Database Model u Basic Structure l 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

Network Data Structure

Intro to

Databases

File Systems and

Databases l Similar to Hierarchical structure, but provides more flexibility in the way different files are linked.

l It is permitted for a child record to have more than one parent record.

l It uses a Network structure.

l Many-to-many relations l Most large scale mainframe DBMS in use today have a network structure.

Intro to

Databases

File Systems and

Databases

Database Models l Network Database Model l

Relationships among the records are decomposed into a series of sets.

Defining Set Components

Intro to

Databases

File Systems and

Databases

Network Database Models

Intro to

Databases

File Systems and

Databases

Network Database Model l Advantages u Easier implementation of M:N relationships u Superior data access type and flexibility u Enforced data integrity u Sufficient data independence l Disadvantages u Difficult to design and use properly u Difficult to make changes in a database u Very complex structure from the application programmer’s point of view u Complex navigational data access environment

Intro to

Databases

File Systems and

Databases

Relational Database Model Models l Background u E. F. Codd developed the relational model in 1970.

l

Conceptually simple but versatile l

Major breakthrough for both users and designers l

From “standard transmission” to “automatic transmission” u Requires more computing power l Considered impractical in the 1970’s l

Modern computers (even PCs) are powerful enough to handle relational databases.

Intro to

Databases

File Systems and

Databases

Relational Data Structure l Consists of a collections of two dimensional tables, each of which is assigned a unique name.

l A row in a table represents a relationship among a set of values.

l Since a table is a collection of such records, there is a close correspondence between the concepts of tables and mathematical concept of relations l Relation is a two-dimensional table.

l Each row in the table holds data that pertains to some thing or a portion of some thing. Each column of the table contains data regarding an attribute

Intro to

Databases

File Systems and

Databases

Relational Database Model l Relational DataBase Management System (RDBMS) u RDBMS allows user/designer operate in a human logical environment.

u Relational database is perceived by the user as a collection of tables in which data are stored.

u Each table consists of series of row/column intersections.

u Tables (or relations) are related to each other by sharing a common entity characteristic.

u The relationship type is often shown in a relational schema.

u A table yields complete data and structural independence because it is a purely logical structure.

Relational Database Model

Intro to

Databases

File Systems and

Databases l For a table to be a relation, it must meet certain restrictions: u The cells of the table must be single valued u Attributes must be of the same kind u A column has a unique name u The order of the columns in the table is insignificant u No two rows (tuples) in a table may be identical u The order of the rows is insignificant

Intro to

Databases

File Systems and

Databases

Relational Database Model

Intro to

Databases

File Systems and

Databases

Relational Database Model Models l Advantages u Data independence and structural independence u u

Easy to design the database and to manage its contents

Less programming effort required u Powerful and flexible query capability: u Structured Query Language (SQL) l

Fourth Generation Language (4GL) l Specify “what to do” not “how to do” l

Introduced by IBM in 1974 l 3 parts: l

(1) User interface, l

(2) Set of tables l

(3) SQL engine

Intro to

Databases

File Systems and

Databases

Database Models l Relational Database Model u Disadvantages l

RDBMS requires substantial hardware and operating system overhead.

l It tends to be slower than other database systems.

Intro to

Databases

File Systems and

Databases

Relational Data Model

l

Relational Integrity Rules:

u Entity Integrity: l

No attribute which is primary key may have a null (nothing) value

— Referential Integrity:

— The values of foreign key must be either the values of the primary key of the reference table or be null.

Download