0% found this document useful (0 votes)
391 views10 pages

MI0025 Database Management System (MBA - Is)

The document discusses database management systems (DBMS) and related concepts. It compares traditional file systems to modern DBMS, describing advantages like increased data independence, reduced data redundancy, and centralized security features in DBMS. It defines data definition language (DDL) and data manipulation language (DML), describing the two main types of DML as high-level/non-procedural and low-level/procedural languages. It also discusses file allocation techniques on disks and different hashing techniques to improve search efficiency compared to sequential files.

Uploaded by

tushar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
391 views10 pages

MI0025 Database Management System (MBA - Is)

The document discusses database management systems (DBMS) and related concepts. It compares traditional file systems to modern DBMS, describing advantages like increased data independence, reduced data redundancy, and centralized security features in DBMS. It defines data definition language (DDL) and data manipulation language (DML), describing the two main types of DML as high-level/non-procedural and low-level/procedural languages. It also discusses file allocation techniques on disks and different hashing techniques to improve search efficiency compared to sequential files.

Uploaded by

tushar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Sikkim Manipal University

Q.1.(i) What do you understand by DBMS? What are the various


procedures carried on in a DBMS? Give a comparison between the
Traditional File Systems and Modern Database Management Systems.

Answer:
DBMS: - A DBMS is a complex set of software programs that control the
organization , storage and retrieval of data in a database.
The various procedures carried on in DBMS
1. The process of specifying the data types, structures and constraints
is called Defining the database.
2. The process of storing the data on some storage medium.
3. Manipulating the Database-involves the retrieval (activity of finding)
of required data and modifying it depending on the requirement.
Traditional file system Vs Modern Database Management System
Traditional file system Modern Database Management
System
Traditional file system is the system This is the Modern way which has
that was followed before the advent replaced the older concept of file
of DBMS i.e., it is the older way. system.
In Traditional file processing, data • Data definition is part of the
definition is part of the application DBMS
program and works with only specific • Application is independent and
application. can be used with any
application.
File systems are Design Drive; they • One extra column (Attribute)
require design/coding change when can be added without any
new kind of data occurs. difficulty.
E.g: In a traditional employee the • Minor coding changes in the
master file has Emp_name, Emp_id, Application program may be
Emp_addr, Emp_design, Emp_dept, required.

Database Management System


Page (MBA - IS)
1
Sikkim Manipal University

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 through
basically all the data except that in
one column is the same
Traditional file system keeps Redundancy is eliminated to the
redundant (duplication) information maximum extent in DBMS if properly
in many locations. This might result defined.
in the loss of Data Consistency.
E.g.: Employee names might exits in
separate file 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 applications
programs to retrieve the appropriate
data.
Security features are to be coded in Coding for a security requirement is
the application program itself. not required as most as of them has
been taken care by the DBMS.

Database Management System


Page (MBA - IS)
2
Sikkim Manipal University

Q.1. (ii) What do you understand by the Data independence? Describe


the different types of data independence. What do you understand by
DDL and DML? Describe the two main types of DML.

Answer:
Data independence
Data independence is defined as the ability to modify a schema definition in
one level without affecting a schema definition in a higher level.
There are two kinds.
1. Physical data independence:
This is the ability the physical scheme without causing application
programs to be rewritten. Modifications at this level are usually to
improve performance.
2. Logical data independence:
This is the ability to modify the conceptual scheme without causing
application programs to be rewritten. This is usually done when the logical
structure of database is altered. Logical data independence is harder to
achieve, as the application programs are usually heavily dependent on
the logical structure of the data. An analogy is made to abstract data
types in programming languages.

Data Definition Language (DDL):


The data definition language, used by the DBA and database designers to
define the conceptual and internal schemas.
 The DSMX has a DDL complier to process DDL statements in order to
identify the schema constructs, and to store the description in the
catalogue.
 In database where there is a separation between the conceptual and
internal schemes, DDL is used to specify the internal schema.
Database Management System
Page (MBA - IS)
3
Sikkim Manipal University

 For true three-schema architecture, VDL, view definition language, is


