Vous êtes sur la page 1sur 20



Fourth Semester
Computer Science and Engineering
CS 2255/141405/CS 46/CS 1254/10144 CS 406/080250009 – DATABASE
(Common to Information Technology)
(Regulation 2008)
Time : Three Hours Maximum: 100 marks
Answer ALL questions.

PART A – ( 10 x 2 = 20 marks )

1. List four differences between file processing system and DBMS


a) Controlling redundancy
b) Restricting unauthorized access
c) Providing multiple user interfaces
d) Enforcing integrity constraints.
e) Providing back up and recovery

File Processing system

a) Data redundancy and inconsistency

b) Difficulty in accessing data
c) Data isolation
d) Integrity problems
e) Atomicity problems

2. What are the different types of data models?

A data model is a collection of conceptual tools for describing data, data

relationships, data semantics and consistency constraints.

Types of data model

1. Hierarchical model
2. Network model
3. Relational model
4. Entity-relationship
5. Object-relational model
6. Object model
3.Describe the circumstances in would you choose to use embedded SQL rather
than using SQL alone

The mixing of SQL statements with the programming language statements is

an efficient way of merging the strengths of two programming environment. The
programming language provides the flow of control,host variables, block
structure,conditional branching,looping facilities and input/output function etc
The sql handle the database access and manipulation
4.List two major problem with processing of update operation expressed in terms
of views

a. The view must be created on a single table

b. The primary key column of a table should be included in the view

c. Aggrigate function cannot be used in the select statement

5. Give an example of a relation schema R and a set of dependencies such that R

is in BCNF, but not in 4NF.

A relation is said to be in Boyce-Code normal form if it is already in the

third normal form and every determinant is a candidate key.


Dependency is


6. Why are certain functional dependencies called as trivial functional


A trivial functional dependency is a functional dependency of an attribute

on a superset of itself. {Employee ID, Employee Address} → {Employee
Address} is trivial, as is {Employee Address} → {Employee Address}.

7. List down the SQL facilities for concurrency.

1.Lock based protocol

2.Time stamp based protocol

8. What benefit does strict two-phase locking provide? What disadvantages


The two phase locking protocol ensures conflict serializability .consider any
transaction. The point in the schedule where the transaction has obtained its final
lock is called lock point of the transaction.


Two phase locking does not ensure freedom from deadlock

9. Mention the different Hashing techniques.

1.static hashing

2 Dynamic hashing

10. When is it preferable to use a dense index rather than a spare index? Explain
your answer.

Dense index-An dense index record, appears for every search key value in the file

Sparse index- An index record, appears for only some of the search key value

PART – B (5 x 16 = 80 marks )
11. (a) Discuss in detail about database system architecture with neat diagram.

Refer 1.8 from Technical publication


(b) Draw an E-R diagram for a banking enterprise with almost all components and

Refer 1.31 – 1.38 from Technical publication

12. (a) Explain in detail about Relational Algebra, Domain Relational Calculus
and Tuple Relational Calculus with suitable examples.
Refer 2.10,2.31,2.33 from Technical publication


(b) Briefly present a survey on Integrity and Security.

Refer 2.89,2.96 from Technical publication

13. (a) Explain in detail about 1NF, 2NF, 3NF and BCNF with suitable

Refer 3.16 -3.21from Technical publication

(b) Describe about the Multi-Valued Dependencies and Fourth normal form with
suitable example.

Refer 3.22 from Technical publication

14. (a) Discuss in detail about Transaction Recovery, System Recovery and
Media Recovery.

Refer 4.4 from Technical publication

(b) Write down in detail about Deadlock and Serializability.

Refer 4.41,4.16 from Technical publication

15. (a) Construct a B+ tree to insert the following key elements (order of the tree
is 3)
5, 3, 4, 9, 7, 15, 14, 21, 22, 23.

Refer p-129 from Technical publication


(b) Describe in detail about how records are represented in a file and how to
organize them in a file.

Refer 5.11,5.17 from Technical publication

Fourth Semester
Computer Science and Engineering

(Common to Information Technology)

(Regulation 2008)

Time: Three hours Maximum: 100 Marks

Answer ALL Questions

PART A — (10 × 2 = 20 Marks)

