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

IT24 - Advanced DBMS Model Answer Paper

Uploaded by

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

IT24 - Advanced DBMS Model Answer Paper

Uploaded by

noralba704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

ADBMS

Q Draw the E-R Diagram for the following system & explain notation & Relationship XYZ 10
hospital is a multispecialty hospital that includes a names of department, rooms, M
Doctors, nurses, compounders of other working staff.
Patients having different kinds of ailments come to the hospital to get checkups done
from the concerned doctors. If required, they are admitted in the hospital or discharged
after treatment. The aim of this case study is to design and develop a database for the
hospital to maintain the records of various departments, rooms and doctors in the
hospital. It also maintains records of the regular patients, patient admitted in the
hospital, the checkup of patient done by the doctors, the patients that have been
operated and patient discharged from the hospital.
AN
S

This E-R diagram shows the various entities and their relationships in the XYZ hospital
system. Here is an explanation of the notation used in the diagram:

Entity: Represents a real-world object or concept that has attributes (properties that describe
it). In this diagram, the entities are shown as rectangles. For example, the "Doctor" entity has
attributes like "Doctor ID", "Name", "Specialty", etc.

Attribute: Describes a property of an entity. In the diagram, attributes are shown as ovals
connected to their respective entities. For example, the "Name" attribute of the "Doctor"
entity.

Relationship: Represents a connection between two or more entities. In the diagram,


relationships are shown as diamonds connected to the entities they relate. For example, the
"Admits" relationship connects the "Doctor" and "Patient" entities and indicates that a doctor
can admit a patient to the hospital.

Cardinality: Indicates the number of instances of one entity that can be associated with a
single instance of another entity in a relationship. In the diagram, cardinality is shown as
symbols near the ends of the relationship lines. For example, the "Admits" relationship has a
cardinality of "1:M", which means that a single doctor can admit multiple patients, but each
patient can be admitted by only one doctor.

Using the above E-R diagram, we can represent the hospital system accurately and maintain
various records. It enables us to keep track of departments, rooms, doctors, and other staff in
the hospital. Also, it helps in managing the records of patients, their check-ups, treatments,
and their current status in the hospital.
OR

Q What is meant by lock? Explain two phase locking protocol for concurrency. 10
control with example. M
AN In database management, a lock is a mechanism that prevents two transactions from
S simultaneously accessing the same data item or resource. Locking is an essential technique
used to ensure data consistency and prevent conflicts between transactions.

The two-phase locking protocol (2PL) is a concurrency control method that ensures
serializability in a database system. The protocol works in two phases: the growing phase and
the shrinking phase.

During the growing phase, a transaction acquires locks on all the data items it needs before
performing any write operations. In other words, a transaction can acquire locks but cannot
release any lock during this phase. Once all the locks are acquired, the transaction performs
its write operations and moves to the shrinking phase.

During the shrinking phase, the transaction releases all the locks it acquired during the
growing phase. Once all the locks are released, other transactions can acquire locks on the
same data items and access them. The 2PL protocol ensures that transactions can only acquire
locks in the growing phase and release them in the shrinking phase, preventing any conflicts
and maintaining data consistency.

Here's an example to illustrate the 2PL protocol:

Suppose we have two transactions, T1 and T2, that want to update a bank account balance.

T1 wants to transfer $500 from account A to account B.


T2 wants to transfer $200 from account A to account C.
The 2PL protocol would work as follows:

Growing Phase:

T1 acquires a shared lock on account A, and an exclusive lock on account B.


T2 requests a shared lock on account A, but since T1 has already acquired a shared lock on
account A, T2 has to wait.
T2 acquires an exclusive lock on account C.
Shrinking Phase:

T1 releases the shared lock on account A and the exclusive lock on account B.
T2 releases the exclusive lock on account C and the shared lock on account A.
By following the 2PL protocol, the transactions can avoid any conflicts and maintain data
consistency. The protocol ensures that no two transactions can simultaneously access the
same data item and ensures that each transaction releases all its locks before allowing another
transaction to access the data item.

Q. Answer Any Two 10


3 M
a) Describe the data base 3-tier schema architecture? 5M

