0% found this document useful (0 votes)
291 views9 pages

DBMS Answer Key

This document is a question paper for the M.C.A. degree end semester examination on Database Management Systems from K.S.R. College of Engineering. It includes various topics such as differences between file processing systems and DBMS, types of data models, SQL queries, database security, and DBA responsibilities. The paper is structured into multiple parts with questions requiring detailed answers on database concepts and operations.

Uploaded by

yogu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
291 views9 pages

DBMS Answer Key

This document is a question paper for the M.C.A. degree end semester examination on Database Management Systems from K.S.R. College of Engineering. It includes various topics such as differences between file processing systems and DBMS, types of data models, SQL queries, database security, and DBA responsibilities. The paper is structured into multiple parts with questions requiring detailed answers on database concepts and operations.

Uploaded by

yogu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

K.S.R.

COLLEGE OF ENGINEERING, TIRUCHENGODE – 637215

(AUTONOMOUS)
QUESTION PAPER CODE: 161592
M.C.A. DEGREE END SEMESTER EXAMINATION, DEC 2016 / JAN 2017
FIRST SEMESTER
CA16114 – DATABASE MANAGEMENT SYSTEMS
(REGULATIONS 2016)
ANSWER ALL QUESTIONS
PART A – (10 X 2 = 20 MARKS)

1. Differentiate File Processing System and DBMS (any four)

 A database management system coordinates both the physical and the logical access to
the data, whereas a file-processing system coordinates only the physical access.

 A database management system reduces the amount of data duplication by ensuring t


hat a physical piece of data is available to all programs authorized to have access to it,
whereas data written by one program in a file-processing system may not be readable
by another program.

 A database management system is designed to allow flexible access to data (i.e.,


queries), whereas a file-processing system is designed to allow predetermined access to
data (i.e., compiled programs).

 A database management system is designed to coordinate multiple users accessing the


same data at the same time. A file-processing system is usually designed to allow one or
more programs to access different data files at the same time. In a file-processing
system, a file can be accessed by two programs concurrently only if both programs have
read-only access to the file.

 Redundancy is control in DBMS, but not in file system

 Unauthorized access is restricted in DBMS but not in file system.

 DBMS provide backup and recovery. When data is lost in file system then it not recover.

 DBMS provide multiple user interfaces. Data is isolated in file system.

2. Different types of Data Models in DBMS


 Hierarchical database model.
 Network model.

 Relational model.

 Entity–relationship model. Enhanced entity–relationship model.

 Object model.
 Document model.

 Entity–attribute–value model.

 Star schema.

3. Writing queries in SQL is typically much easier than coding the same queries in general-
purpose programming language. However not all kinds of queries can be written in SQL.
Also no declarative actions such as printing a report, interacting with a user, or sending
the results of a query to a graphical user interface cannot be done from within SQL.
Under circumstances in which we want the best of both worlds, we can choose embedded
SQL or dynamic SQL, rather than using SQL alone or using only a general-purpose
programming language. Embedded SQL has the advantage of programs being less
complicated since it avoids the clutter of the ODBC or JDBC function calls, but requires
a specialized preprocessor

4. List two major problems with processing update operations expressed in terms of views.
Answer: Views present significant problems if updates are expressed with them. The
difficulty is that a modification to the database expressed in terms of a view must be
translated to a modification to the actual relations in the logical model of the database.
a. Since the view may not have all the attributes of the underlying tables, insertion
of a tuple into the view will insert tuples into the underlying tables, with those attributes
not participating in the view getting null values. This may not be desirable, especially if
the attribute in question is part of the primary key of the table.

b. If a view is a join of several underlying tables and an insertion results in tuples


with nulls in the join columns, the desired effect of the insertion will not be achieved. In
other words, an update to a view may not be expressible at all as updates to base
relations. For an explanatory example, see the loan-info

5. Define Lossless Join Dependencies.

Let R be a relation schema. Let F be a set of functional dependencies on R. Let and form
a decomposition of R. The decomposition is a lossless-join decomposition of R if at least
one of the following functional dependencies is in F+

6. Why is functional dependencies used in database system.

In relational database theory, a functional dependency is a constraint between two sets of


attributes in a relation from a database. In other words, functional dependency is a
constraint that describes the relationship between attributes in a relation. Y is a function of
X.

7. Why do need query Optimization?

Query optimization is a function of many relational database management systems. The


query optimizer attempts to determine the most efficient way to execute a given query by
considering the possible query plans.

