21(a) Answer

Indexed sequential file organization. =In indexed sequential file organization, the records are stored in sequence according to a primary key and an index is created to allow random access of the file. This type of organization also allows the file to be accessed sequentially. Indexed sequential is the most commonly used type of file organization. A sequential file contains records organized in the order they were entered. The order of the records is fixed. The records are stored and sorted in physical, contiguous blocks within each block the records are in sequence. Records in these files can only be read or written sequentially. Once stored in the file, the record cannot be made shorter, or longer, or deleted. However, the record can be updated if the length does not change. (This is done by replacing the records by creating a new file.) New records will always appear at the end of the file. If the order of the records in a file is not important, sequential organization will suffice, no matter how many records you may have. Sequential output is also useful for report printing or sequential reads which some programs prefer to do.

22(b) concept of multiple access key
A technique for locating stored data in a computer system by using the values contained in two or more separate key fields.

In a web browser, an access key or accesskey allows a computer user immediately to jump to a specific part of a web page via the keyboard. They were introduced in 1999 and quickly achieved near-universal browser support. In the summer of 2002, a Canadian Web Accessibility[1] consultancy did an informal survey to see if implementing accesskeys caused issues for users of adaptive technology, especially screen reading technology used by blind and low vision users. These users require numerous keyboard shortcuts to access web pages, as “pointing and clicking” a mouse is not an option for them. Their research showed that most key stroke combinations did in fact present a conflict for one or more of these technologies, and their final recommendation was to avoid using accesskeys altogether.

The ER data modeling techniques is based on the perception of a real world that consists of a set of basic objects called entities, and of relationships among these objects. In ER modeling, data is described as entities, relationships, and attributes. In the following section, entities and attributes are discussed. Later, entity types, their key attributes, relationship types, their structural constraints, and weak entity types are discussed. In the last, we will apply ER modeling to our case study problem "Library management system".

Entities and Attributes
One of the basic components of ER model is entity. An entity is any distinguishable object about which information is stored. These objects can be person, place, thing, event or a concept. Entities contain descriptive information. Each entity is distinct.

An entity may be physical or abstract. A person, a book, car, house, employee etc. are all physical entities whereas a company, job, or a university course, are abstract entities.


After you identify an entity, then you describe it in real terms, or through its attributes. Attributes are basically properties of entity. We can use attributes for identifying and expressing entities. For example, Dept entity can have DeptName, DeptId, and DeptManager as its attributes. A car entity can have modelno, brandname, and color as its attributes. A particular instance of an attribute is a value. For example, "Bhaskar" is one value of the attribute Name. Employee number 8005 uniquely identifies an employee in a company. The value of one or more attributes can uniquely identify an entity.

Fig 7.7 - Entity and its attributes In the above figure, employee is the entity. EmpNo, Name, Designation and Department are its attributes. An entity set may have several attributes. Formally each entity can be described by set of <attribute, data value> pairs.

25(a) concept of two phase commit protocol
In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of atomic commitment protocol (ACP). It is a distributed algorithm that coordinates all the processes that participate in a distributed atomic transaction on whether to commit or abort (roll back) the transaction (it is a specialized type of consensus protocol). The protocol achieves its goal even in many cases of temporary system failure (involving either process, network node, communication, etc. failures), and is thus widely utilized.[1][2][3] However, it is not resilient to all possible failure configurations, and in rare cases user (e.g., a system's administrator) intervention is needed to remedy outcome. To accommodate recovery from failure (automatic in most cases) the protocol's participants use logging of the protocol's states. Log records, which are typically slow to generate but survive failures, are used by the protocol's recovery procedures. Many protocol variants exist that primarily differ in logging strategies and recovery mechanisms. Though usually intended to be used infrequently, recovery procedures comprise a substantial portion of the protocol, due to many possible failure scenarios to be considered and supported by the protocol.

In a "normal execution" of any single distributed transaction, i.e., when no failure occurs, which is typically the most frequent situation, the protocol comprises two phases:
1. The commit-request phase (or voting phase), in which a coordinator process attempts to prepare all the transaction's participating processes (named participants, cohorts, or workers) to take the necessary steps for either committing or aborting the transaction and to vote, either "Yes": commit (if the transaction participant's local portion execution has ended properly), or "No": abort (if a problem has been detected with the local portion), and 2. The commit phase, in which, based on voting of the cohorts, the coordinator decides whether to commit (only if all have voted "Yes") or abort the transaction (otherwise), and notifies the result to all the cohorts. The cohorts then follow with the needed actions (commit or abort) with their local transactional resources (also called recoverable resources; e.g., database data) and their respective portions in the transaction's other output (if applicable).

