Upload
muhammad-nasir
View
66
Download
1
Embed Size (px)
Citation preview
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
Common DefinitionsDatabase System
DataInformationSummarized DataMetadata
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)
File-based systemsDatabase Systems
A collection of programs that perform services for the end-user.
The Characteristics of file-based systemsDatabase Systems
RegistrationApplications
RegistrationDataFiles
Registration
ExaminationApplications
ExaminationDataFiles
Examination
LibraryApplications
LibraryDataFiles
Library
The Problems with File-Based systemsDatabase Systems
The Limitations of the file-based approachSeparation and isolation of dataDuplicate of dataData dependenceIncompatible file formats
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
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
The meaning of the term “Database Management System DBMS”Database Systems
DBMS Databasecontainingcentralized
shared data
Application#1
Application#2
Application#3
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.
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.
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
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’
Advantages of Database Approach
RegistrationExamination
LibraryApplications
Library
ExaminationApplications
RegistrationApplications
Database Management
System
University StudentsDatabase
- Data Sharing - Data Independence- Controlled Redundancy - Better Data Integrity
Advantages of Database ApproachDatabase Systems
Data SharingData IndependenceControlled RedundancyBetter data IntegrityData consistencyBetter data securityFaster development of new applicationsEconomy of scaleBetter concurrencyBetter backup procedures
The advantages and disadvantages of DBMSsDatabase Systems
Higher costs (DBMS)
Conversion cost (manual to computerized )
More difficult recovery
Todays ObjectiveDatabase System
Today we will learn:• Database Users• Typical Components of Database Environment• Data Independence• 3-Level Architecture
Instructor: Ikram. Database Systems. CS-212
Database UsersApplication ProgrammersEnd Users
Naïve Sophisticated
Instructor: Ikram. Database Systems. CS-212
Database UsersDatabase Administrator (DBA)
A person who has central control over data and programs that access this data
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
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
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.
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
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
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
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.
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
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
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
Inter-Schema Mapping
External / Conceptual mapping (correspondence between external level
and conceptual level) Conceptual / Internal
(correspondence between and conceptual level and internal level)
External / Conceptual mapping
Specifies mapping between objects in the external view to those in the logical model
External to logical model
Conceptual / Internal
Specifies mapping between objects in the logical model to those in the physical model-data independence
Logical to Physical
Data Independence
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
Data IndependenceChanges in lower level do not affect
the upper levelsMind the direction please
Data Independence Types
Logical Data Independence
Physical Data Independence
Logical Data Independence
Changes in conceptual model do not affect the external views
Immunity of external level from changes at conceptual level
Types of Changes
Adding a new file etc.Adding a new field in a fileChanging type/size
Deleting an attribute
Physical Data Independence
Changes in the internal model do not affect the conceptual model
Immunity of Conceptual level from changes at Internal level
Different Terms
Entity (an object) Attribute (characteristics of object) Constraints (limit, check, control)