DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 1 Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam 1A. Discuss the main characteristics of the database approach and how it differs from traditional file system. The main characteristics of the database approach versus the file-processing approach are the following: • Self-describing nature of a database system • Insulation between programs and data, and data abstraction • Support of multiple views of the data • Sharing of data and multiuser transaction processing Self-Describing Nature of a Database System A fundamental characteristic of the database approach is that the database system contains not only the database itself but also a complete definition or description of the database structure and constraints. This definition is stored in the DBMS catalog, which contains information such as the structure of each file, the type and storage format of each data item, and various constraints on the data. The information stored in the catalog is called meta-data, and it describes the structure of the primary database. The catalog is used by the DBMS software and also by database users who need information about the database structure. A general-purpose DBMS software package is not written for a specific database application, and hence it must refer to the catalog to know the structure of the files in a specific database, such as the type and format of data it will access. In traditional file processing, data definition is typically part of the application programs themselves. Hence, these programs are constrained to work with only one specific database, whose structure is declared in the application programs. Whereas file-processing software can access only specific databases, DBMS software can access diverse databases by extracting the database definitions from the catalog and then using these definitions. Insulation between Programs and Data, and Data Abstraction In traditional file processing, the structure of data files is embedded in the application programs, so any changes to the structure of a file may require changing all programs that access this file. By contrast, DBMS access programs do not require such changes in most cases. The structure of data files is stored in the DBMS catalog separately from the access programs. We call this property program-data independence. For example, a file access program may be written in such a way that it can access only STUDENT records. If we want to add another piece of data to each STUDENT record, say the BirthDate, such a program will no longer work and must be changed. By contrast, in a DBMS environment, we just need to change the description of STUDENT records in the catalog to reflect the inclusion of the new data item BirthDate; no programs are changed. The next time a DBMS program refers to the catalog, the new structure of STUDENT records will be accessed and used. In some types of database systems, such as object-oriented and object-relational systems, users can define operations on data as part of the database definitions. An operation (also called a function or method) is specified in two parts. The interface (or signature) of an operation includes the operation name and the data types of its arguments (or parameters). The implementation (or method) of the operation is
19
Embed
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER · PDF fileDATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 3 Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam Figure illustrates,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 1
Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam
1A. Discuss the main characteristics of the database approach and how it differs from traditional file
system.
The main characteristics of the database approach versus the file-processing approach are the following:
• Self-describing nature of a database system
• Insulation between programs and data, and data abstraction
• Support of multiple views of the data
• Sharing of data and multiuser transaction processing
Self-Describing Nature of a Database System
A fundamental characteristic of the database approach is that the database system contains not only the
database itself but also a complete definition or description of the database structure and constraints.
This definition is stored in the DBMS catalog, which contains information such as the structure of each file,
the type and storage format of each data item, and various constraints on the data. The information
stored in the catalog is called meta-data, and it describes the structure of the primary database.
The catalog is used by the DBMS software and also by database users who need information about the
database structure. A general-purpose DBMS software package is not written for a specific database
application, and hence it must refer to the catalog to know the structure of the files in a specific
database, such as the type and format of data it will access.
In traditional file processing, data definition is typically part of the application programs themselves.
Hence, these programs are constrained to work with only one specific database, whose structure is declared
in the application programs. Whereas file-processing software can access only specific databases, DBMS
software can access diverse databases by extracting the database definitions from the catalog and then
using these definitions.
Insulation between Programs and Data, and Data Abstraction
In traditional file processing, the structure of data files is embedded in the application programs,
so any changes to the structure of a file may require changing all programs that access this file. By contrast,
DBMS access programs do not require such changes in most cases. The structure of data files is stored in
the DBMS catalog separately from the access programs. We call this property program-data
independence. For example, a file access program may be written in such a way that it can access only
STUDENT records. If we want to add another piece of data to each STUDENT record, say the BirthDate,
such a program will no longer work and must be changed. By contrast, in a DBMS environment, we just
need to change the description of STUDENT records in the catalog to reflect the inclusion of the new
data item BirthDate; no programs are changed. The next time a DBMS program refers to the catalog, the
new structure of STUDENT records will be accessed and used.
In some types of database systems, such as object-oriented and object-relational systems, users
can define operations on data as part of the database definitions. An operation (also called a function or
method) is specified in two parts. The interface (or signature) of an operation includes the operation name
and the data types of its arguments (or parameters). The implementation (or method) of the operation is
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 2
Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam
specified separately and can be changed without affecting the interface. This may be termed program-
operation independence.
The characteristic that allows program-data independence and program-operation
independence is called data abstraction. A DBMS provides users with a conceptual representation of data
that does not include many of the details of how the data is stored or how the operations are
implemented. Informally, a data model is a type of data abstraction that is used to provide this
conceptual representation. The data model uses logical concepts, such as objects, their properties, and
their interrelationships, that may be easier for most users to understand than computer storage
concepts. Hence, the data model hides storage and implementation details that are not of interest to
most database users.
Support of Multiple Views of the Data
A database typically has many users, each of whom may require a different perspective or view of the
database. A multiuser DBMS whose users have a variety of distinct applications must provide facilities for
defining multiple views. For example, one user of the database of may be interested only in accessing
and printing the transcript of each student; the view for this user. A second user, who is interested only
in checking that students have taken all the prerequisites of each course for which they register, may
require the view. Hence a database must support multiple views of the database.
Sharing of Data and Multiuser Transaction Processing
A multiuser DBMS, as its name implies, must allow multiple users to access the database at the same time.
This is essential if data for multiple applications is to be integrated and maintained in a single database.
The DBMS must include concurrency control software to ensure that several users trying to update the
same data do so in a controlled manner so that the result of the updates is correct. For example, when
several reservation clerks try to assign a seat on an airline flight, the DBMS should ensure that each seat
can be accessed by only one clerk at a time for assignment to a passenger. These types of applications
are generally called online transaction processing (OLTP) applications. A fundamental role of multiuser
DBMS software is to ensure that concurrent transactions operate correctly.
1B. With a diagram, explain the component modules of a DBMS and their interactions
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 3
Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam
Figure illustrates, in a simplified form, the typical DBMS components. The database and the DBMS catalog
are usually stored on disk. Access to the disk is controlled primarily by the operating system (OS), which
schedules disk input/output. A higher-level stored data manager module of the DBMS controls access to
DBMS information that is stored on disk, whether it is part of the database or the catalog. The dotted
lines and circles marked A, B, C, D, and E in Figure illustrates accesses that are under the control of this
stored data manager. The stored data manager may use basic OS services for carrying out low-level data
transfer between the disk and computer main storage, but it controls other aspects of data transfer,
such as handling buffers in main memory. Once the data is in main memory buffers, it can be processed
by other DBMS modules, as well as by application programs.
The DDL compiler processes schema definitions, specified in the DOL, and stores descriptions of the
schemas (meta-data) in the DBMS catalog. The catalog includes information such as the names and sizes
of files, names and data types of data items, storage details of each file, mapping information among
schemas, and constraints.
The runtime database processor handles database accesses at runtime; it receives retrieval or update
operations and carries them out on the database. The query compiler handles high-level queries that
are entered interactively. It parses, analyzes, and compiles or interprets a query by creating database
access code, and then generates calls to the runtime processor for executing the code.
The precompiler extracts DML commands from an application program written in a host programming
language. These commands are sent to the DML compiler for compilation into object code for database
access. The rest of the program is sent to the host language compiler.
The client program that accesses the DBMS running on a separate computer from the computer on
which the database resides.
2A. What is entity type? What is entity set? Explain the differences among an entity and relationships
with examples.
Entity Types and Entity Sets: A database usually contains groups of entities that are similar. For
example, a company employing hundreds of employees may want to store similar information
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 4
Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam
concerning each of the employees. These employee entities share the same attributes, but each entity
has its own value(s) for each attribute. An entity type defines a collection (or set) of entities that have
the same attributes, for example two entity types in previous example are EMPLOYEE and COMPANY,
The collection of all entities of a particular entity type in the database at any point in time is called an
entity set.
An entity type is represented in ER diagrams as a rectangular box enclosing the entity type name.
Attribute names are enclosed in ovals and are attached to their entity type by straight lines. Composite
attributes are attached to their component attributes by straight lines. Multivalued attributes are
displayed in double ovals. The Entity is a real world object and relationship is association between two
or more entities.
(There is no much difference between entity and relationships. The question must me difference
between relationship type , relationship set and instances)
2B. What is meant by RAID? What are the different levels of RAID Technology? Explain
RAID, originally stands for Redundant Arrays of Independent Disks. The levels of RAID are as follows:
RAID level 0 uses data striping, has no redundant data and hence has the best write performance since
updates do not have to be duplicated. However, its read performance is not as good as RAID level 1,
which uses mirrored disks. In the latter, performance improvement is possible by scheduling a read
request to the disk with shortest expected seek and rotational delay. RAID level 2 uses memory-style
redundancy by using Hamming codes, which contain parity bits for distinct overlapping subsets of
components. Thus, in one particular version of this level, three redundant disks suffice for four original
disks whereas, with mirroring-as in level 1-four would be required. Level 2 includes both error detection
and correction, although detection is generally not required because broken disks identify themselves.
RAID level 3 uses a single parity disk relying on the disk controller to figure out which disk has failed.
Levels 4 and 5 use block-level data striping, with level 5 distributing data and parity information across
all disks. Finally, RAID level 6 applies the so-called P + Q redundancy scheme using Reed-Soloman
codes to protect against up to two disk failures by using just two redundant disks. Figure shows different
RAID Levels.
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 5
Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam
3A.Define Functional Dependency.
A functional dependency (FD) is a constraint between two sets of attributes in a relation from a
database.
Given a relation R, a set of attributes X in R is said to functionally determine another attribute Y,
also in R, (written X → Y) if and only if each X value is associated with precisely one Y value.
Customarily we call X the determinant set and Y the dependent attribute. Thus, given a tuple and the
values of the attributes in X, one can determine the corresponding value of the Y attribute. For the
purposes of simplicity, given that X and Y are sets of attributes in R, X → Y denotes that X functionally
determines each of the members of Y - in this case Y is known as the dependent set. Thus, a candidate
key is a minimal set of attributes that functionally determine all of the attributes in a relation.
3B. Define Normalization. Explain INF with example.
In the field of relational database design, normalization is a systematic way of ensuring that a database
structure is suitable for general-purpose querying and free of certain undesirable characteristics—
insertion, update, and deletion anomalies—that could lead to a loss of data integrity.
First normal form (1NF or Minimal Form) is a normal form used in database normalization. A
relational database table that adheres to 1NF is one that meets a certain minimum set of criteria. These
criteria are basically concerned with ensuring that the table is a faithful representation of a relation and
that it is free of repeating groups.
A table is in 1NF if and only if it is "isomorphic to some relation", which means, specifically, that it
satisfies the following five conditions:
1. There's no top-to-bottom ordering to the rows.
2. There's no left-to-right ordering to the columns.
3. There are no duplicate rows.
4. Every row-and-column intersection contains exactly one value from the applicable domain (and
nothing else).
DATABASE MANAGEMENT SYSTEM ,DEC 2010 ANSWER BANK 6
Prof. Sushant S.Sundikar DBMS Answer Bank , Dec 2010 Exam
5. All columns are regular [i.e. rows have no hidden components such as row IDs, object IDs, or
hidden timestamps].
Violation of any of these conditions would mean that the table is not strictly relational, and therefore
that it is not in 1NF. Examples of tables (or views) that would not meet this definition of 1NF are:
• A table that lacks a unique key. Such a table would be able to accommodate duplicate rows, in
violation of condition 3.
• A view whose definition mandates that results be returned in a particular order, so that the row
ordering is an intrinsic and meaningful aspect of the view. This violates condition 1. The tuples in
true relations are not ordered with respect to each other.
• A table with at least one nullable attribute. A nullable attribute would be in violation of
condition 4, which requires every field to contain exactly one value from its column's domain.
3C. Explain the different types of database operations of UPDATE that deals with constraint voilations
There are three basic update operations on relations: insert, delete, and modify. Insert is used to insert a
new tuple or tuples in a relation, Delete is used to delete tuples, and Update (or Modify) is used to
change the values of some attributes in existing tuples. Whenever these operations are applied, the
integrity constraints specified on the relational database schema should not be violated.
The Insert Operation
The Insert operation provides a list of attribute values for a new tuple t that is to be inserted
into a relation R. Insert can violate any of the four types of constraints discussed in the previous
section. Domain constraints can be violated if an attribute value is given that does not appear in
the corresponding domain. Key constraints can be violated if a ey value in the new tuple t
already exists in another tuple in the relation r(R). Entity integrity can be violated if the primary
key of the new tuple t is null. Referential integrity can be violated if the value of any foreign key
in t refers to a tuple that does not exist in the referenced relation. If an insertion violates one or
more constraints, the default option is to reject the insertion.