Rdbms Notes
Rdbms Notes
DBMS is used to manage store & manipulate the data. Following are the users
that wants in Database Management System.
1. Naive User: The Naive User interactive with the system by invoking
application program or S/w have been previously written.
5. Disk Manager: The Disk Manager is part of the operating System of the
host Computer & all physical Input & Output operations are performed
by it.
6. Query Processor: The Query processor is used to interact the online
user’s Query & Convert it into series of operations in a form capable of
being sent to the Data Manager for evolution.
7. Telecomm System: Online users of a Computer System whether remote
or local communicate with in by sending & receiving messages over
communication lines. These messages are routed via an independent S/W
System Called a Telecommunication System or a Telecommunication
Control Program.
8. Data Files: Data files according the database.
9. Data Dictionary: The Data Dictionary which is a database itself,
documents the data.
10.DBA (Database Administrator): A person or the group of person, who
controls the database system is called as DBA. It is responsible for
creating Maintaining, Modifying the structure of Database System.
Advantages of DBMS
1. Reduction of data redundancy:
Duplication of data is called as redundancy, while creating a database it
might be possibility record is repeated that repetition is called as
redundancy.
In DBMS Overall data can be control by the DBA, so it avoid that
unnecessary duplication of data.
2. Sharing of data:
DBMS allows multiple user to access the database at the same time. The
control database is to store many users. This is concept of sharing of data.
3. Security:
Data is IMP part of any organization & may be confidential such
confidential data must not be accessed by unauthorized persons or users.
The DBA is responsible for ensuring such kind of security has to design
proper authentication method for access of DBMS.
4. Integrity:
DBMS provides data integrity data integrity means data presentation
database is both accurate & consistent data enter in database should be
specified range of correct format.
Ex.: We can apply the constrains of database.
5. Centralize Control:
DBMS provide centralize control to database organize on may its data
central & content database by database administrator.
The advantage of database, the centralize control is we can easily
maintain backup & recovery.
Disadvantages of DMBS
1. Cost of S/W & H/W:
The main disadvantage of DBMS is cost. The cost of purchasing or
develop the S/W as well as H/W has to upgraded to allow for expensive
program & above the workspace require for their storage & execution.
Relational Database
1. Entity:
An entity can be a real-world object, that can be easily identifiable.
For Ex.: In a school database, students, teachers, classes & courses
offered can be considered as entities.
All these entities have some attributes of properties that give them their
identity.
2. Attribute:
Each object or entity having some property called as attribute.
Ex: The object person has properties like age, color & so on.
3. Domain:
Set of values of some datatype is called as domain.
The domain is set of homogenous members. A domain can be defined
as D.
There are two types of Domain
a) Atomic Domain:
The atomic domain is that it’s elements are non-composible or
indivisible.
Ex: Set of integers
b) Composite domain:
The composite domain is that its elements are composite & divisible.
Ex.: Attribute name could be composite
Name
First Name Middle Name Last Name
The domain for an attribute address specifies street no’s, street city,
state, considered as composite domain.
Tuples:
Object entity having attributes can be presented by an ordered set called as
tuples.
Ex.
Applicant
Name Age Profession
Ajit 20 S/W developer.
The applicant object can be represent by following values [Ajit, 20, S/W
develop]
This possible order obtained from Cartesian product of domain for attributes,
name, age & profession is called as tuple.
Tuple corresponds to records in the database file & set of tuples is called ds.
relation or database table.
Relations & their schemes:
Relational algebraic operations:
Relational algebra is a collection of operations that used to manipulated the
relations.
The relational algebraic operations are divided into two parts:
1. Basic set oriented operations, that contains
a. Union:
In this operation represent set or relation contains the tuples that
are either in the first relation or in second relation at in both of
them:Duplications eliminated in this operation.
Ex. Consider following two tables:
P Q
Id Name Id Name
101 Vaibhav 101 Vaibhav
102 Akshay 105 Vaijinath
103 Arun 106 Tanaji
104 Sudhir 102 Akshay
It P(P) & Q(Q) are the two compatible relations. The Union of P &
Q can be calculated as follow:
R= P U Q
Or
R= {t / t € p v t € Q}
Following table or relation shows the O/P of P U Q
R
Id Name
101 Vaibhav
102 Akshay
103 Arun
104 Sudhir
105 Vaijnath
106 Tanaji
b. Set the difference operation:
The difference operation removes common on tuples from first
relation.
It allows find tuples that are available in first relation but not in
other relation.
Ex.:
P Q
Id Name Id Name
101 Vaibhav 101 Vaibhav
102 Akshay 105 Vaijinath
103 Arun 106 Tanaji
104 Sudhir 102 Akshay
R= P - Q
Or
R= {t / t € p ˄ t € Q}
The O/P is
R
Id Name
103 Arun
104 Sudhir
c. Intersection operation:
The intersection operation success a display the common tuples
from the two relation.
This operation is represented as
Ex.:
P Q
Id Name Id Name
101 Vaibhav 101 Vaibhav
102 Akshay 105 Vaijinath
103 Arun 106 Tanaji
104 Sudhir 102 Akshay
R= P ˄ Q
Or
R = {t / t € p ˄ t € Q}
The O/P is,
R
Id Name
101 Vaibhav
102 Akshay
d. Cartesian product:
The Cartesian product of two relations is the concatenation of
tuples belonging to the two relation a new resultant relation’s
created.
Which is having all possible concatenation of tuples.
Ex.:
Emp Sal
Id Name Salary
e1 Amit 5000
e2 Amol 6000
e3 suman 7000
The cartetion product can be represented as,
R= Emp × Sal
or
Rahul 5000
Kailas 6000
Renuka 4000
Radhika 3000
Following is the representation of projection, operator.
╥ Emp_Name Employee
The result of above statement is as,
Emp_Name
Rahul
Kailas
Renuka
Radhika
ii) Selection (6):
In this type of operation it success only some of the types of the
relation:
Ex.:
Employee
Emp_Id Emp_Name Salary
e101 Rajesh 6000
e102 Rahul 7000
e103 Renuka 4000
e104 Radhika 8000
Selection operation are as follows:
Emp_Id = ‘e101’(Employee)
Then O/P is,
Employee
Emp_Id Emp_name Salary
e101 Rajesh 6000
iii) Join ( )
The join operation combines two relations to perform a finalize
relation ex.
Student Stud
Student_No Name Student_No City
1 Rahul 1 Latur
2 Rajesh 2 Pune
3 Radhika 3 Mumbai
It me wants join these table
then,
R = Student Stud
R=Employee/Projects
In the above employee
(e101, CA3404) & (e101, CA3405)
must both, we tuple in employee also it is true for (e103, CA3404) &
(e103, CA3405)
So the result of division operation are as follows:
R
Emp_Id
e101
e103