AN The 3-tier schema architecture is a client-server model for building scalable, reliable, and
S maintainable database applications. In this architecture, the application is split into three
layers, each with a specific role:

Presentation layer: This is the topmost layer and is responsible for the user interface (UI) or
front-end of the application. The presentation layer interacts with the user, accepts input from
the user, and displays the results. The presentation layer is implemented using various
technologies, such as HTML, CSS, JavaScript, and UI frameworks.

Application layer: This is the middle layer and is responsible for handling the business logic
of the application. The application layer contains the code that processes user input, performs
data validation, implements business rules, and interacts with the database. The application
layer is implemented using various programming languages, such as Java, Python, PHP, and
.NET.

Database layer: This is the bottom layer and is responsible for storing and managing the data
used by the application. The database layer provides a persistent storage mechanism for the
application data and provides tools for accessing and manipulating the data. The database
layer is implemented using database management systems (DBMS) such as MySQL, Oracle,
PostgreSQL, and SQL Server.

Here are some of the benefits of using a 3-tier schema architecture:

Scalability: The 3-tier architecture allows for scaling each layer independently. This means
that you can add more servers to handle an increase in user requests, or you can add more
database nodes to handle an increase in data storage requirements.

Maintainability: The separation of concerns between the layers makes it easier to maintain the
application code. Changes made to one layer don't affect the other layers, so it's easier to
debug and fix issues in the application.

Security: The 3-tier architecture allows for implementing security at each layer. The
presentation layer can be secured using SSL, the application layer can implement
authentication and authorization checks, and the database layer can enforce access controls
and encryption.
Performance: The 3-tier architecture allows for caching data at each layer, which can improve
application performance. Caching data at the presentation layer can reduce the number of
requests sent to the application layer, and caching data at the application layer can reduce the
number of requests sent to the database layer.

In summary, the 3-tier schema architecture is a powerful way to build database applications
that are scalable, reliable, and maintainable. By separating the presentation, application, and
database layers, the architecture allows for scaling, maintenance, security, and performance
improvements.
b) Write short note on mobile database. 5M

AN A mobile database is a database that is designed to run on mobile devices, such as


S smartphones and tablets. Mobile databases are used to store and manage data locally on the
mobile device, and they are typically designed to be lightweight, fast, and efficient.

Mobile databases are used in a variety of applications, such as mobile banking, inventory
management, field service management, and customer relationship management. These
applications require the ability to store and manage data locally on the mobile device, without
the need for a constant connection to a remote server.

There are several advantages to using a mobile database:

Offline access: Mobile databases allow users to access and manipulate data even when there
is no internet connection available. This is especially useful for field workers who need to
access and update data in remote locations.

Fast access: Mobile databases are designed to be fast and efficient, which means that data can
be accessed and manipulated quickly, even on low-powered mobile devices.

Improved data security: Mobile databases can be designed to store data locally on the mobile
device, which improves data security by reducing the risk of data breaches and unauthorized
access.

Customization: Mobile databases can be customized to meet the specific needs of the
application. This means that developers can create databases that are optimized for
performance, storage, and data retrieval.

Some popular mobile databases include SQLite, Realm, Couchbase Lite, and Firebase
Realtime Database. These databases offer a variety of features, such as data synchronization,
offline data storage, and data encryption.

In summary, mobile databases are a critical component of mobile applications, providing


offline access, fast access, improved data security, and customization capabilities. As the use
of mobile devices continues to grow, the demand for mobile databases is likely to increase,
making it an exciting area of development for database professionals.
OR

a) What is the need of the Database? Write characteristics of DBMS. 5M

AN The need for a database arises from the fact that data is one of the most important assets of
S any organization. Data is used to make decisions, analyze trends, and develop strategies.
However, as the amount of data grows, it becomes increasingly difficult to manage and
organize it in a meaningful way. This is where databases come in - they provide a structured
and efficient way to store, manage, and retrieve data.

Here are some of the key characteristics of DBMS:

Data Independence: DBMS provides data independence to users. Users can access data
without knowing how it is stored, which makes it easier to modify the database structure
without affecting the applications that use it.

Data Integrity: DBMS ensures that the data stored in the database is accurate and consistent.
This is achieved through various data validation techniques, such as constraints, triggers, and
referential integrity.