1. Explain the basic structure of a relational database with an example.

A relational DBMS organizes and accesses data according to

relationships among data items. The relationships among data items are expressed
by tables consisting of columns and rows. The order of the rows and columns is
not significant. Each column can contain one type of data, and each row can hold
one data value for each column.

2. What are the functions of a DBA?

The functions of a DBA

i.Schema definition
ii.Schema and physical organization modification

iii.Granting of authorization for data access

iv.Routine maintenance

3. Give the usage of the rename operation with an example.

In relational algebra , you can rename either the relation or the attributes or


i.P temp(bname,aname,bprice) (Book)

Here both relation name and attribute name are changed


Here only the relation name is changed


Here only the attribute name is renamed

4. What do you mean by weak entity set?

An entity that is existence dependent on some other entity is called weak

entity set.

5. What is normalization?

It is a process of analyzing the given relation schemas based on their

Functional Dependencies (FDs) and primary key to achieve the properties
1.Minimizing redundancy
2. Minimizing insertion, deletion and updating anomalies.
6. Write a note on functional dependencies.

Consider a relation schema R and AC R and BC R. The functional

dependency A->B holds on relational schema R if in any legal relation r(R), for all
pairs of tuples t1 and t2 in r such that t1 [A] =t1 [A], and also t1 [B] =t2 [B].

7. What do you mean by a transaction?

A database transaction is a unit of work performed against a database

management system or similar system that is treated in a coherent and reliable way
independent of other transactions.

8. Define the term ACID properties.

ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that

guarantee that database transactions are processed reliably.

Atomicity is an all-or-none proposition.

Consistency guarantees that a transaction never leaves your database in a half-

finished state.

Isolation keeps transactions separated from each other until they’re finished.

Durability guarantees that the database will keep track of pending changes in such
a way that the server can recover from an abnormal termination.

Above four rules are very important for any developers dealing with databases.

9. Describe flash memory.

It is always known as electrically erasable programmable read only emory

(EEPROM) . Flash memory is a purely electronic device with no mechanically
moving parts like disk arms in a magnetic disk drive. Hence, it supports uniform
random access speed. The time to access data in flash memory is almost linearly
proportional to the amount of data, regardless of their physical locations in flash
10. List out the physical storage media.


ii.main memory

iii.flash memory

iv.magnetic disk storage

v.optical storage

vi.tape storage

PART B — (5 × 16 = 80 Marks)

11. (a) (i) Discuss the various disadvantages in the file system and explain
how it can be overcome by the database system. (Marks 6)

Refer 1.5-1.7

(ii) What are the different Data models present? Explain in detail. (Marks 10)

Refer 1.10-1.16

(b) (i) Explain the Database system structure with a neat diagram. (Marks 10)

Refer 1.18-1.22

(ii) Construct an ER diagram for an employee payroll system. (Marks 6)

Refer 1.34
12. (a) (i) Explain the use of trigger with your own example. (Marks 8)

Refer 2.84-2.86

(ii) Discuss the terms Distributed databases and client/server databases. (Marks 8)

Refer 2.102-2.109
(b) (i) What is a view? How can it be created? Explain with an example. (Marks 7)

Refer 2.78-2.79

(ii) Discuss in detail the operators SELECT, PROJECT, UNION with suitable
examples. (Marks 9)
Refer 2.15-2.19 ,2.12-2.13

13. (a) Explain 1NF, 2NF and 3NF with an example. (Marks 16)

Refer 3.15-3.19
(b) Explain the Boyce-Codd normal form with an example. Also state how it
differs from that of 3NF. (Marks 16)

Refer 3.19-3.21

14. (a) (i) How can you implement atomicity in transactions? Explain. (Marks 8)

Refer 4.2

(ii) Describe the concept of serilalizability with suitable example. (Marks 8)

Refer 4.16-4.22
(b) How concurrency is performed? Explain the protocol that is used to maintain
the concurrency concept. (Marks 16)

Refer 4.32-4.40

15. (a) What is RAID? Explain it in detail. (Marks 16)

Refer 5.7-5.10
(b) Mention the purpose of indexing. How this can be done by B+ tree? Explain.
(Marks 16)

