40
Todays Objective Database System day we will learn: Some common uses of database systems The characteristics of file-based systems The problem with the file-based approach The meaning of the term ‘Database’ The meaning of the term Database Management System’ (DBMS) The typical functions of DBMS The major components of the DBMS environment The advantages and disadvantages of DBMSs

Computer lecture (1) m.nasir

Embed Size (px)

Citation preview

Page 1: Computer lecture (1) m.nasir

Todays ObjectiveDatabase System

Today we will learn:Some common uses of database systemsThe characteristics of file-based systemsThe problem with the file-based approachThe meaning of the term ‘Database’The meaning of the term Database Management System’ (DBMS)The typical functions of DBMSThe major components of the DBMS environmentThe advantages and disadvantages of DBMSs

Page 2: Computer lecture (1) m.nasir

Common DefinitionsDatabase System

DataInformationSummarized DataMetadata

Page 3: Computer lecture (1) m.nasir

Some common uses of database systems

Database Systems

Purchase from the U-martCash withdrawal from ATM (of The Bank of Punjab, Fowara Chowk, Gujrat)Purchase using your credit cardRegistration at NADRA officeUsing the internet University of Gujrat Information System (UOGIS)

Page 4: Computer lecture (1) m.nasir

File-based systemsDatabase Systems

A collection of programs that perform services for the end-user.

Page 5: Computer lecture (1) m.nasir

The Characteristics of file-based systemsDatabase Systems

RegistrationApplications

RegistrationDataFiles

Registration

ExaminationApplications

ExaminationDataFiles

Examination

LibraryApplications

LibraryDataFiles

Library

Page 6: Computer lecture (1) m.nasir

The Problems with File-Based systemsDatabase Systems

The Limitations of the file-based approachSeparation and isolation of dataDuplicate of dataData dependenceIncompatible file formats

Page 7: Computer lecture (1) m.nasir

The Problems with File-Based systemsDatabase Systems

Fine

Books Issued

Father Name

Name

Reg_Number

Library

Grade

Semester

Class

Address

Name

Reg_Number

Examination

Class

Address

Phone

Father Name

Name

Reg_Number

Registration

Page 8: Computer lecture (1) m.nasir

The meaning of the term “Database Management System DBMS”Database Systems

-A software system that enables users to define, create, and maintain the database and that provides controlled access to this database.A database management system (DBMS) is computer software that manages databases.Examples: Oracle, SQL Server, Informix, Sybase, Ingress

Page 9: Computer lecture (1) m.nasir

The meaning of the term “Database Management System DBMS”Database Systems

DBMS Databasecontainingcentralized

shared data

Application#1

Application#2

Application#3

Page 10: Computer lecture (1) m.nasir

The meaning of the term “Database”Database Systems

-Shared collection of logically related data (and a description of this data), designed to meet the information needs of an organization.

Page 11: Computer lecture (1) m.nasir

The meaning of the term “Database”Database Systems

Shared collection – can be used simultaneously by many departments and users.Logically related - comprises the important objects and the relationships between these objects.Description of the data – the system catalog (meta-data) provides description of data.

Page 12: Computer lecture (1) m.nasir

DatabaseDatabase Systems

Database

A collection of related files

^File A collection of records about a particular set of people, objects, entities

and so on^

Record A collection of related fields associated with a single person, object, entity and so on

^Field A collection of bytes representing a single attribute.

^Byte A collection of bits representing a single character

^Bit A binary digit

Page 13: Computer lecture (1) m.nasir

DatabaseDatabase Systems

A database is a collection of integrated files.Integrated : Collection of files.

Note: A FILE is a collection of logical records in a tabular format.

A RECORD contains fields (or attributes ) about the entity. A field is same as an ‘attribute’

Page 14: Computer lecture (1) m.nasir

Advantages of Database Approach

RegistrationExamination

LibraryApplications

Library

ExaminationApplications

RegistrationApplications

Database Management

System

University StudentsDatabase

- Data Sharing - Data Independence- Controlled Redundancy - Better Data Integrity

Page 15: Computer lecture (1) m.nasir

Advantages of Database ApproachDatabase Systems

Data SharingData IndependenceControlled RedundancyBetter data IntegrityData consistencyBetter data securityFaster development of new applicationsEconomy of scaleBetter concurrencyBetter backup procedures

Page 16: Computer lecture (1) m.nasir

The advantages and disadvantages of DBMSsDatabase Systems

Higher costs (DBMS)

Conversion cost (manual to computerized )

More difficult recovery

Page 17: Computer lecture (1) m.nasir

Todays ObjectiveDatabase System

Today we will learn:• Database Users• Typical Components of Database Environment• Data Independence• 3-Level Architecture

Page 18: Computer lecture (1) m.nasir

Instructor: Ikram. Database Systems. CS-212

Database UsersApplication ProgrammersEnd Users

Naïve Sophisticated

Page 19: Computer lecture (1) m.nasir

Instructor: Ikram. Database Systems. CS-212