Security: DBMS provides security features that ensure the confidentiality, integrity, and
availability of data. These features include access control, authentication, and encryption.

Concurrent Access: DBMS allows multiple users to access the database simultaneously. This
is achieved through techniques such as locking, which ensures that multiple users do not
modify the same data at the same time.

Data Recovery: DBMS provides data recovery features that allow the database to be restored
to a previous state in case of a system failure or data corruption.

Scalability: DBMS provides scalability features that allow the database to handle an
increasing amount of data and users without affecting performance.

Backup and Restore: DBMS provides backup and restore features that allow the database to
be backed up regularly and restored in case of a disaster.

In summary, DBMS is a software system that provides a structured and efficient way to store,
manage, and retrieve data. It offers several key characteristics, such as data independence,
data integrity, security, concurrent access, data recovery, scalability, and backup and restore.
These characteristics make DBMS an essential tool for managing data in modern
organizations.
b) Write the characteristics of OODDMS. 5M

AN Object-oriented database management systems (OODBMS) are database management


S systems that are based on the principles of object-oriented programming. Here are some of the
key characteristics of OODBMS:

Object-Oriented Data Model: OODBMS use an object-oriented data model to represent data.
This means that data is represented as objects that have properties and methods, similar to
objects in object-oriented programming.

Complex Data Types: OODBMS support complex data types, such as arrays, sets, and lists,
which are not supported by traditional relational databases.

Encapsulation: OODBMS use encapsulation to protect the data stored in the database. This
means that data is accessed and modified through methods, which ensures that the data
remains consistent and maintains its integrity.

Inheritance: OODBMS support inheritance, which allows objects to inherit properties and
methods from their parent objects. This makes it easier to create complex object hierarchies
and reduces the amount of redundant code.

Query Language: OODBMS use object-oriented query languages, such as OQL (Object
Query Language), which are designed to work with object-oriented data models.

Persistence: OODBMS provide persistence, which means that objects can be stored in the
database and retrieved at a later time. This allows applications to store and manage complex
data structures.

Concurrency Control: OODBMS provide concurrency control features, such as locking and
transactions, which ensure that multiple users can access and modify data without causing
conflicts.

Scalability: OODBMS are highly scalable, and can handle large amounts of data and users
without affecting performance.

In summary, OODBMS offer several key characteristics, including an object-oriented data


model, support for complex data types, encapsulation, inheritance, object-oriented query
languages, persistence, concurrency control, and scalability. These characteristics make
OODBMS a powerful tool for managing complex data structures in object-oriented
programming environments.
Q. Answer Any Two 10
M
a) Write the log-based recovery techniques with example? 5M

AN Log-based recovery is a technique used in database management systems (DBMS) to recover


S from failures or errors that cause data loss or corruption. The idea behind log-based recovery
is to use a log file to record all the changes made to the database, so that in the event of a
failure, the changes can be replayed to restore the database to a consistent state. There are two
main types of log-based recovery techniques: forward recovery and backward recovery.

Forward Recovery:
Forward recovery, also known as redo recovery, is a technique in which the changes recorded
in the log file are replayed from the last checkpoint to the point of failure. This ensures that all
the changes made to the database are applied and the database is brought to a consistent state.
Here is an example of forward recovery:
Suppose a database contains a table called "customers" with the following rows:

CustomerID | CustomerName | Address


1 | John Smith | 123 Main St.
2 | Jane Doe | 456 Elm St.

Now suppose a user executes an update statement that changes the address of customer 1 to
"456 Oak St.":

UPDATE customers SET Address = '456 Oak St.' WHERE CustomerID = 1;

This change is recorded in the log file as follows:

UPDATE customers SET Address = '456 Oak St.' WHERE CustomerID = 1;


If a failure occurs after this update statement is executed, the DBMS can use the log file to
redo the changes and bring the database to a consistent state.

Backward Recovery:
Backward recovery, also known as undo recovery, is a technique in which the changes
recorded in the log file are reversed from the point of failure to the last checkpoint. This
ensures that any changes made to the database after the last checkpoint are undone and the
database is brought to a consistent state. Here is an example of backward recovery:
Suppose a database contains a table called "orders" with the following rows:

