You are on page 1of 22

Chapter 8

DATABASE MANAGEMENT SYSTEM

1
Concept of Database
A database is a collection of data.

A DBMS consists of a collection of data and a set of


programs to access those data.

2
Advantages of DBMS
1)Data Redundancy :- Data redundancy means
Duplication of data.
A DBMS keeps data at one place and users can access
from there.
2)Data consistency:-
Data redundancy leads to inconsistency.
Inconsistency can be controlled by controlling data
redundancy.
3)Efficient data access:-
A DBMS provides an efficient access to database.
3
Advantages of DBMS
4)Data integrity:-
Data integrity refers to correctness of data stored in the database.
5)Data Security:-
Data security can be done by using passwords.
6)Sharing of data:-
Data can be shared among multiple programs and users.
7)Enforces standard:-
standards may be laid by the organization or individual.
8)Recovery:-
Mechanism for data backup and recovery from hardware failure.
4
Components of DBMS
1)Hardware:-
computers(Server) and storage devices
2)Software:-
application programs and utilities.
3)Data:-
The data is organized in the form of Field,Record and Files.
4)Users:-classified into four types:
Data Base Administrator(DBA),Application Programmer,Sophisticated user
and Naive user.
5)Procedure:-
instruction to start and stop DBMS,backup database,login to database etc.

5
Structure of DBMS
Data is organized as Field,Record and Files.

Field:-A field is the smallest unit of stored data.


Record:-A record is a collection of related fields.
Files:-A files is a collection of records.

6
Database Abstraction

7
Database Abstraction
A database system is designed using three levels of abstraction,Physical
Level,Logical Level,View Level.
1)Physical Level(Internal Level):-
It is the lowest level of abstraction.
howdata is actually stored
2)Logical Level(Conceptual Level):-
also called global view.
Represents the entire database.
what data are stored in the database and the relationship between data.
3)View Level(External Level):-
The way in which individual users view the data.
only a part of entire database.

8
Different users in database
Database Administrator(DBA)
Application Programmer
Sophisticated Users
Naive Users

9
Different users in database
Database Administrator(DBA)
A person who has central control over the database.

Responsibilities of database administrator are:


Database creation.
Access-method definition.
Routine maintanance.

10
Different users in database
Application Programmer:

Sophisticated Users:-Sophisticated users interact with


database through queries.

Naive users:-
Naive users are unsophisticated users.
They interact with database by invoking previously written
application programs.

11
Data Independence
Data independence is the ability to modify the schema
definition(Data structure definition) in one level without
effecting the schema definition at the next higher level.
Physical data independence:
The applications need not worry about how the data are
physically structured and stored

Logical data independence:-


Naive modify the conceptual (logical) scheme without
causing application programs to be rewritten.

12
Relational data model
Represents database as a collection of relations(tables)

Each relation has a unique name.

A relational database management system (RDBMS) is


a program that lets you create, update, and administer a
relational database.

Popular RDBMS are Oracle,MYSQL,DB2 etc.

13
Terminologies in RDBMS
1)Entity:-A real world object such as student,teacher etc.
2)Relation:-A collection of data in the form of rows and
column.
3)Tuple:-The row in a table is called tuple.It is also called
record.
4)Attribute:-A column in a table(Relation) is called
attribute.
5)Degree:-The number of columns in a table is called
degree.

14
Terminologies in RDBMS
6)Cardinality:-The number of rows in a table.
7)Domain:-The set of possible values for a
column(Attribute).
8)Schema:-The overall design(Description) of a
database.
9)Instance:-The collection of data stored in tha
database at a particular moment is called instance.It is
also called snapshot or database state.

15
Keys
A key is an attribute or collection of attributes that uniquelly identifies
each record(Tuple) in a table.

A key consisting of one or more attributes is called a composite


key(Compound Key).

1)Candidate Key:- A column or set of columns that uniquely


identifies each record in the table.

2)Primary Key:-Uniquely identify each row in a table.


A table can have only one primary key.

16
Keys
3)Alternate Key:- A candidate key that is not the
primary key.
4)Foreign Key:- A field in one table that must match a
primary key value in another table.
It is also called reference key.
5)Super Key:-A set of one or more columns in a table
for which no two rows can have the same value.

17
Relational Algebra
A collection of operations used to manipulate table
content.

Select,Project,Union,Cartesian Product etc.

18
Relational Algebra
1) SELECT Operation:-
Selects rows from a table that satisfies a specific condition.
It is denoted by Sigma(σ).

2) PROJECT Operation:-
Selects attributes(Columns) from a table.
It is denoted by Pi( π)
3) Cartesian Product Operation:-
Combines tuples from two relations.
It is a binary operation and is denoted by X(cross).

19
Relational Algebra
4) UNION Operation:-
Retains a relation consisting of all tuples from both the
relations.
It is denoted by U .
tables having same number and types of attributes.

20
Relational Algebra
5) INTERSECTION Operation:-
returns a relation consisting of all tuples common to both
the relations.
It is a binary operation denoted by ∩.

R INTERSECTION S

21
Relational Algebra
6) SET DIFFERENCE Operation:-
Returns a relation consisting of all tuples appearing in the
first relation and not in the second relation.
It is denoted by ' - '

22

You might also like