Refer 5.28-5.30


Fourth Semester
Computer Science and Engineering
(Common to Information Technology)
(Regulation 2008)
Time : Three hours Maximum : 100 Marks
Answer ALL questions
PART A — (10 × 2 = 20 Marks)
1. Define the two levels of data independence.

Data independence has two types. They are:

1. Physical Independence
2. Logical Independence.

Physical Independence: The logical scheme stays unchanged even though the
storage space or type of some data is changed for reasons of optimisation or
reorganisation. In this external schema does not change. In this internal schema
changes may be required due to some physical schema were reorganized here.
Physical data independence is present in most databases and file environment in
which hardware storage of encoding, exact location of data on disk,merging of
records, so on this are hidden from user

Logical Independence: The external scheme may stay unchanged for most
changes of the logical scheme. This is especially desirable as the application
software does not need to be modified or newly translated.

2. Write down any two major responsibilities of a database administrator.

A person who has central control over the system is called database
3. List out the various relational algebra operators.
4. What are the four broad categories of constraints?
i.Not null constraint
ii.Primary key constraint
iii.Foreign key constraint
iv.Unique key constraint
v.Check constraint

5. Define irreducible sets of dependencies.

A functional depending set S is irreducible if the set has the following three

1. Each right set of a functional dependency of S contains only one attribute.

2. Each left set of a functional dependency of S is irreducible. It means that
reducing any one attribute from left set will change the content of S (S will
lose some information).
3. Reducing any functional dependency will change the content of S.

Sets of Functional Dependencies (FD) with these properties are also called
canonical or minimal.

6. Define the third normal form.

A relation is said to be in third normal form if it is already in second normal
form and it has no transitive dependency.

7. What are ACID properties?

ACID (an acronymn for Atomicity Consistency Isolation Durability) is a

concept that Database Professionals generally look for when evaluating databases
and application architectures. For a reliable database all this four attributes should
be achieved.

Atomicity is an all-or-none proposition.

Consistency guarantees that a transaction never leaves your database in a half-

finished state.

Isolation keeps transactions separated from each other until they’re finished.
Durability guarantees that the database will keep track of pending changes in such
a way that the server can recover from an abnormal termination.

Above four rules are very important for any developers dealing with databases.

8. What are the three kinds of intent locks?

Three types of intention locks:
1. Intention-shared (IS) indicates that a shared lock(s) will be requested on
some descendant node(s).
2. Intention-exclusive (IX) indicates that an exclusive lock(s) will be requested
on some descendant node(s).
3. Shared-intention-exclusive (SIX) indicates that the current node is locked in
shared mode but an exclusive lock(s) will be requested on some descendant node

9. Which are the factors to be considered for the evaluation of indexing and
hashing techniques?
i.Access types
ii.Access time
iii.Insertion time
iv.Deletion time
v.Space overhead

10. What is the drawback of flash memory?

Flash memory differ from main memory in that data survive power failure.
Reading data from flash memory take less than 100 nanoseconds which is roughly
fast as reading data from main memory. Writing data to flash memory is more
complicated-data can be written once, which takes about 4 to 10 microseconds ,but
cannot be overwritten directly . To overwrite memory that has been written already
,we have to erase entire bank if memory at once, it is then ready to be written once.

PART B — (5 × 16 = 80 Marks)
11. (a) Explain the three different groups of data models with examples. (16)

Refer 1.10-1.16
(b) Describe the components of entity-relationship diagram with suitable
examples. (16)

Refer 1.31-1.43
12. (a) Describe the features of Embedded SQL and Dynamic SQL. Give suitable
examples. (16)

Refer 2.98-2.101
(b) Write short notes on the following :
(i) Mandatory access control. (9)

 In many applications, and additional security policy is needed that lassifies

data and users based on security classes.
 This approach as mandatory access control, would typically be combined
with the discretionary access control mechanisms.
 Typical security classes are top secret (TS), secret (S), confidential (C), and
unclassified (U), where TS is the highest level and U the lowest: TS ≥ S ≥ C

(ii) Missing information. (7)

Refer 2.101

13. (a) Explain non loss decomposition and functional dependencies with suitable
example. (16)