OrderID | CustomerID | OrderDate | Total


1 |1 | 2022-01-01 | 100.00
2 |2 | 2022-01-02 | 200.00

Now suppose a user executes a delete statement that deletes order 2:

DELETE FROM orders WHERE OrderID = 2;

This change is recorded in the log file as follows:

DELETE FROM orders WHERE OrderID = 2;

If a failure occurs after this delete statement is executed, the DBMS can use the log file to
undo the changes and bring the database to a consistent state.
Q. Write short note on Grant and revoking privilege with example. 5M

AN In database management systems (DBMS), granting and revoking privileges is the process of
S allowing or denying users access to specific database objects or operations. Privileges are
granted by the database administrator (DBA) to users or roles, which are collections of users
with similar privileges. Here is a brief explanation of granting and revoking privileges with an
example:

Granting Privileges:
Granting privileges is the process of giving users or roles permission to perform specific
operations on database objects such as tables, views, and procedures. The GRANT statement
is used to grant privileges to users or roles. For example, suppose the DBA wants to grant the
SELECT privilege on a table called "employees" to a user called "jane". The following SQL
statement can be used to grant the privilege:

GRANT SELECT ON employees TO jane;

After executing this statement, the user "jane" will be able to select data from the "employees"
table.

Revoking Privileges:
Revoking privileges is the process of removing previously granted privileges from users or
roles. The REVOKE statement is used to revoke privileges from users or roles. For example,
suppose the DBA wants to revoke the SELECT privilege on the "employees" table from the
user "jane". The following SQL statement can be used to revoke the privilege:

REVOKE SELECT ON employees FROM jane;


After executing this statement, the user "jane" will no longer be able to select data from the
"employees" table.

It is important to note that privileges can be granted or revoked on different levels of


granularity such as the database level, schema level, and object level. In addition, different
types of privileges can be granted such as SELECT, INSERT, UPDATE, DELETE, and
EXECUTE, among others. Properly managing privileges is a crucial aspect of database
security and access control.
OR

Q. What is Database Backup of types of backups? 5M

AN A database backup is a process of creating a copy of the entire or a portion of a database to


S protect it against data loss, corruption, or other disasters. Backups are essential to ensure the
availability and integrity of data in a database system. Here are some types of database
backups:

Full Backup: A full backup is a complete backup of the entire database. It includes all data
files, control files, and log files. Full backups can take a long time to perform and require a
large amount of storage space, but they provide the most comprehensive protection against
data loss.

Incremental Backup: An incremental backup is a backup of only the changes made to the
database since the last backup. It is faster and requires less storage space than a full backup.
However, restoring data from an incremental backup requires the most recent full backup and
all incremental backups made since then.

Differential Backup: A differential backup is similar to an incremental backup, but it backs up


all changes made since the last full backup. It is faster and requires less storage space than a
full backup but more than an incremental backup. Restoring data from a differential backup
requires the most recent full backup and the most recent differential backup.

Snapshot Backup: A snapshot backup is a point-in-time copy of the entire database or a


portion of it. It captures the state of the database at a specific moment, and changes made to
the database after the snapshot are not included in the backup. Snapshot backups are useful
for testing, development, and reporting purposes.

Online Backup: An online backup is a backup taken while the database is still in use. It allows
the database to continue operating during the backup process, minimizing downtime. Online
backups require specialized backup software and hardware.

Offline Backup: An offline backup is a backup taken when the database is not in use. It
requires the database to be shut down, so it can only be performed during scheduled
maintenance or downtime.

It is important to choose the appropriate backup strategy based on the criticality of the data,
recovery time objectives, and available resources. Regular backups and periodic testing of the
restore process are essential to ensure the recoverability of data in the event of a disaster.
Q Write short note on mandatory Access control. 5M

AN Mandatory Access Control (MAC) is a security model used in computer systems to restrict
S access to resources based on the sensitivity of data and the clearance of users. In MAC, access
control policies are centrally managed by a security administrator, and users are not allowed
to modify or bypass them.