Database UsersDatabase Administrator (DBA)

A person who has central control over data and programs that access this data

Page 20: Computer lecture (1) m.nasir

Instructor: Ikram. Database Systems. CS-212

Functions of DBA

Create Database Creating Users Granting Roles & Privileges Routine Maintenance

Backups Monitoring disk space Monitoring jobs running

Page 21: Computer lecture (1) m.nasir

Typical Components of Database Environment

Database

DBMS“How” to get

Application Programs

“What” to get

End usersinteract

Application Programmers

Database Administrators

Database Designers

develop

maintain

design

Software

Users

Data

Page 22: Computer lecture (1) m.nasir

Why 3-Level Architecture

Each user should be able to access the same data, but

have a different customized view of data. Each user should be able to change the way he or she views the data, and this change should not affect other users.

User should not have to deal directly with physical

database storage details. The internal structure of the database should be

unaffected by the changes to the physical aspects of storage, such as change over to a new storage devices.

Page 23: Computer lecture (1) m.nasir

External Level

Conceptual / Logical Level

Internal Level

Physical Data Organization

View 1 View 2 View n

Conceptual Schema

InternalSchema

Database

User 1 User 2 User n

Ext/Con Mapping

Con/Int Mapping

3-Level Architecture

Page 24: Computer lecture (1) m.nasir

External Level

This Level Describes- The Part of Database that is relevant to each user e.g. Registration, Accounts etc

Calculated Data: That is not actually stored in the database but is created when needed e.g. age

DBMS uses external views to create users interface for different users which is both the facility and barrier.

External Schema are evolves as user needs are modified over time

Page 25: Computer lecture (1) m.nasir

First Name: RanaLast Name: AslamDate of Birth: 12 Sep, 1970

Name: R. AslamAge: 24y,10dDept: Sales

Saleem

Saleema

Corresponds to different views of Data

External Level

Page 26: Computer lecture (1) m.nasir

Conceptual / Logical View

Entire information structure of the database. Also called “The Community view of data” All entities, attributes and their relationships are

represented. Representing data and constraints on data Contains information about the security and

integrity information Relatively constant: designed with the present as

well as future needs of an organization.

Page 27: Computer lecture (1) m.nasir

Name DoB DepId

Rana Aslam 12/09/70 D001Marya Wasti 29/02/80 D005

First Name: RanaLast Name: AslamDate of Birth: 12 Sep, 1970

Name: R. AslamAge: 24y,10dDept: Sales

Saleem

Saleema

Conceptual / Logical View

Describes all entities their attributes their relationships with constraints

Page 28: Computer lecture (1) m.nasir

Internal View

Although these are at same level but Physical View

▪ Actual Data (on the disk) binary format.▪ Use OS to store the Data

Internal View▪ Internal Record: a single stored record▪ Does not just contain what we see at the

conceptual level

Page 29: Computer lecture (1) m.nasir

Name DoB Deps DepId

Rana Aslam 12/09/70 5 D001Marya Wasti 29/02/80 0 D005

First Name: RanaLast Name: AslamDate of Birth: 12 Sep, 1970

Name: R. AslamAge: 24y,10dDept: Sales

Saleem

Saleema

01110011010011100101001010100101010010101…..

BH RH Rana Aslam 120970 5 D001 RH Marya Wasti…

Contains stored Data (Record)

Internal View

Page 30: Computer lecture (1) m.nasir

Inter-Schema Mapping

External / Conceptual mapping (correspondence between external level

and conceptual level) Conceptual / Internal

(correspondence between and conceptual level and internal level)

Page 31: Computer lecture (1) m.nasir

External / Conceptual mapping

Specifies mapping between objects in the external view to those in the logical model

External to logical model

Page 32: Computer lecture (1) m.nasir

Conceptual / Internal

Specifies mapping between objects in the logical model to those in the physical model-data independence

Logical to Physical

Page 33: Computer lecture (1) m.nasir

Data Independence

Page 34: Computer lecture (1) m.nasir

Data Independence Very Important Feature Data independence is major most outcome of

3-L Arch The immunity of applications to change in

storage structure and access strategy

Page 35: Computer lecture (1) m.nasir

Data IndependenceChanges in lower level do not affect

the upper levelsMind the direction please

Page 36: Computer lecture (1) m.nasir

Data Independence Types

Logical Data Independence

Physical Data Independence

Page 37: Computer lecture (1) m.nasir

Logical Data Independence

Changes in conceptual model do not affect the external views

Immunity of external level from changes at conceptual level

Page 38: Computer lecture (1) m.nasir

Types of Changes

Adding a new file etc.Adding a new field in a fileChanging type/size

Deleting an attribute

Page 39: Computer lecture (1) m.nasir

Physical Data Independence

Changes in the internal model do not affect the conceptual model

Immunity of Conceptual level from changes at Internal level

Page 40: Computer lecture (1) m.nasir

Different Terms

Entity (an object) Attribute (characteristics of object) Constraints (limit, check, control)