Refer 3.12,3.2-1.8
(b) Discuss Join Dependencies and Fifth Normal Form, and explain why 5NF? (16)

Refer 3.26-3.34

14. (a) (i) State the Two-Phase Commit protocol. Discuss the implications of a
failure of the coordinator and some participants. (10)

Refer 4.35-4.37
(ii) Briefly explain transaction recovery with primitive operations. (6)

Refer 4.4-4.5
(b) (i) State and explain the three concurrency problems. (9)

Refer 4.12-4.16

(ii) What is meant by isolation level and define the five different
isolation levels. (7)

Refer 4.9-4.10

15. (a) (i) Discuss the improvement of reliability and performance of RAID (8)

Improved Reliability:In a centralised DBMS, a server failure stops the

operations of the DBMS. Though, a failure at single site of a DDBMS, or a failure
of a communication link creation some sites inaccessible, does not make the whole
system inoperable. Distributed DBMSs are designed to continue to function despite
such as failures. In particular, if data are replicated in various sites, a transaction
requiring a particular data item may find it at various sites. Therefore, the failure of
a site does not necessarily imply the shutdown of the system.

The failure of one site must be identified by the system, and appropriate
action may be required to recover from the failure. The system has no longer used
the services of the failed site. At last, when the failed site recovers or is repaired,
mechanisms have to be available to integrate it smoothly back into the system. The
recovery from failure in distributed systems is much more difficult than in a
centralised system.

Also Refer 5.7-5.10

(ii) Explain the structure of a B+-tree. (8)

Refer 5.26-5.27

(b) Explain the complex selection predicates with example. (16)

Refer 5.42-44
Fourth Semester
Computer Science and Engineering
(Common to Information Technology)
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL question

PART A — (10 2 = 20 marks

1.Data models

Underlying the structure of a database is the data model: a collection of

conceptual tools for describing data, data relationships, data semantics, and
consistency constraints.

2.With an example What a derive attribute is?

Derived attribute. The value for this type of attribute can be derived from
the values of other related attributes or entities. For instance, let us say that the
customer entity set has an attribute loans-held, which represents how many loans a
customer has from the bank.We can derive the value for this attribute by counting
the number of loan entities associated with that customer.

3. Consider the following relation :

BASIC_PAY, DEPT) Develop an SQL query that will find and display the average
select avg(BASIC_PAY) from emp where dept=”cse”;

select avg(BASIC_PAY) from emp where dept=”eee”;

4.List the two types of embedded SQL SELECT statement

i.<attribute name> <comparision operator><constant value>

ii.<attribute name><comparision operator><attributename>

5. Consider the following relation :
R (A, B, C, D, E) The primary key of the relation is AB. The following functional
dependencies hold :
Is the above relation in second normal form?

Yes . Above relation is second normal form .

A relation is said to be in second normal form , if it is in first normal form and no

partial functionaldependency

6. Consider the following relation :

R(A, B, C, D)
The primary key of the relation is A. The following functional dependencies
hold :
A ->B,C
B ->D
Is the above relation in third normal form?

Yes above relation is third normal form. A relation is said to be in third normal
form , if it is in second normal form and no trivial functional dependency

7. List the two commonly used Concurrency Control techniques

1.lock based protocol

2.timestamp based protocol

8. List the SQL statements used for transaction control




9. What are ordered indices?

Primary index
Secondary index

10.Distinguish between sparse index and dense index.

Dense index: An index record appears for every search-key value in the file. In
a dense primary index, the index record contains the search-key value and a pointer
to the first data record with that search-key value. The rest of the records with the
same search key-value would be stored sequentially after the first record, since,
because the index is a primary one, records are sorted on the same search key.
Dense index implementations may store a list of pointers to all records with the
same search-key value; doing so is not essential for primary indices
Sparse index: An index record appears for only some of the search-key values. As
is true in dense indices, each index record contains a search-key value and a
pointer to the first data record with that search-key value. To locate a record, we
find the index entry with the largest search-key value that is less than or equal to
the search-key value for which we are looking.We start at the record pointed to by
that index entry, and follow the pointers in the file until we find the desired record.

