Lec-1 Introduction To Databases
Lec-1 Introduction To Databases
Lecturer: Email:
Room:
CHAPTER 1
2
Introduction to Databases
OBJECTIVES
Characteristics of file-based systems. Problems with file-based approach. Meaning of the term database. Meaning of the term Database Management System (DBMS). Typical functions of a DBMS. Advantages and disadvantages of DBMSs. Some common uses of database systems
FILE-BASED SYSTEMS
A file
is a collection of records which contain logically related data. Collection of application programs that perform services for the end users (e.g. reports).
Each
FILE-BASED APPROACH
A system of files and collection of application programs manipulating them is a file-based system
Each program maintains its own set of data. Users of one program may be unaware of potentially useful data held by other programs.
Same data is held by different programs. Wasted space and potentially different values and/or different formats for the same item.
6
Duplication of data
Fixed Queries/Proliferation of application programs Programs are written to satisfy particular functions. Any new requirement needs a new program.
7
DATABASE APPROACH
Arose because:
Definition
of data was embedded in application programs, rather than being stored separately and independently. No control over access and manipulation of data beyond that imposed by application programs. Therefore there was a need to separate data from programs but with a facility for them to interact.
8
DATABASE APPROACH
Result
Databases
were therefore developed to store, organize and secure data while applications can be able to access the database, process the data and generate the required information.
DATABASE
Shared
collection of logically related data (and a description of this data), designed to meet the information needs of an organization. catalog (metadata) provides description of data to enable programdata independence. related data comprises entities, attributes, and relationships of an organization's information.
10
System
Logically
DATABASE APPROACH
Data definition language (DDL). Permits specification of data types, structures and any data constraints that should be part of the database. All specifications are stored in the database. Data manipulation language (DML). Enables those with access to the database to insert, update, delete and retrieve data from it. Standard Query Language (SQL) is an example of a DML
11
12
system that enables users to define, create, and maintain the database and which provides controlled access to this database. Database Application: A computer program
that interacts with the database by issuing an appropriate request (typically an SQL statement) to the DBMS.
13
FUNCTIONS OF A DBMS
Data
A User-Accessible Transaction
Concurrency
Recovery
Services.
14
FUNCTIONS OF A DBMS
Authorization Support
Services.
Integrity Services
Utility
Services.
15
ADVANTAGES OF DBMS
Control
of data redundancy Data consistency More information from the same amount of data. Sharing of data Improved data integrity Improved security Enforcement of standards
16
ADVANTAGES OF DBMS
Balanced
conflicting requirements Improved data accessibility and responsiveness Increased productivity Improved maintenance through data independence Increased concurrency Improved backup and recovery services
17
DISADVANTAGES OF DBMS
Complexity Size Cost of DBMS Additional hardware costs Cost of conversion Performance Higher impact of a failure
18
19
The Network Model: Represents data as nodes and relationships are implied by linking up the nodes by edges. The Hierarchical Model: Represents data and nodes in a hierarchical manner. The Deductive Model: Represents minimal data as 'Axioms'. Extra data and relationships are deduced. The Relational Model: Uses relations/table to organize data. A row/tuple represents an instance of data and relationships are represented by foreign keys. The Object Oriented Model: Uses the object oriented paradigm of encapsulation, inheritance and polymorphism. A class represents data and an object represents the instance.
20