Mi0025 Database Management

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Name: Chandana.

Roll Number: 520927734

Learning Center: Sidvin Institute Of Management

Subject: Database Management

Assignment No:1

Date Of Submission: 09/10/2010

Answer the following:-

1Q.
Differentiate between Traditional File System & Modern Database System? Describe the
properties of Database & the Advantage of Database?

A.

1.4 Traditional File Systems Vs Modern Database Management Systems:

Traditional File System Modern Database Management


Systems
Traditional File system is the system This is the Modern way which has
that was followed before the advent of replaced the older concept of File
DBMS i.e., it is the older way. system.
In Traditional file processing, data · Data definition is part of the DBMS
definition is part of the application
program and works with only specific · Application is independent and can
application. be used with any application.
File systems are Design Driven; they · One extra column (Attribute) can be
require design/coding change when added without any difficulty
new kind of data occurs.
· Minor coding changes in the
E.g.:: In a traditional employee the Application program may be
master file has Emp_name, Emp_id, required.
Emp_addr, Emp_design, Emp_dept,
Emp_sal, if we want to insert one more
column ‘Emp_Mob number’ then it
requires a complete restructuring of the
file or redesign of the application code,
even though basically all the data
except that in one column is the same.
Traditional File system keeps Redundancy is eliminated to the
redundant [duplicate] information in maximum extent in DBMS if
many locations. This might result in properly defined.
the loss of Data Consistency.

For e.g.: Employee names might exist


in separate files like Payroll Master
File and also in Employee Benefit
Master File etc. Now if an employee
changes his or her last name, the name
might be changed in the pay roll
master file but not be changed in
Employee Benefit Master File etc.
This might result in the loss of Data
Consistency.
In a File system data is scattered in This problem is completely solved
various files, and each of these files here.
may be in different formats, making it
difficult to write new application
programs to retrieve the appropriate
data.
Security features are to be coded in the Coding for security requirements is
Application Program itself. not required as most of them have
been taken care by the DBMS.

· Hence, a data base management system is the software that manages a database, and is
responsible for its storage, security, integrity, concurrency, recovery and access.

· The DBMS has a data dictionary, referred to as system catalog, which stores data about
everything it holds, such as names, structure, locations and types. This data is also
referred to as Meta data.

2Q. What is the disadvantage of sequential file organization? How do you overcome it?
What are the advantages & disadvantages of Dynamic Hashing?
A. One disadvantage of sequential file organization is that we must use linear search or
binary search to locate the desired record and that results in more i/o operations. In this there
are a number of unnecessary comparisons. In hashing technique or direct file organization,
the key value is converted into an address by performing some arithmetic manipulation on
the key value, which provides very fast access to records.

Let us consider a hash function h that maps the key value k to the value h(k). The
VALUE h(k) is used as an address.

The basic terms associated with the hashing techniques are:

1) Hash table: It is simply an array that is having address of records.

2) Hash function: It is the transformation of a key into the corresponding location or


address in the hash table (it can be defined as a function that takes key as input and
transforms it into a hash table index).

3) Hash key: Let ‘R’ be a record and its key hashes into a key value called hash key.

Advantages of dynamic hashing:

1. The main advantage is that splitting causes minor reorganization, since only the
records in one bucket are redistributed to the two new buckets.

2. The space overhead of the directory table is negligible.

3. The main advantage of extendable hashing is that performance does not degrade as the
file grows. The main space saving of hashing is that no buckets need to be reserved for
future growth; rather buckets can be allocated dynamically.

Disadvantages:

1. The index tables grow rapidly and too large to fit in main memory. When part of the
index table is stored on secondary storage, it requires extra access.

2. The directory must be searched before accessing the bucket, resulting in two-block
access instead of one in static hashing.

3. A disadvantage of extendable hashing is that it involves an additional level of


indirection.
3Q. What is relationship type? Explain the difference among a relationship instance,

relationship type & a relation set?

A. Relationships:- In the real world, items have relationships to one another. E.g.: A
book is published by a particular publisher. The association or relationship that exists
between the entities relates data items to each other in a meaningful way. A relationship
is an association between entities.

Relationship set :-A collection of relationships of the same type is called a relationship
set.

Relationship instance:- data model objects are objects within the relationship instance
data model that have attributes which contain the data which should be used for a lookup
relationship. The primary objects in the relationship model are RelationshipInstance,
InstanceData, RoleInstance, KeyAttributeValue, and PropertyValue.

relationship type R A relationship type R is a set of associations between E, E2…..En


entity types mathematically, R is a set of relationship instances ri.

E.g.: Consider a relationship type WORKS_FOR between two entity types - employee
and department, which associates each employee with the department the employee
works for. Each relationship instance in WORKS_FOR associates one employee entity
and one department entity, where each relationship instance is ri which connects
employee and department entities that participate in ri.

Employee el, e3 and e6 work for department d1, e2 and e4 work for d2 and e5 and e7
work for d3. Relationship type R is a set of all relationship instances.
Figure 5.4: Some instances of the WORKS_FOR
relationship

You might also like