PART B — (5 16 = 80 marks)
11. (a) (i) Construct an E-R diagram for a car-insurance company whose customers
own one or more cars each. Each car has associated with it zero to any number of
recorded accidents. State any assumptions you make. (6)

Refer 1.38

(ii) A university registrar’s office maintains data about the following entities :
(1) Courses, including number, title, credits, syllabus, and prerequisites;
(2) Course offerings, including course number, year, semester, section number,
instructor, timings, and classroom;
(3) Students, including student-id, name, and program; and
(4) Instructors, including identification number, name, department, and title.
Further, the enrollment of studentsin courses and grades awarded to students in
each course they are enrolled for must be appropriately modeled. Construct an E-R
diagram for the registrar’s office. Document all assumptions that you make about
the mapping constraints.(10)

Refer p-36

(b) (i) With a neat sketch discuss the three-schema architecture of a DBMS. (8)

Refer 1.18

(ii) What is aggregation in an ER model? Develop an ER diagram using

aggregation that captures the following information : Employees work for projects.
An employee working for a particular project uses various machinery. Assume
necessary attributes. State any assumptions you make. Also discuss about the ER
diagram you have designed. (2 + 6)

Refer 1.42-1.43

12. (a) (i) Explain the distinctions among the terms primary key, candidate key,
and super key. Give relevant examples. (6)

Refer 1.30
(ii) What is referential integrity? Give relevant example. (4)

Refer 2.94-2.96

(iii) Consider the following six relations for an Order-processing Database

Application in a Company :
Here, ORD_AMT refers to total amount of an order; ODATE is the date the order
was placed; SHIP_DATE is the date an order is shipped from the warehouse.
Assume that an order can be shipped from several warehouses. Specify the foreign
keys for this schema, stating any assumptions you make. (6)

Refer p-34
(b) With relevant examples discuss the various operations in Relational Algebra.


13. (a) Define a functional dependency. List and discuss the six inference rules for
functional dependencies. Give relevant examples. (16)

Refer 3.2-3.8
(b) (i) Give a set of Functional dependencies for the relation schema R(A,B,C,D,E)
with primary key AB under which R is in 2NF but not in 3NF. (5)

Refer 3.17

(ii) Prove that any relation schema with two attributes is in BCNF.(5)

Refer 3.19-3.20

(iii) Consider a relation R that has three attributes ABC. It is decomposed into
relations R1 with attributes AB and R2 with attributes BC. State the definition of
lossless-join decomposition with respect to this example. Answer this question
concisely by writing a relational algebra equation involving R, R1, and R2. (6)

Refer 3.13(example 3.1)

14. (a) (i) Define a transaction.Then discuss the following with relevant
(1) A read only transaction
(2) A read write transaction
(3) An aborted transaction

Refer 4.1,4.2,4.4

(ii) With a neat sketch discuss the states a transaction can be in. (4)

Refer 4.4
(iii) Explain the distinction between the terms serial schedule and serializable
schedule. Give relevant example. (4)

Refer 4.14(fig 4.3,4.4) and 4.19(fig 4.7,4.8,4.9)

(b) (i) Discuss the ACID properties of a transaction. Give relevant example. (8)

Refer 4.1-4.3
(ii) Discuss two phase locking protocol. Give relevant example. (8)

Refer 4.35-4.37
15. (a) (i) When is it preferable to use a dense index rather than a sparse index?
Explain your answer. (4)

Refer 5.22-5.23
(ii) Since indices speed query processing, why might they not be kept on several
search keys? List as many reasons as possible.(6)

Refer 5.28
(iii) Explain the distinction between closed and open hashing. Discuss the relative
merits of each technique in database applications. (6)
Open Hashing
• Open Hashing means that collisions are resolved by storing the colliding
object in a separate area.
• In essence, the objects that collide form linked lists, where the head of the
list is the original hash location. Thus, the name Separate Chaining.
• One variation of open hashing is called Bucket Hashing.
Closed Hashing
• In closed hashing, objects that collide are stored within the hash table itself.
• This can create an addition problem called a Secondary Collision.
• Two general methods to resolve collisions in closed hashing are called
Probing and Double Hashing.
(b) Diagrammatically illustrate and discuss the steps involved in
processing a query. (16)
Refer 5.39-5.40