8. How do you use serializability in data transactions?


Serializability is used to keep the data in the data item in a consistent state. Serializability
is a property of a transaction schedule (history). It relates to the isolation property of a
database transaction.

9. Identify the use of indexing in database.

Indexes are special lookup tables that the database search engine can use to speed up data
retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very
similar to an index in the back of a book.

10. Define Shadow Paging.

Shadow paging is a technique for providing atomicity and durability (two of the ACID
properties) in database systems. A page in this context refers to a unit of physical storage
(probably on a hard disk), typically of the order of 210 to 216 bytes.

Part B – (5 X 12 = 60 Marks)

11.(a)(i)

11.(a).(ii) Following are the components of the storage manager;

1. Authorization and Integrity Manager: It tests the integrity constraints and checks the
authorization of users to access data.
2. Transaction Manager: It ensures that no kind of change will be brought to the database
until a transaction has been completed totally.

3. File Manager: It manages the allocation of space on disk storage and the data structures
used to represent information stored on disk.
4. Buffer Manager:It decides which data is in need to be cached in main memory and then
fetch it up in main memory. This is very important as it defines the speed in which the
database can be used.

11.(b)(i) We have three levels of abstraction:


Physical level: This is the lowest level of data abstraction. It describes how data is actually
stored in database. You can get the complex data structure details at this level.

Logical level: This is the middle level of 3-level data abstraction architecture. It describes what
data is stored in database.

View level: Highest level of data abstraction. This level describes the user interaction with
database system.

11.(b)(ii) DBA Responsibilities

 Maintaining all databases required for development, testing, training and production
usage
 Maximizing uptime of databases

 Managing share resources used amongst applications

 Administrates all database objects, including tables, views, indexes, stored


procedures, functions, packages, sequences and clusters

 Enforces and maintains database constraints to ensure integrity of the database

 Installation and configuration of DBMS server software and related products.

 Upgrading and patching/hot-fixing of DBMS server software and related products.

 Assists with impact analysis of any changes made to the database objects.

 Migrate database to another server.

 Evaluate DBMS features and DBMS related products.

 Ensure that the site is running the products that are most appropriate

 ensure that any new product usage or release upgrade takes place with minimal
impact

 Establish and maintain sound backup and recovery policies and procedures.

 Take care of the Database design and implementation.

 Implementing HA Solution (Replication, Clustering, Mirroring and Log Shipping)


 Implement and maintain database security (create and maintain logins, users and roles, assign
privileges).

 Performance tuning and health monitoring on DBMS, OS and application.

 Setting Up Server Level, Database Level and Operating System Alerts

 Implementation of robust maintenance plan (Index Defrag, Stats Update, DBCC, Reorg
etc)

 SQL Server T-SQL/ Oracle PL-SQL Tuning

 Setup and maintain documentation and standards.

 Perform reviews on the design and code frequently to ensure the standards are
being adhered to

 Plan growth and changes (capacity planning).

 Do general technical troubleshooting and give consultation to development teams.

 Troubleshooting on DBMS and Operating System performance issue

 Documentation of any implementation and changes (database changes, reference data


changes and application UI changes etc)

 Be able to provide a strategic database direction for the organization.

 Expert level knowledge of DBMS Architecture, all features in all versions and troubleshooting skill

 Excellent knowledge of DMBS backup and recovery scenarios.


 Good skills in all DMBS tools.
 A good knowledge of DMBS security management.
 A good knowledge of how DMBS acquires and manages resources.
 Sound knowledge of the applications at your site.

A DBA should possess a sound understanding of the business.

 Knowledge on Operating System


 Work as part of a team and provide 7×24 supports when required.

 Interface with DBMS Corporation for technical support.

 A DBA should have sound communication skills with management, development


teams, vendors, systems administrators and other related service providers.

 ITIL Skill set requirement (Problem Management/Incident Management/Chain Management etc)

12.(a)(i) Database security concerns the use of a broad range of information security controls to
protect databases (potentially including the data, the database applications or stored functions,
the database systems, the database servers and the associated network links) against
compromises of their confidentiality, integrity and availability. It involves various types or
categories of controls, such as technical, procedural/administrative and physical.

Data integrity is the maintenance of, and the assurance of the accuracy and consistency
of, data over its entire life-cycle,[1] and is a critical aspect to the design, implementation and
usage of any system which stores, processes, or retrieves data. The term data integrity is broad in
scope and may have widely different meanings depending on the specific context – even under
the same general umbrella of computing. This article provides only a broad overview of some of
the different types and concerns of data integrity.

