Top Banner
Database Systems for BS (IT) Lecture 1: Introduction Kaleem ullah [email protected] Punjab University College of Information Technology
55
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: data base manage ment

Database Systems

for BS (IT)

Lecture 1: Introduction

Kaleem ullah

[email protected]

Punjab University College of Information Technology

Page 2: data base manage ment

Example:Robcor company has two divisions and the two division has 1,380,456 and 1,453,907 invoices, respectively.Each invoice has invoice number, date, and amountThe period is from the first quarter of 1997 to first quarter of 2002Total 2,834,363 records

Data versus Information

Page 3: data base manage ment

… … …

3000124 12-Jan-2002 $121.98

… … …

Data

Data versus Information

Information:----------?

Page 4: data base manage ment
Page 5: data base manage ment

Data constitute building blocks of information

Information produced by processing data

Information reveals meaning of data Good, timely, relevant information key

to decision making Good decision making key to

organizational survival

Data versus Information

Page 6: data base manage ment

Historical Roots of Database Files and File Systems: Why we need to study files and file

system? Historically handling data Help to understand database design

Page 7: data base manage ment

Historical Roots of Database

Files and File Systems: First applications focused on clerical tasks Requests for information quickly followed File systems developed to address needs

Data organized according to expected use Data Processing (DP) specialists

computerized manual file systems

Page 8: data base manage ment

File Terminology

Data Raw Facts

Field Group of characters with specific meaning

Record Logically connected fields that describe a person,

place, or thing File and file folder

Collection of related records

Page 9: data base manage ment
Page 10: data base manage ment
Page 11: data base manage ment

File System Critique

File System Data Management Requires extensive programming in third-generation

language (3GL): COBOL, Basic, and Fortran (what must be done and how it is to be done)

Time consuming depends on physically store data Makes ad hoc queries impossible Make difficult to modify file system (each file has its

own system) Leads to islands of information

Page 12: data base manage ment

File System Critique (con’t.)

Data Dependence Change in file’s data characteristics requires

modification of data access programs Must tell program what to do and how to do Makes file systems cumbersome from

programming and data management views

Structural Dependence Change in file structure requires modification of

related programs

Page 13: data base manage ment

File System Critique (con’t.)

Field Definitions and Naming Conventions Flexible record definition anticipates reporting

requirements Selection of proper field names important Attention to length of field names Use of unique record identifiers

Page 14: data base manage ment

File System Critique (con’t.)

Data Redundancy: (Unnecessary Duplication of data) Results of uncontrolled data redundancy

Data anomalies Modification Insertion Deletion

Data inconsistency (Different and conflicting versions of same data)

Lack of data integrity

Page 15: data base manage ment

Database Management

Database is shared, integrated computer structure that stores a collection of data: End user data (raw data) Metadata (data about data, it contains data

characteristics and relationships)

Page 16: data base manage ment

DBMS is an application, which holds user data permanently and then provide different operations on this data e.g., retrieval of data, insertion of data, updation of data etc.

It is a computerized system whose overall purpose is to maintain information and to make that information available on demand.

Database Management System (DBMS)

is just a computerized record-keeping system.

Non-technical

Collection of data in the form of files, electronic filing cabinet

A software or application providing operations on the data like, adding new files, inserting new data, retrieving existing data, updating and deleting data,removing files etc.

Page 17: data base manage ment

Database Management

Database Management System (DBMS): software system (collect of software) help to manage the data contents Manages Database structure Controls access to data Contains query language

Application software DBMS Database

Page 18: data base manage ment

Importance of DBMS• Makes data management more efficient and effective• Query language allows quick answers to ad hoc queries• Provides better access to more and better-managed

data• Promotes integrated view of organization’s operations • Reduces the probability of inconsistent data• Improved data sharing• Improved data security

Page 19: data base manage ment
Page 20: data base manage ment

Important terms and definitions Retrieval, Insertion, Deletion, Updation Field, Record, Table Structured Query Language (SQL) Data vs. Information Single-user and Multi-user Systems Integrated and Shared Data Administration

identifying data and needs of enterprise w.r.t. data, deciding what data should be stored, establishing policies for maintaining and dealing with stored data

