Escolar Documentos
Profissional Documentos
Cultura Documentos
Q.1 The data is stored in the form of tables which can be retrieved
efficiently by any program as per the request. Since the database
users are vast in number, the database provides authentication.
Explain the different types of database users.
ANS
Types of Database Users
Different persons who are involved in the design, usage and maintenance of a large
database include the following:
1. Database Administrator (DBA)
o Nave users They are the users accessing DBMS through menus.
System analysts collect the information regarding requirements of the end users and develop
specifications for canned transactions (standardised queries and updates with carefully
programmed data validity checking) that meet their requirements.
Primary Memory
Primary Memory is internal memory of the computer. RAM AND ROM both form part of
primary memory. The primary memory provides main working space to the computer.The
following terms comes under primary memory of a computer are discussed below:
Read Only Memory (ROM): There is another memory in computer, which is called
Read Only Memory (ROM). Again it is the ICs inside the PC that form the ROM. The
storage of program and data in the ROM is permanent.
EPROM: This stands for Erasable Programmable Read Only Memory, which
overcome the problem of PROM & ROM.
Cache Memory: The speed of CPU is extremely high compared to the access time of
main memory. Therefore the performance of CPU decreases due to the slow speed of main
memory.
Registers: The CPU processes data and instructions with high speed; there is also
movement of data between various units of computer.
Secondary memory
Secondary memory is external and permanent in nature. The secondary memory is concerned
with magnetic memory. Secondary memory can be stored on storage media like floppy disks,
magnetic disks, magnetic tapes, This memory can also be stored optically on Optical disks CD-ROM. The following terms comes under secondary memory of a computer are discussed
below:
Magnetic Tape: Magnetic tapes are used for large computers like mainframe
computers where large volume of data is stored for a longer time. In PC also you can use
tapes in the form of cassettes. The cost of storing data in tapes is inexpensive. Tapes consist
of magnetic materials that store data permanently. It can be 12.5 mm to 25 mm wide plastic
film-type and 500 meter to 1200 meter long which is coated with magnetic material.
Magnetic Disk: You might have seen the gramophone record, which is circular like a
disk and coated with magnetic material. Magnetic disks used in computer are made on the
same principle. It rotates with very high speed inside the computer drive. Data is stored on
both the surface of the disk. Magnetic disks are most popular for direct access storage device.
Each disk consists of a number of invisible concentric circles called tracks magnetic spot
Optical Disk: With every new application and software there is greater demand for
memory capacity. It is the necessity to store large volume of data that has led to the
development of optical disk storage medium. Optical disks can be divided into the following
categories:
1.
2.
3.
Q.3 Consider any one example of a relational database and show how the different
operations of relational algebra can be performed on the table showing the output.
ANS
Relational Algebra
The Relational Algebra was introduced by E. F. Codd in 1972. It consists of a set of
operations on relations. Some of them are as follows:
It acts as the building block for relational model operations.
It is the basis for RDBMS.
Few operation concepts are used in SQL in RDBMS
Relational algebra is classified based on two types, namely, mathematical set theory and
operations for relational databases.
Set theoretic operations Based on mathematical set theory, we have the following
operations in relational algebra:
Union
Intersection
Set difference
Cartesian product
Relational operations Based on operations for relational databases, we have the following
operations in relational algebra:
SELECT
PROJECT
JOIN
SELECT and PROJECT are the unary operations and JOIN is a binary relation. Unary
operations are the one that operate on one relation. Binary relations are the ones that operate
on two relations.
The two relations are said to require the table to be union compatible.
1. The two relations/tables (say R & S as shown in Tables 6.4(a) and 6.4(b)) have the same
number of columns (have the same degree).
2. Each column of the first relation/table must be either the same data type as the
corresponding column of the second relation/table(s).
R
Std_ID
Name
Std_ID
Name
Jyothi
Girija
Ganga
Ankitha
Girija
Tanvi
Ankitha
Manvi
Union ( ) - The union operation is denoted by symbol The result of this operation is
denoted by RS, in which R and S are relations and the result is also a relation that
includes all tuples that are either in R or in S or in both.
Intersection () The intersection operation is denoted by the symbol ." The
intersection operation selects the common tuples from the two relations.
For example, the result of the intersection operation in the above two relations is
given in Table 6.4(d)
Table 6.4(d): RS Relation
RS
Std_ID
3
4
Name
Girija
Ankitha
Cartesian products (X) The Cartesian product is denoted by the symbol X. For
example, let us assume R and S as relations with n and m attributes, respectively; the
Cartesian products R x S can be written as:
R(A1, A2, , An) S(B1, B2, , Bn)
The result of the above set operation is
Q (A1, A2, , An, B1, B2, , Bn)
Total number of columns in Q which is called as the degree (Q) = n + m
Total number of tuples in Q which is called as count (Q) = Number of tuples in R *
Number of tuples in S.
Relational operations
The SELECT operation: This operation selects required rows from the table. This
operation is used to select the subset of the tuples from a relation that satisfies a
selection condition or search criteria.
The PROJECT operation - Projection operation is used to select only few columns
from a table.
The JOIN operation This is denoted as Join (x). The capability of retrieving data
from multiple tables using a single SQL statement is one of the most powerful and useful
features of RDBMS
Q.4 Describe the different normal forms with one example throughout.
ANS
5 important normal forms
First Normal Form (1NF)
Tel. No.
26677780
2514890
9885643247
25234972
9912451356
The above table is not in 1NF since the field Tel. no. is multi-valued for std ID 202 and
304.
Std_
ID
Project_
Code
Hours
Std_ Name
Class
1 MBA
Proj_ name
Prof_
incharge
101
HMS1
20
Ranjith Jha
203
SIM2
30
303
DM1
15
Samiksha
Shukla
3 MBA
Hospital
Ms.
management Sahana
System
Table 4.5 (STUD_PROJ) is in 1NF but not in 2NF. Therefore, we need to decompose
the table as given in Figure 4.1.
Prof_id
Subjects
specialisation
Qualification
Dept_
Number
Dept_
Name
HOD_ID
Dr. Rao
A1
Finance
PhD
D1
Management
H2
Dr. Ravi
A2
Marketing
PhD
D1
Management
H2
Prof. Sanat
Sha
B1
Computer
science
MCA
D2
IT
H1
Prof. Neena
Gupta
B2
Sociology
MA,
MPhil
D3
Arts &
Humanities
H3
Figure 4.2 shows the decomposition of the above table to form 3NF.
Sub_name
Fac_incharge
Pushpa
Maths
Prof. Chidanand
Pushpa
Physics
Prof. Ramesh
Pushpa
Physics
Prof. Chidanand
Pushpa
Maths
Prof. Ramesh
Transaction commit - Transaction commit is responsible for making all the data
modifications permanent in the database. When transaction commit occurs, the following are
the observations:
o A commit record is made to indicate that the modifications are permanent, and this is
written to the log Depending upon the type of commit, the log information in memory is
simultaneously written to the disk.
o Locks are released. This means the modifications can be viewable. In this unit, you will
study the different recovery techniques in the database. You will study in detail about the
security and backup feature in a database.
Atomicity
Atomicity is a process where it states the database as a rule of ALL or NONE. If any one
part of the transaction fails, the whole transaction fails, and that transaction is said to be an
atomic transaction. A very critical characteristic of database management is that it has to
maintain atomic nature of transactions. An example of atomic transaction can be that of
ordering a plane ticket. In this case, there are two actions involved in this transaction.
Deferred update
It defers or postpones any actual updates to the database until the transaction completes its
execution successfully and reaches its commit point. During transaction execution, the
updates are recorded only in the log and in each buffer. After the transaction reaches its
commit point, the log is force written to the disk, that is, the updates are recorded in the
database. If a transaction fails before it reaches the commit point, there is no need to undo
any operations
Security
In this section, you will study how to secure databases against various threats. We will
provide you the introduction of the security issues and the various threats to the databases.
We shall also discuss how to handle these threats using some control measures. If you go
through this section, you will be able to understand the basic database security techniques.
System log
This contains events logged by any operating systems. For example, if any driver fails
booting during the initial process, that event is recorded in the system log. The operating
system finds the events that are logged by the system components beforehand.
Std_name
Std_add
MBA2001
Priyadarshini Bhat
MBA2002
Ashwini Sharma
MBA2003
Ravi Joshi
MBA2004
Shilpa Saxena
MBA2005
Rashi Khanna
The entity COURSE has got attributes Course id and Course name
COURSE
Course_id
Course_name
M1
Marketing
H1
Human Resource
IS1
Information Science
IT2
Information Technology
The relationship between the STUDENT and COURSE is identified by the relation
OPTED. Therefore, the relationship database has Std_id and
course_id as its attributes.
OPTED
Std_id
Course_id
MBA2001
M1
MBA2002
H1
MBA2003
IS1
MBA2004
IT2
MBA2005
M1
The same examples of queries are represented in the object-oriented database model as
given below.
1. When we require to know the course of the student with student ID MBA2005,
then the query may be
o Search STUDENT index for pointer to MB2005.
o Follow course pointer to M1 and return course name. It will return Marketing
2. For the query, name all students opting Marketing, then the query may be
o Search Course index and find Course id.
o Follow student pointers, looking up each std_id.
This process is called Navigation. You should note that the process relies on pointers
and for this reason pointers must be persistent. When this system was first initiated,
the querying varied considerably. But due to the existence of Object-Oriented Language
(OOL), it has become normalised.