Dbms 2021 Beu Pyq Solution
Dbms 2021 Beu Pyq Solution
Dbms 2021 Beu Pyq Solution
om
1. Data Security and Privacy: Responsibility: A database manager is
.c
responsible for ensuring the security and privacy of the data stored in
i ty
the database. This includes implementing access controls, encryption
rs
mechanisms, and backup and recovery procedures.
ve
ni
Problem: If this responsibility is not discharg
discharged, the database becomes
gu
Problem: If data integrity and consistency are not upheld, it can lead to
incorrect and unreliable information. Inaccurate data can result in poor
decision-making, operational inefficiencies, and loss of trust in the database
system.
om
Problem: If this responsibility is not fulfilled properly, it can result in poor
database design, inefficient data storage, and difficulties in data retrieval.
.c
ty
Inconsistent or inappropriate schema changes may lead to dat data corruption,
i
data loss, and compatibility issues with applications.
rs
ve
5. Backup and Recovery: Responsibility: The database manager is
ni
1. Physical Level: This level deals with the actual storage and
organization of data in the system. In the case of a two-dimensional
integer array, the physical level would involve the representation of
the array in memory, specifying how the elements are stored, their
addresses, and the low-level details of accessing and manipulating
the array.
2. Logical Level: The logical level focuses on the conceptual
representation of data and the relationships between different
elements. For the array, the logical level would define the structure
and meaning of the array. It would specify the size, dimensions, and
indexing scheme of the array, allowing programmers to access and
manipulate the elements based on their logical properties rather than
the physical storage details.
3. View Level: The view level provides a customized or simplified
representation of the data for specific users or applications. It allows
users to see a subset of the data or a different perspective based on
om
their needs. In the case of the array, different views might be created
.c
to display specific rows or columns, filter elements based on certain
ty
conditions, or present the data in a specific format.
i
rs
ve
(ii) Difference between a schema and instances using a two
two-dimensional
ni
integer array as an example:
gu
model. It defines the logical and physical design aspects of the data.
in
In the case of the array, the schema would specify the number of
ng
rows and columns, the data type of the elements, any constraints or
re
In summary, the three levels of data abstraction (physical, logical, and view)
represent different perspectives or layers of understanding and
manipulating data. The schema defines the structure and constraints of the
data, while instances are the actual data conforming to the schema,
representing specific snapshots or values at a given time.
:3. Construct an E-R diagram for a car insurance company that
has a set of customers , each of whom owns one or more cars.
Each cars has associated with it zero to any number of recorded
accidents.
Ans:- Customers entity represents the customers of the insurance
company. It has attributes like CustomerID (primary key), Name,
Address, Phone, and Email.
Cars entity represents the cars owned by the customers. It has
attributes like CarID (primary key), Model, Year, and OwnerID
om
and Description.
Relationships:
.c
The relationship between Customers and Cars is a one one-to-many
ty
relationship, as a customer can own one or more cars.
i
rs
ve
The relationship between Cars and Accidents is also a one
one-to-
ni
many relationship, as a car can have zero to many recorded
gu
accidents.
rin
This E-R
R diagram represents the basic structure and
ee
insurancee company.
ng
re
ha
bi
The E-R Diagram for given Question are as follows.
Name
Address
CustomerId
om
.c
Owns
tyi
rs
CarId M ve OwnerId
ni
gu
CAR
C AR Model
rin
Year
ee
1
in
ng
re
Has
ha
Date
bi
Description
M
1. DDL (Data Definition Language): DDL is used to define and modify the structure of
the database schema. It includes commands for creating, altering, and deleting
database objects such as tables, indexes, views, and constraints. DDL statements are
used to define the structure and properties of the database.
om
CREATE TABLE: Used to create a new table in the database. For example
.c
CREATE TABLE Customers (
ty
CustomerID INT PRIMARY KEY,
i
Name VARCHAR(50),
rs
Address VARCHAR(100) ve
);:
ni
ALTER TABLE: Used to modify the structure of an existing table. For
gu
DROP TABLE: Used to delete an existing table and its data. For example:
in
statements focus on the actual data manipulation rather than the structure.
INSERT INTO: Used to insert new records into a table. For example:
INSERT INTO Customers (CustomerID, Name, Address)
VALUES (1, 'John Doe', '123 Main St');
UPDATE: Used to modify existing data in a table. For example, updating the
address for a customer:
UPDATE Customers
SET Address = '456 Elm St'
WHERE CustomerID = 1;
DELETE FROM: Used to delete records from a table. For example,
deleting a customer record:
DELETE FROM Customers
WHERE CustomerID = 1;
SELECT: Used to retrieve data from one or more tables based on
specific conditions. For example, selecting all customers:
SELECT * FROM Customers;
om
(iii)Division operation.
.c
Ans:-(i) Set of intersection operation:- In database management systems
i ty
(DBMS), the set intersection operation is used to retrieve the common elements
rs
or rows from two or more sets or tables. It returns a new set that contains only
ve
the elements or rows that exist in all the input sets.
ni
gu
Customer Table:-
ng
re
ha
bi
ID NAME
1. Deepak
2. Vandna
3. Atul
Order Table:-
Id Product
1. Mobile
2. Cooler
3. Laptop
4. A.C
Now, let's say we want to find the customers who have placed orders. We can
perform a set intersection operation between the Customers table and the Orders
table based on a common attribute, which is the ID .
om
1. Deepak
.c
2. Vandna
i ty
3. Atul
rs
ve
ni
gu
rin
ee
systems (DBMS), a natural join operation is used to combine two or more tables
ng
with the same name in the participating tables and combines the rows that have
ha
-
Id Name Country
1. Deepak India
2. Suraj Australia
3. Atul England
Order Table:-
Id Product Date
1. Laptop 2022
2. Mobile 2023
3. Cooler 2015
The result of the natural join operation will be:-
Id Name Country Product Date
1 Deepak India Laptop 2022
2 Suraj Australia Mobile 2023
om
3 Atul England Cooler 2015
.c
i ty
rs
ve
(iii)Ans:- Division Operation:- In database management systems
ni
records in one table that match all values in another table. It is typically used
rin
when you want to identify entities in one table that are associated with all
ee
The division operation is performed by comparing two tables and retrieving the
ng
records from one table that have a matching relationship with all records in the
re
other table.
ha
Employee Table:-
Employee-Id Employee-Name
1. Deepak
2. Suraj
3. Atul
Project Table:-
Project-Id Project-Name
101. Project1
102. Project2
103. Project3
Let's say we want to find employees who are assigned to all projects.
om
attribute.
.c
The division operation Employees ÷ Projects, in this case, would yield the
ty
following result:
i
rs
ve
Result table:-
ni
Employee-Id Employee-Name
gu
1. Deepak
rin
ee
The result shows that only employee John (EmployeeID 1) is assigned to all
in
projects (ProjectID 101, 102, and 103). Employee Jane (EmployeeID 2) is not
ng
So, the result of the division operation gives us the employee(s) who are
bi
1. Definition:
Primary Index: A primary index is a type of index that is based
on the primary key of a table. It uniquely identifies each record
in the table.
Secondary Index: A secondary index is an index that is created
on a non-key attribute of a table. It provides an alternate path
to access the data and is not based on the primary key.
2. Key Attributes:
Primary Index: It is based on the primary key attribute of a
table. The primary key is a unique identifier for each record in
the table.
Secondary Index: It is based on non-key attributes of a table.
These attributes may not have unique values and can be used
for efficient searching or sorting operations.
om
3. Uniqueness:
.c
Primary Index: It guarantees the uniqueness of the index entries
ty
as it is based on the primary key.
i
rs
Secondary Index: It does not guarantee the uniqueness of index
ve
entries as it is created on non-
non-key
non -key attributes that may have
ni
duplicate values.
gu
4. Number of Indexes:
in
5. Storage Overhead:
ha
om
serializability and allows transactions to be serialized based on their lock
points.
.c
ty
1. Conflict Serializability:
i
rs
Two transactions conflict if they access the same data item and
ve
at least one of them performs a write operation. Conflict can
ni
lead to data inconsistency and incorrect results.
gu
om
1. Unauthorized accesss to bank premises: Physical security
.c
2. Theft or robbery of cash and assets: Physical security
ty
3. Employee misconduct or fraud: Human security
i
4. Social engineering attacks targeting bank employees: Human security
rs
5. Insider threats or unauthorized access to customer data: Human security,
ve
database security
ni
6. Breach of customer privacy and confidentiality: Database security
gu
database security
8. Data breaches and unauthorized access to sensitive customer
custom information:
ee
Database security
in
operating-system
system security
10.ATM
ATM skimming and card cloning: Physical security, operating-system
operating
re
security
ha
11.Denial
Denial of Service (DoS) attacks on online banking
banki systems: Operating-
bi
It's important to note that some security concerns can fall into multiple categories,
as they may involve a combination of physical security, human security, operating-
system security, and database security. Banks need to address these concerns
comprehensively to ensure the overall security of their operations and protect
customer data and assets.
7(b).Explain web and distributed database with the help of
example.
1. Ans:- Web Database: A web database is a database that is specifically
designed to be accessed and utilized by web applications and websites. It
allows users to store and retrieve data over the internet through web
browsers. Web databases are typically used to manage dynamic content,
user information, and other data required for web-based applications.
Examples of web databases include MySQL, PostgreSQL, and MongoDB.
For example, consider an e-commerce website that needs to store and retrieve
product information, user profiles, and order details. The website can use a web
database to store this data. When a user visits the website and performs an action
such as adding items to a shopping cart or making a purchase, the web application
interacts with the web database to retrieve and update the necessary data.
om
2. Distributed Database: A distributed database refers to a database system in
.c
which data is spread across multiple physical locations or nod
nodes. Each node
ty
in the distributed database may store a subset of the data, and the nodes are
i
rs
connected through a network. The distributed nature of the database allows
ve
for improved scalability, fault tolerance, and performance. Examples of
ni
distributed databases
ases include Apache Cassandra, Amazon DynamoDB, and
gu
Google Spanner.
rin
countries. Each office has its own database server storing regional data.
in
and manipulate data from any other office, providing a centralized and
consistent view of the corporation's data across all locations.
bi
om
true and bypass the login authentication.
.c
Union-Based
Based Attack: Attacker uses the keyword to inject
ty
additional queries and retrieve data from other database tables.
i
rs
Database Modification: Attacker injects SQL statements to
ve
delete, update, or insert unauthorized data into the database.
ni
Database recovery refers to the process of restoring a database to a
gu
om
recovered data.
.c
i ty
rs
ve
ni
gu
rin
ee
in
ng
re
ha
bi