Database Administration creating actual database and implementing technical controls

needed to enforce policy decisions made by data administrator and related technical services

Database users Application Programmers End Users DBA’s

Page 21: data base manage ment

Terms in Relational Model Relation Tuple, Attribute Cardianlity, Degree Domain

tuples

attributes

ID Name Age Department

S1 Ahmad 23 SalesS2 Salman 34 MarketingS3 Karim 21 SalesS4 Tariq 29 AdminS5 Sadiq 32 Sales

Employee Relation

Cardinality

Degree

Page 22: data base manage ment

Important terms and definitions Scalar values (Atomic)

at every row and column position in every table there is always exaclty one data value

Repeating Group

A repeating group is a column, or combination of columns that contain several data values in each row

ID Name AgeMarksMax.Marks

• RDBMS does not allow repeating groups

Optimazationa system component that determine how to

implement user requests Catalog

set of system tables

Page 23: data base manage ment

Important terms and definitions Data Sub languages

DDL DML DCL Query Language

Schema Internal External Conceptual

Data Dictionary Redundancy Client/Server Architecture Distributed Processing and Database System Security and Integrity Backup and Recovery

Page 24: data base manage ment

Jobs of DBA Defining Conceptual Schema Defining Internal Schema Liaising with users Defining Security and Integrity rules Defining Backup and Recovery procedures Monitoring performance and responding to changing

requirements

Page 25: data base manage ment

Why Database Design is Important Database design focuses on design of

database structure used for end-user data Designer must identify database’s expected use

Well-designed database: Facilitates data management Generates accurate and valuable information

Poorly designed database: Causes difficult-to-trace errors

Page 26: data base manage ment

Database Systems

Database consists of logically related data stored in a single repository

Provides advantages over file system management approach Eliminates data inconsistency (lack of data

integrity), data anomalies, data dependency, and structural dependency problems

Stores data structures, relationships, and access paths

Page 27: data base manage ment

Database vs. File Systems

Page 28: data base manage ment

Database System Environment

Page 29: data base manage ment

Database System Environment

Hardware System’s Physical devices

Computers Peripherals Network

Page 30: data base manage ment

Database System Environment

Software Operating system: manages hardware

components DBMS: manages database

MS Access, SQL Server, Oracle, DB2 Application and utility software: support access

and manipulate data Generate information for decision making Help to manage database system

Page 31: data base manage ment

Database System Environment

People (five users) System administrator: hardware system support Database administrator: manage DBMS use Database designer: design database structure System analyst and programmers: implement

application programs End users

Page 32: data base manage ment

Database System Environment

Procedures Instruction and rule that govern the

design and use of the database system

Data

Page 33: data base manage ment

Database System Types

Single-user vs. Multi-user Database (user number) Desktop database – Single user Workgroup database --supports a small number Enterprise database --supports a large number

Centralized vs. Distributed (location) Use

Production or transactional Decision support or data warehouse

(obtain information)

Page 34: data base manage ment

DBMS Functions

Objective: Guarantee the integrity and consistency of data. It has several functions: Data dictionary management: (the definition of the data elements

and their relationships are stored in a data dictionary). It remove data and structure dependencies.

Data storage management: structures required for data storage

Data transformation and presentation: relieving us from the distinct between logical data format and physical data format

Security management

Multiuser access control (concurrency)

Page 35: data base manage ment

DBMS Functions

Backup and recovery management Data integrity management Database access language and application

programming interfaces Query language (DDL and DML)

Database communication interfaces

Page 36: data base manage ment

Database Models

Definition: collection of logical constructs used to represent data structure and relationships within the database Conceptual models: logical nature of data

representation; it emphasizes on what entity is presented; it is used for database design as blueprint

Implementation models: emphasis on how the data are represented in the database

Page 37: data base manage ment

Database Models

Conceptual models include Entity-relationship database model (ERDBD) Object-oriented model (OODBM)

Implementation models include Hierarchical database model (HDBM) Network database model (NDBM) Relational database model (RDBM) Object-oriented database model (ODBM)

Page 38: data base manage ment

Database Models (con’t.)

