Você está na página 1de 11

ASSIGNMENT SEM -3

MI0034 DATABASE MANAGEMENT SYSTEM

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)

2. Database Designers (DBD)


3. End users
4. System analysts and application programmers
5. DBMS designers and implementers

1. Database Administrator (DBA)


Database is one of the many primary resources that is used by many people in an
organisation.

The responsibilities of database administrator are listed below:


1. DBMS and related software are the secondary resources. Administering this secondary
resource is the responsibility of the database administrator.
2. He/she usually has the complete authority to access and monitor the database.
3. He/she is responsible for creating, modifying and maintaining the database.
4. He/she grants permission to the users of the database.
5. He/she stores the profile of each user in the database.
6. He/she defines procedures to recover the database resulting from failures due to human,
natural or hardware causes.

2. Database Designers (DBD)


A database designer designs the database in such a manner that it meets the requirements of
the clients.
3. End users
People who access the database, query and update the database and generate the various
reports; the database primarily exists for their use.
End users are of two types:
o Casual users They are the users accessing DBMS with SQL queries.

o Nave users They are the users accessing DBMS through menus.

4. System analysts and application programmers

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.

Application programmers implement specifications developed by the system analysts in the


form of programs. They are also responsible to test, debug, document and maintain these
programs. These are the programmers who write menus applications.
5. DBMS system designers and implementers
System Designers There need a detailed report to be generated to follow the rules of
development and integration of computer system to satisfy the business requirements.
Implementers implement the DBMS modules and interfaces as a software package.

Q.2 Computer storage is divided into primary memory and secondary


memory. Discuss with an example, the different types of primary
memory and secondary memory.
ANS

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:

Random Access Memory (RAM): The primary storage is referred to as random


access memory (RAM) because it is possible to randomly select and use any location of the
memory directly store and retrieve data.

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.

PROM: There is another type of primary memory in computer, which is called


Programmable Read Only Memory (PROM).

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.

Compact Disk/ Read Only Memory (CD-ROM


Write Once, Read Many (WORM)
Erasable Optical Disk

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).

Table 6.4(a): R Relation

Table 6.4(b): S Relation

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)

Second Normal Form (2NF)

Third Normal Form (3NF)


BoyceCode Normal Form (BCNF)

Fourth Normal Form (4NF)

Fifth Normal Form (5NF)

First Normal Form (1NF)


A relation is said to be in First Normal Form only if,
1. It is a relation.
2. It has no repeating rows.
3. Each attribute value is atomic.
If a relation does not satisfy any one of the above conditions then it is not in
1NF.
For example, consider the STUDENT schema having the fields as shown in
Table 4.3(a).

Table 4.3(a): Relation Schema of a STUDENT Relation


Std. ID Std_Name Class Address
201
Ranjith
X
#4,
Chokkanahalli,
202
Shivraj
XI Andheri (east) Mumbai
400064
304
Lavanya
X
#10, Dadra Post, Bandra
(east), Mumbai 400014

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.

Second Normal Form (2NF)


Second Normal Form is based on full functional dependency. A functional dependency is
said to be fully functional dependency. If we remove any attribute from the relation then
the dependency will be lost in the relation. According to R. Elmasri and S.B. Navathe, A
relation is said to be in 2NF only if the relation is in 1NF and every nonprime attribute in
the relation is fully functionaly dependent on the primary key of the relation.
For example, consider a STUD_PROJ relation as shown in Table 4.5.

Std_
ID

Project_
Code

Hours

Std_ Name

Class
1 MBA

Proj_ name

Prof_
incharge

101

HMS1

20

Ranjith Jha

203

SIM2

30

Meghna Sinha 2 MBA

Simulation of Mr. Murali


petrol bunk

303

DM1

15

Samiksha
Shukla

Data mining Mr.


in research Benjamin
analysis

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.

Third Normal Form (3NF)


According to R. Elmasri and S.B. Navathe, a relation is said to be 3NF, if it satisfies and
holds a nontrivial functional dependency either by
1. a super key of relation, or
2. a prime attribute of the relation.
3NF is based on transitive dependency.
Let us take an example of PROFESSOR relation as given in Table 4.6 for our
understanding of 3NF.

Table 4.6: PROFESSOR Relation


Prof_ name

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.

BoyceCodd Normal Form (BCNF)


BoyceCodd Normal Form is the simplest form of 3NF. But it is stricter than
3NF. Every relation in BCNF is also in 3NF but not all the relations in 3NFs need to
necessarily be in BoyceCodd Normal Form.
Fourth Normal Form (4NF)
An entity is in the Fourth Normal Form (4NF) if it is in 3NF and has entity which has
more than one one-to-many relationships in the relationship within the entity; if any
many-to-many relationship exists, they are resolved independently.
For example, consider the relation STUDENT as shown in Table 4.7(a)
which has three attribute names Std_name, Sub_name, Fac_incharge.
Table 4.7(a): STUDENT Relation
Std_name

Sub_name

Fac_incharge

Pushpa

Maths

Prof. Chidanand

Pushpa

Physics

Prof. Ramesh

Pushpa

Physics

Prof. Chidanand

Pushpa

Maths

Prof. Ramesh

Fifth Normal Form (5NF)


An entity is said to be Fifth Normal Form (5NF) if and only if it is in 4NF and every join
dependency for the entity is a consequence of its candidate keys. Join dependency
means every legal state of the relation should have no additive join decomposition.

Q.5 Write Short Notes on


a. Transaction Commit
b. Atomicity
c. Deferred update
d. Security
e. System log

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.

Q .6 With an example explain the working of ODBMS.


ANS
Consider an example of Student_Course relationship. The entity STUDENT has got
attributes std_id, std_name and std_address. The following will be the table for STUDENT
database.
STUDENT
Std_id

Std_name

Std_add

MBA2001

Priyadarshini Bhat

#16, Cambridge Layout, Bangalore

MBA2002

Ashwini Sharma

#45, Gupta Layout, Mumbai

MBA2003

Ravi Joshi

#54, Airport Road, Delhi

MBA2004

Shilpa Saxena

5th Main, BTM Layout, Bangalore

MBA2005

Rashi Khanna

#4, Kanaka Layout, Lucknow

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 examples of queries in relational database model are given below:


1. When we require to know the course of the student with student ID MBA2005,
then the query may be
o Go to OPTED and look up student with id MBA2005 and return the course_id.
It will return M1.
o Go to COURSE and look up M1 and return Marketing.
2. For the query, name all students opting Marketing, then the query may be
o Go to COURSE and find course_id.
It will return M1.
o Go to OPTED and look up M1 and return all std_id.
It will return MBA2001 and MBA2005.
o Go to STUDENT and find each std_id and return each std_name.
It will return Priyadarshini Bhat and Rashi Khanna. Figure 13.2
represents the object-oriented database model.

Fig. 13.2: Object-Oriented Database Model

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.

Você também pode gostar