used to specify the user views and their mappings to the conceptual
schema. But is most DBMSs, the DDL is used to specify both the
conceptual schema and the external schemas.

Data Manipulation language (DMLs)


 Data manipulation language is a family of computer languages used by
computer programs or database users to retrieve, insert, delete and
update data in a database.
 Currently, the most popular data manipulation language is that of SQL,
which is used to retrieve and manipulate data in a Relational database.
 Other forms of DML are those used b IMS/DL1, CODASYL databases
(such as IDMS), and others.
 Data manipulation language was initially only used by computer
programs, but (with the advent of SQL) have come to be used by
people as well.
 Data manipulation languages have their functional capability organized
by the initial word in a statement, which is almost always a verb. In the
case of SQL, these verbs are “select”, “insert” and “delete”
 Data manipulation languages tend to have many different “flavors”
and capabilities between databases venders.
 There has been a standard established for SQL by ANSI, but venders
still “exceed” the standard and provide their own extensions.
Two main types of DML:
High-level/ Non procedural
 Can be used on its own to specify complex database operations.
 DBMSs allow DML statements to be entered interactively from a
terminal, or to be embedded in a programming language.

Database Management System


Page (MBA - IS)
4
Sikkim Manipal University

 If the commands are embedded in a general purpose programming


language, the statements must be identified, so they can be extracted
by a per-complier and processed by DBMS.
 High-level DMLs, such as SQL can specify and retrieve many records in
a single DML statement, and are called ‘set at time’ or ‘set oriented
DMLs’.
 High-level languages are often called declarative, because the DML
often specifies what to retrieve, rather than how to retrieve it.
Low Level/procedural
 Must be embedded in a general purpose programming language.
 Typically retrieves individual records or objects from the database and
processes each separately.
 Therefore it needs to use programming language constructs such as
loops.
 Low-level DMLs are also called ‘record at a time DMLs’ because of this.

Q.2.(i) Describe the process of file allocation on the Disk. Describe


briefly the different Hashing Technique.

Answer:
(i). There are several standards techniques for allocating the blocks of a file
on disk. In contiguous (sequential) allocation the file blocks are allocated to
consecutive disk blocks. This makes reading the whole file very fast, using
double buffering, but it makes reading the whole file very fast, and using
double buffering, but it makes expanding the file difficulty. A combination of
the two allocation clusters of consecutive disk blocks, and the clusters are
linked together. Clusters are sometimes called segments or extents.
File Headers: A file headers or file descriptor contains information about a
file, that is needed by the header and includes information to determine the
Database Management System
Page (MBA - IS)
5
Sikkim Manipal University

disk addresses of the file blocks as well as to record format descriptions


which may include filed lengths and order of fields within a record for fixed
length unplanned records and filed type codes, separator characters.
To search for a record on disk, one or more blocks are copied into main
memory buffers. Programs then search for the desired record utilizing the
information in the header. If the address of the block that contains the
desired record is not known, the search programs must do a linear search
through the file blocks. Each file block is copied into a buffer and searched
until either the record is located. This can be b\very time consuming for a
larger file.

(ii). Hashing technology


One disadvantage of sequential file organization is that we must use linear
search or binary search to locate the desire record and that results in more
I/O operations. In this there are a number of unnecessary comparisons. In
hashing technology 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.
Key Value-------------------------- Hash function ---------------- Address
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 are:
1. Hash table: it is simple 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.

Database Management System


Page (MBA - IS)
6
Sikkim Manipal University

Q.2. (ii) Describe the concept of variable length records. Describe the
characteristics of magnetic disk and magnetic tape storage devices.

Answer:
Variable length records
Computer-file record that may vary in the number of characters or fields it
includes from one record to another. Although a variable-length record may
have a maximum size, its length is otherwise determined by the amount of
information necessary to establish the record. For example, a name and
address record might require as few as four fields and as many as six or
even more. Variable-length records give the file owner added flexibility but
may consume more computer time than fixed-length records.