Relationships in Conceptual Models One-to-one (1:1) One-to-many (1:M) Many-to-many (M:N)

Implementation Database Models Hierarchical Network Relational Object-Oriented

Page 39: data base manage ment

Evolution of Database Modals

1960s1970s

1990s

Traditional files

Hierarchical

Network

1980s

Relational

Object oriented

Object-relational

2000s

Client Oriented

?

Page 40: data base manage ment

Hierarchical Database Model (HDBM)

Logically represented by an upside down tree Each parent can have many children (segment

linkage) Each child has only one parent A single table acts as the "root" of the database

from which other tables "branch" out. Relationships in such a system are children and

parents. Parents and children are tied together by links

called "pointers

Page 41: data base manage ment

Hierarchical Database Model

Logically represented by an upside down tree 1:M relationship

Page 42: data base manage ment

Hierarchical Database Model Hierarchical path (beginning from left) Left-list hierarchical path, or preorder traversal, or

hierarchical sequence

Re-list sequence, if the segment is frequently accessed

Bank systems commonly use HD model

Final assembly->Component A->Assembly Final assembly->Component A->Assembly A-> -> Part A ->Part B -> Component B -> A-> -> Part A ->Part B -> Component B -> Component C –Assembly B -> Part C ->Part Component C –Assembly B -> Part C ->Part DD

Page 43: data base manage ment

Hierarchical Database Model

Bank systems commonly use the HDBM customer account can be subject to

many transactions (1:M relationship)

Relationship is fixed (debiting and crediting)

Frequently access large amount of transactions

Page 44: data base manage ment

Hierarchical Database Model

Advantages Conceptual simplicity: relationship between layers is logically

simple; design process is simple Database security: enforced uniformly through the system Data integrity Data independence Efficiency in 1:M relationships and when uses require large

numbers of transactions Dominant in 1970s , when we used mainframe system with large

databases

Page 45: data base manage ment

Hierarchical Database Model

Disadvantages Complex implementation: physical data storage

characteristics; database design is complicated Difficult to manage and lack of standards Lacks structural independence Applications programming and use complexity

(pointer based) Implementation limitations, i.e. especially it only

handle 1:M type of model

Page 46: data base manage ment

Network Database Model (NDBM)

Each record can have multiple parents Called by Database Task Group (DBTG) to define standards Three crucial database components

Network schema: conceptual organization of the entire database

Subschema: portion of database as information for application programs

Database management language: defining data characteristics and data structure Schema Data definition language (DDL): define schema components Subschema Data definition language Data manipulating language: manipulate data content

Page 47: data base manage ment

Network Database Model

Each record can have multiple parents Introduce set to describe relationship Each set has owner record and member record, parallel

to parent and child in HDM Member may have several owners One-ownership

Hierarchical model is a subset of the network model. The network model uses set theory to provide a tree-

like hierarchy.

Page 48: data base manage ment

Network Database Model

Member may have several owners

Page 49: data base manage ment

Network Database Model

Advantages Conceptual simplicity, just lime HDM Handles more relationship types (but all 1:M

relationship) Data access flexibility Promotes database integrity Data independence Conformance to standards

Page 50: data base manage ment

Network Database Model

Disadvantages System complexity

(Develop by the Computer programmers for the Computer Programmers rather than user)

Lack of structural independence

Page 51: data base manage ment

Relational Database Model (RDBM)

Let’s user or database designer to operate human logical environment

Perceived by user as a collection of tables for data storage, while let RDBMS handles the physical details.

Tables are a series of row/column intersections Tables related by sharing common entity

characteristics It allows 1:1, 1:M, M:N relationships

Page 52: data base manage ment

Relational Database Model

Page 53: data base manage ment
Page 54: data base manage ment

Relational Database Model

Advantages Structural independence: data access path is

irrelevant to database design; change structure will not affect the database

Improved conceptual simplicity Easier database design, implementation,

management, and use Ad hoc query capability with SQL (4GL is added) Powerful database management system

Page 55: data base manage ment

Relational Database Model

Disadvantages Substantial hardware and system software

overhead Poor design and implementation is made easy May promote “islands of information” problems