Note that the two-phase commit (2PC) protocol should not be confused with the two-phase locking (2PL) protocol, a concurrency control protocol.

Ans:26)Relational algebra operations
Operations in the Relational Data Model are defined by Relational Algebra. Relational Algebra is not based on the attributes, but rather on the order of values (components) in the tuple. There are five basic operations [7]:
1. Union, 2. Difference, 3. Cartesian Product, 4. Projection, 5. Selection.

The Union of relations


is defined as:
(3.2 )

It is the set of tuples that are in or . This operation may be applied to the relations of the same arity only, so all the tuples in the result have the same number of components (values).

The Difference of relations


, defined as:
(3.3 )

It is the set of tuples which are in the same arity.

but not in

. It is required that



The Cartesian Product of relations


is defined as:
(3.4 )

Assume that

has arity


has arity


is defined as the set of all

possible (

)-tuples which first

components form a tuple in

and last

form a tuple in

. The result has the arity equal to


The Projection is denoted as

. Assuming that there is a relation

of arity

, then:
(3.5 )

It denotes the projection of

onto components

, where

are distinct

integers in range

. That is the set of


such that

there is some



for which



For example

is computed by taking each tuple from

, and forming a 2-tuple set

from fourth and second component of . Instead of using locations, attribute names can be used as well. Assuming that above projection can also be denoted as by the following relation schema: The Selection is denoted as:
(3.6 )

is the relation schema for the above relation. Then the . The resulting relation . can be described

Where •

is a relation and

is a formula involving: is

Operands that are constants or component numbers; component

represented by


The arithmetic comparison operators







The logical operators





is the set of tuples


such that, when for all


-th component

of is substituted for any occurrences of in formula , the formula becomes true. As for projection if a relation has named columns, then the formula in the

selection can refer to columns by name instead of by number. The arity of the same as the arity of .


There are also some other algebraic operations defined as: Intersection, Quotient, Join, Natural Join or Semijoin. They are all derived from the basic ones. The Intersection can be defined as:
(3.7 )

Thus its functionality is provided by difference, that is why it is not considered to be recognized as a basic operation.

The Quotient of relations of arity )-tuples is in : and


is denoted as , and

. Assuming that


are relations

respectively, and

. Then the quotient is a set of all ( -tuples in , the tuple

, such that for all

(3.8 )

The Join (also known as

-Join) of


on columns and

is defined as:
(3.9 )


is a comparison operator which complies with the definition 3.6, and


the arity of

. In other words, these are all the tuples in the Cartesian product of


such that the

-th component of

stands in relation

to the


component of

. If

is '

' then the operation is called the


The Natural Join is a special case of the Join. It is applicable only when both columns that are named by attributes. Assuming that names used for both and , then the Natural Join is defined as:



are all the attribute

(3.1 0)

such that

is the list of all components of

, in order, except the



The Semijoin of relation of of the natural join of

by relation and :

, written

, is the projection onto the attributes

(3.1 1)


stands for the list of attributes of


Relational Algebra becomes a natural way to formulate queries. Having selection and projection, a question about a single relation can be asked. Adding Cartesian product, the query can concern more than one relation. Applying union or difference, several queries can be combined, to form a more sophisticated one.