12.(a).(ii) The Create Table Command

The DROP Command

Syntax:
DROP TABLE <table_name>

The TRUNCATE Command

Syntax:
TRUNCATE TABLE <Table_name>

The RENAME Command

Syntax:
RENAME <OldTableName> TO <NewTableName>

The ALTER Table Command

By The use of ALTER TABLE Command we can modify our exiting table.

Adding New Columns

Syntax:
ALTER TABLE <table_name>
ADD (<NewColumnName> <Data_Type>(<size>),......n)

Dropping a Column from the Table

Syntax:
ALTER TABLE <table_name> DROP COLUMN <column_name>

Modifying Existing Table

Syntax:
ALTER TABLE <table_name> MODIFY (<column_name> <NewDataType>(<NewSize>))

12.(b) Set operations allow the results of multiple queries to be combined into a single result set.
[1]
Set operators include UNION, INTERSECT, and EXCEPT.
13.(a) Some of the file organizations are

1. Sequential File Organization


2. Heap File Organization

3. Hash/Direct File Organization

4. Indexed Sequential Access Method

5. B+ Tree File Organization

6. Cluster File Organization

13.(b)(i) RAID level 0: Striping


RAID level 1: Mirroring and performance improvements
RAID level 3: Byte-level parity
RAID level 4: Block-level parity
RAID level 5: Rotating parity
RAID level 6: Tolerates failure of two disk drives

13.(b).(ii)

14.(a).(i)

 Parsing and translation. Translate the query into its internal form. This is then translated
into relational algebra. ...
 Optimization. SQL is a very high level language: ...

 Evaluation. The query evaluation engine takes a query evaluation plan, executes that plan
and returns the answer to that query.

14.(a).(ii) Theta Join, Equijoin, and Natural Join are called inner joins. An inner join includes
only those tuples with matching attributes and the rest are discarded in the resulting relation.
Therefore, we need to use outer joins to include all the tuples from the participating relations in
the resulting relation. There are three kinds of outer joins − left outer join, right outer join, and
full outer join.
15.(a).(i) In database systems, atomicity is one of the ACID transaction properties. An atomic
transaction is an indivisible and irreducible series of database operations such that either all
occur, or nothing occurs.

typically, systems implement Atomicity by providing some mechanism to indicate which


transactions have started and which finished; or by keeping a copy of the data before any
changes occurred (read-copy-update). Several file systems have developed methods for avoiding
the need to keep multiple copies of data, using journaling (see journaling file system). Databases
usually implement this using some form of logging/journaling to track changes. The system
synchronizes the logs (often the metadata) as necessary once the actual changes have
successfully taken place. Afterwards, crash recovery simply ignores incomplete entries.
Although implementations vary depending on factors such as concurrency issues, the principle of
atomicity — i.e. complete success or complete failure — remain.

The hardware level requires atomic operations such as Test-and-set, Fetch-and-add, Compare-
and-swap, or Load-Link/Store-Conditional, together with memory barriers. Portable operating
systems cannot simply block interrupts to implement synchronization, since hardware that lacks
actual concurrent execution such as hyper-threading or multi-processing is now extremely rare.

15.(a)(ii) In a multiprogramming environment where multiple transactions can be executed


simultaneously, it is highly important to control the concurrency of transactions. We have
concurrency control protocols to ensure atomicity, isolation, and serializability of concurrent
transactions. Concurrency control protocols can be broadly divided into two categories −

 Lock based protocols


 Time stamp based protocols

15.(b) Serializability is the classical concurrency scheme. It ensures that a schedule for executing
concurrent transactions is equivalent to one that executes the transactions serially in some order.
It assumes that all accesses to the database are done using read and write operations.

Given a set of transactions T1...Tn, two schedules S1 and S2 of these transactions are equivalent
if the following conditions are satisfied:

Read-Write Synchronization: If a transaction reads a value written by another transaction in one


schedule, then it also does so in the other schedule.

Write-Write Synchronization: If a transaction overwrites the value of another transaction in one


schedule, it also does so in the other schedule.

These two properties ensure that there can be no difference in the effects of the two schedules.
As an example, It is equivalent to a schedule in which T2 is executed after T1.
Part C – (1 X 20 = 20 Marks)

16.

You might also like