You are on page 1of 34

Database

Lecture -1
Lecture Overview
 Database Definition
 Comparison between File Processing approach
and Database
 Advantages and disadvantages of Databases
 Database users
 Some common terms
 Data, information and DBMS
What is a
Database
Database definition
A database is a shared collection of logically
related data that is stored to meet the
requirements of different users of an
organization
The concept of a shared organizational
database
Management
Marketing

Planning Control Product


Sales
Development

Corporate
Database

Accounting Manufacturing

Accounts Accounts
Scheduling Production
Receivable Payable
History
 File Processing System:
 A collection of Programs that perform services for
the end-users such as production of reports
 Each Program defines and manages its own data.
File Processing Systems

Each Program defines and manages its own data


File Processing Systems
Library Examination Registration

Reg_Number Reg_Number Reg_Number

Name Name Name

Book Title Address Father Name

Book Version Section Phone

Date of borrrow Semester Address

Phone Grade Section

Duplication of Data lead toVulnerable to Inconsistency


File based system problems
 Data separation and isolation
 Limited Sharing
 Limited data Security
 Data duplication
 Incompatible data (different file formats)
Database Approach

Library Examination Registration

Library Examination Registration


Applications Applications Applications

Database
Management
System

University
Students
Database
Advantages of Database Approach
 Advantages
1.Data Security

2.Data Sharing
3.Controlled Redundancy
4.Better Data Integrity

5.Control concurrency
6.Backup and recovery
Disadvantages of Database
system

 The cost of implementation


 The amount of effort needed to transfer data into
the database from a current system
 The impact on the whole company if the database
fails (even if only for a relatively short period).
Database Users
Database Users
 End users
 People whose jobs require access to the database such as
student connect to university web site to add course
 they use the data for queries, reports and some of them actually
update the database content.
 application programmers
 Person who write code to develop applications that
communicate GUI with the database
 Example ‫ب وابة ا لجامع ة‬
Database Users
 Database administrators (DBA) are responsible for:
 Authorizing access to the database
 Acquiring software and hardware resources
 Routine Maintenance
 Backups, Monitoring disk space and jobs running
 Database designers are responsible for:
 Identifying the data to be stored
 Choosing appropriate structures to represent and store
this data
Common Terms
 Data
 Information

 Database Management system (DBMS)


Data vs information
 Data: Facts concerning things, such as people,
objects, or events
 Example: Student data of birth
 Information: Data that have been processed and
presented in a form suitable for human
interpretation
 Example : Student Age
Database Management System (DBMS):

 DBMS is : A software system that enables users


to define, create, maintain, and control access to
the database.

 Examples of DBMS:
 Access, Oracle, MySQL, SyBase, SQL Server,..
Functions of DBMS
1. Data Processing
2. A User Accessible Catalog
3. Transaction Support
4. Concurrency Control Services
5. Recovery Services
6. Authorization Services
7. Support for Data Communication
8. Integrity Services
System Catalog
 Is a repository of information describing the data in
the DB: it’s the “data about the data” or metadata
example, the system catalog stores:
 names, types and sizes of data items;
 names of relationships;
 integrity constraints on the data;
 names of authorized users who have access to the data;
 the data items that each can access and the type of
access allowed; for example, insert, delete, update, or
select;
Database
Lecture - 2
Lecture Overview
 Database Architecture
 Data Independence
Database
Architecture
Three-Schema Architecture
and Data Independence
 External or view level
 Describes part of the database that a particular
user group is interested
 Conceptual level
 Describes structure of the whole database for a
community of users
 Internal level
 Describes physical storage structure of the
database
The Three-Level Architecture
External View
 Each user has different views of the same data e.g.
date, time
 Virtual/calculated data: that is not actually stored in the
database but is created when needed e.g. age,
statistical data
 External schema evolves as user needs are modified
over time
users
Employee Data Workers
First Name: Rand Name: R. Ahmed
Last Name: Ahmed Age: 24y,10d
Date of Birth: Dept: Sales
12 Sep, 1970 External Level

Conceptual Level

Name DoB Salary Dept


Rand Ahmed 12/09/70 5000 Sales
Alaa Wasfi 29/02/80 4500 Accounting
Level 2 :Conceptual Level
 This level describes what data level is stored in the
database and the relationships among the data.
 Conceptual Level Relatively constant.
 Conceptual Level does not include details of how data
is stored or how operations are implemented
Level 3: Internal Level
 The physical representation of the database on the computer. This level
describes how the data is stored in the physical device
 It concerns
 storage space allocation for data and indexes;
 record descriptions for storage (with stored sizes for data items);
 record placement;
 data compression and data encryption techniques.
Last Name: Ahmed Age: 24y,10d
Date of Birth: Dept: Sales
12 Sep, 1970

Name DoB Salary DepId


Rand Ahmed 12/09/70 5000 Sales
Alaa Wasfi 29/02/80 4500 Accounting

Rand Ahmed 120970 5000 Sales……………………..

01110011010011100101001010100101010010101…..
Data
Independence
Data Independence
 Changes in lower level do not affect the upper
levels

 Data Independence Types


1. Logical Data Independence
2. Physical Data Independence
Logical Data Independence
 Changes in conceptual level do not affect the external views
 Immunity of external level from changes at conceptual level
 Types of Changes
 Adding a new attribute in a table
 Changing 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
 Types of Changes Examples
 Index implementation, etc.
 Changing storage medium

You might also like