The characteristics of magnetic disk and magnetic tape storage


devices,
• Magnetic disks are used for storing large amount of data.
• The most basic unit of data on the disk is a single bit of information. By
magnetizing an area on disk in certain ways, we can represent a bit
value of either 0 (zero) or 1 (one). The capacity of a disk is the number
of bytes it can store, usually in kilobytes (Kbytes or 1000 bytes)
megabytes and gigabytes (gbyte or 1 billion bytes).
• Disks are all made of magnetic material shaped as a thin circular disk
and protected by plastic or acrylic cover.
• A disk is single sided if its store information on only one of its surfaces,
and double-sided if both surfaces are used.
• Information is stored on disk surface on concentric circles, each having
a distinct diameter. Each circle is called a track. For disk packs, the
tracks with the same diameter on the various surfaces are called a
cylinder. The concept of a cylinder in important, because data stores
Database Management System
Page (MBA - IS)
7
Sikkim Manipal University

on the same cylinder can be retrieved must faster than if it distributed


among different cylinders. Track usually contains a large amount of
information; it is divided into smaller blocks or sectors. A disk is called
a random access addressable device. Transfer of data between main
memory and disk takes place in units of blocks.
• The actual hardware mechanism that reads or writes a block is the disk
read/write head, which is part of a system called a disk drive.

Q.3. (i) Discuss the criteria for bad relational schemas. Discuss the
attribute semantics as an information measure of goodness of a
relation schema.

Answer:
The following are the good and bad relation schemas.
A. Semantic of attributes
B. Reducing the redundant values in tuples.
C. Reducing the null value in tuples
D. Disallowing spurious tuples.

A. Semantic of attributes:
Understanding the meaning of the attribute values in the tuple is the
attribute values in the tuple are referred as semantics. Addition to this
semantic also specifies how they are related to one another. Whenever
we groups attribute to form a relation, we assume that a certain meaning
is associated with the attributes. This meaning is called Semantics, and
specifies how the attribute values in a tuple relate to one another.
B. Reducing the redundant values in tuples:

Database Management System


Page (MBA - IS)
8
Sikkim Manipal University

Storage space is one of the most important considerations of a relational


schema. Improper grouping of attributes has a significant effect on the
storage space of the relation schema.
C. Reducing the null value in tuples:
These include unnecessary attribute in the relation. If many of the
attribute do not take any values, we insert NULL values. This can waste
space at the storage level, and it also leads to problems in understanding
the meaning of the attributes and specifying join operation. Nulls may
lead to counting problem while using aggregate functions.
As far as possible avoid using NULL values for attributes in a relation.
D. Disallowing spurious tuples:
Design relational schema so that they can be joined with equality
conditions.
Design relation schemas so that they can be joined with equality
conditions on attributes that are either primary key or foreign key. It
guarantees that no spurious tulpes are generated.

Q.3 (ii) Discuss the Transaction Processing Concepts. List and explain
the desirable properties of transactions.

Answer:
Transaction Processing Concepts.

Definition: a transaction is an atomic unit comprised of one or more SQL


statements. A transaction begins with the first executable statement and
ends when it is committed or rolled back.
Database Management System
Page (MBA - IS)
9
Sikkim Manipal University

The desirable properties of transactions.


To ensure data integrity, the database management system should maintain
the following transactions properties. These are often called the ACID
properties.
1. Atomicity:
A transaction is an atomic unit of processing. It is either performed in
its entirety (completely) or not performed at all.

2. Consistency:
The basic idea ensuring atomicity is as follows. The database system
keeps back of the old values of any data on which a transaction
performs a write, and if the transaction dose not complete its
execution, the old values are restored to make it appear as through
the transaction was never executed.

3. Durability:
Once a transaction changes the database and the changes are
committed, these must never be lost because of subsequent failures.
The users need not worry about the incomplete transactions. Partially
executed transactions can be rolled back to the original state; ensuring
durability is the responsibility of the recovery management component
of the DBMS.
-End of Assignment-

Database Management System


Page (MBA - IS)
10

You might also like