The basic idea of MAC is that each object (such as a file or a device) and each user has a
security label that defines its sensitivity and clearance level. Sensitivity labels indicate the
level of sensitivity or importance of an object, while clearance labels represent the level of
trustworthiness or authorization of a user. Access to an object is granted only if the user's
clearance label is equal to or greater than the sensitivity label of the object.

MAC is commonly used in environments that require a high level of security, such as
military, government, and financial institutions. MAC provides strong security guarantees, but
it requires significant administrative effort to set up and maintain. It is also less flexible than
other access control models, such as discretionary access control (DAC) or role-based access
control (RBAC), which allow users more control over access to resources.

Example:
For example, in a military organization, top-secret documents may have a sensitivity label of
"top secret," while a user with a clearance label of "secret" should not be able to access these
documents. Similarly, a user with a "top secret" clearance should not be able to access
documents labeled as "confidential." In MAC, access to these documents is granted only if the
user's clearance level matches or exceeds the sensitivity level of the document.
Q. Explain the Inter query of Intraquery parallelism in details with example. 10
M
AN Parallelism in database systems is the process of dividing a single large task into multiple
S smaller tasks that can be executed simultaneously on multiple processors or machines to
improve performance. There are two types of parallelism in database systems: intraquery
parallelism and interquery parallelism.

Intraquery parallelism refers to the process of parallelizing the execution of a single query
across multiple processors or machines. This is achieved by dividing the query into smaller
tasks that can be executed simultaneously on different processors or machines.

For example, consider the following SQL query:

SELECT customer_id, SUM(order_total)


FROM orders
GROUP BY customer_id
HAVING SUM(order_total) > 1000;

This query calculates the total order amount for each customer and returns only those
customers whose total order amount exceeds 1000. If the orders table is very large, the query
may take a long time to execute on a single processor or machine.

Intraquery parallelism can be used to improve the performance of this query by dividing it
into smaller tasks and executing them simultaneously on multiple processors or machines. For
example, the query can be divided into two tasks:

Task 1: Calculate the total order amount for each customer on one processor or machine.
Task 2: Filter out customers whose total order amount is less than or equal to 1000 on another
processor or machine.

These tasks can be executed simultaneously, and the results can be combined to produce the
final result of the query. This can significantly reduce the time required to execute the query
and improve the overall performance of the database system.

Interquery parallelism, on the other hand, refers to the process of executing multiple queries
simultaneously on multiple processors or machines. This is useful when multiple users are
accessing the database system at the same time and executing different queries. Interquery
parallelism allows the database system to handle multiple queries simultaneously and improve
the overall throughput of the system.
OR

Q Explain different between homogeneous and heterogeneous database with 10


example. M
AN Homogeneous and heterogeneous databases are two different types of database architectures
S used in modern database systems.

A homogeneous database refers to a database system in which all components or nodes have
the same architecture, operating system, and database management system (DBMS). In other
words, all the nodes in a homogeneous database are of the same type and use the same
software and hardware. A homogeneous database is typically used in a single organization or
company that has a standard IT infrastructure.

For example, a company may use a homogeneous database system in which all servers are
running the same operating system (e.g., Windows Server) and the same DBMS (e.g., Oracle
Database). All nodes are connected to a single network and managed centrally by the database
administrator. This makes it easier to manage the database system as there are no
compatibility issues between different nodes.

A heterogeneous database, on the other hand, refers to a database system in which different
components or nodes have different architectures, operating systems, and DBMSs. In other
words, a heterogeneous database may consist of multiple nodes with different hardware,
software, and operating systems. A heterogeneous database is typically used in a distributed
environment where data is spread across multiple locations or organizations.

For example, a global corporation with offices in different countries may use a heterogeneous
database system in which different nodes are running different operating systems (e.g.,
Windows, Linux) and different DBMSs (e.g., Oracle, SQL Server). The nodes may be
connected over a wide area network (WAN) and managed by multiple database
administrators. This makes it more difficult to manage the database system as there may be
compatibility issues between different nodes.

In summary, the main difference between homogeneous and heterogeneous databases is that a
homogeneous database system consists of nodes with the same architecture, operating system,
and DBMS, while a heterogeneous database system consists of nodes with different
architectures, operating systems, and DBMSs.

*****

You might also like