0% found this document useful (0 votes)
17 views

16A Batch Advance Database System Question Answer

Uploaded by

Md Wasimul Haque
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

16A Batch Advance Database System Question Answer

Uploaded by

Md Wasimul Haque
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

A.

B.

C.

(a) A Database Management System (DBMS) is a software application that interacts


with users, applications, and the database itself to capture and analyze data. Its main
goal is to efficiently and reliably manage, store, retrieve, and update data within a
database. This involves ensuring data integrity, consistency, and availability while
providing controlled access to users and applications

(b) Atomicity in a file system refers to the all-or-nothing nature of transactions. A failure
during a transaction could leave the file system in an inconsistent state if atomicity isn't
guaranteed. For example, if a file is being updated and the system crashes mid-update,
the file might be corrupted or partially updated. Security in a file system is vulnerable
because it typically lacks robust access control mechanisms. Files might be accessible
to unauthorized users, leading to data breaches or unauthorized modifications. This is in
contrast to a DBMS, which offers granular control over access permissions

(c) A Database Administrator (DBA) is responsible for the performance, integrity, and
security of a database. Their functions include database design, implementation, and
maintenance; ensuring data security and access control; performance monitoring and
optimization; backup and recovery procedures; and troubleshooting database issues.
They also often handle user management and capacity planning
2.
A.
B.
C.
D.
(a) A database schema is a formal description of a database's structure. It defines the
tables, their columns (attributes), data types, and relationships between tables. The
physical schema describes the actual physical storage structures of the database,
including file organization, indexing, and data storage mechanisms. This is the low-level
implementation detail. The logical schema, on the other hand, describes the database
structure from a user's perspective, focusing on the tables, attributes, and relationships
without detailing the physical implementation. It's a high-level, abstract view

(b) Mapping cardinalities in a binary relationship define the number of instances of one
entity that can be associated with instances of another entity. There are four main types:
one-to-one (1:1), one-to-many (1:N), many-to-one (N:1), and many-to-many (N:M). A
1:1 relationship means one instance of entity A can be related to at most one instance
of entity B, and vice versa. A 1:N relationship means one instance of entity A can be
related to many instances of entity B, but each instance of entity B is related to only one
instance of entity A. N:1 is the reverse. An N:M relationship means many instances of
entity A can be related to many instances of entity B

(c) Data Definition Language (DDL) is used to define the database structure. It's used to
create, modify, and delete database objects like tables, indexes, and views. Data
Manipulation Language (DML) is used to manipulate the data within the database. This
includes inserting, updating, deleting, and retrieving data. DDL focuses on the schema,
while DML focuses on the data

(d) A primary key is a column or a set of columns in a table that uniquely identifies each
row in that table. It cannot contain NULL values and must be unique for every record.
It's crucial for maintaining data integrity and ensuring efficient data retrieval

3.
A.
B.
C.
D.

(a) A data model is an abstract model that organizes elements of data and standardizes
how they relate to one another. It's a blueprint for a database, defining the structure and
constraints of the data. Examples include relational models (like those used in SQL
databases), object-oriented models, and NoSQL models (like document, key-value,
graph, and column-family stores)

(b) In an entity-relationship (E-R) model, an entity set is a collection of entities of the


same type. For example, an entity set could be "Students," where each entity within the
set represents a single student. A relationship set is a collection of relationships of the
same type that connect entities from one or more entity sets. For instance, a
relationship set might be "Enrolled In," connecting entities from the "Students" entity set
to entities from a "Courses" entity set

(c) A strong entity set is an entity set that can exist independently of other entity sets. It
has its own primary key. A weak entity set, on the other hand, cannot exist
independently; its existence depends on another entity set (called the identifying entity
set). A weak entity set does not have a primary key of its own; instead, it uses a
combination of its partial key and the primary key of its identifying entity set to form a
composite primary key. In an E-R diagram, a weak entity set is typically represented by
a double rectangle, and a double diamond is used to represent the identifying
relationship between the weak entity set and its identifying entity set

(d) A derived attribute is an attribute whose value can be calculated or derived from
other attributes within the same entity set. It doesn't need to be stored explicitly in the
database; instead, its value can be computed whenever needed. For example, in an
entity set representing employees, "age" could be a derived attribute calculated from the
"date of birth" attribute

4.
A.
B.
C.
a) SQL (Structured Query Language) is composed of several parts working together to
manage and manipulate data within a relational database management system
(RDBMS). These parts include:

Data Definition Language (DDL): Used to define the database structure,


including creating, altering, and deleting database objects like tables,
indexes, and views. Commands like CREATE TABLE, ALTER TABLE, and
DROP TABLE fall under DDL.
Data Manipulation Language (DML): Used to interact with the data within the
database. This includes inserting, updating, deleting, and retrieving data.
SELECT, INSERT, UPDATE, and DELETE are DML commands.
Data Control Language (DCL): Deals with the permissions and access control
within the database. GRANT and REVOKE are examples of DCL commands,
used to grant or revoke user privileges.
Transaction Control Language (TCL): Manages the transactions within the
database, ensuring data integrity and consistency. COMMIT, ROLLBACK, and
SAVEPOINT are TCL commands, used to commit changes, undo changes, or
set savepoints within a transaction.

b) The basic structure of an SQL query often follows this pattern:

SELECT column1, column2, ...

FROM table_name

WHERE condition;

SELECT: Specifies the columns to retrieve. SELECT * retrieves all columns.


FROM: Indicates the table from which to retrieve data.
WHERE: Filters the results based on a specified condition. This is optional;
omitting it returns all rows from the specified table.
c) Given the Account schema (account-number, branch-name, balance), the SQL
expression to find all branches where the average account balance is more than $1200
is:

SELECT branch_name

FROM Account

GROUP BY branch_name

HAVING AVG(balance) > 1200;

This query first groups the accounts by branch_name using GROUP BY. Then, the
HAVING clause filters these groups, keeping only those where the average balance
(calculated using AVG(balance)) is greater than 1200. The SELECT branch_name
part specifies that only the branch names meeting this condition should be returned

5.
A.
B.
C.
a) Referential integrity is a database concept that ensures relationships between tables
remain consistent. It dictates that if a foreign key in one table references a primary key
in another table, the foreign key value must either match a primary key value in the
referenced table or be NULL. This prevents orphaned records—records in a child table
that refer to non-existent records in a parent table. The basic concept is to maintain data
consistency and accuracy across related tables by enforcing rules on how data can be
inserted, updated, and deleted

b) A database trigger is a procedural code that automatically executes in response to


certain events on a particular table or view in a database. These events can include
INSERT, UPDATE, or DELETE operations. The trigger mechanism works by defining a
trigger associated with a specific table and event. When the event occurs, the database
system automatically executes the trigger's code, allowing for automated actions like
data validation, auditing, or enforcing business rules. Triggers provide a way to
implement complex data integrity constraints and automate database tasks without
requiring explicit application code to manage these actions

c) A domain constraint defines a set of valid values for a particular attribute (column) in
a database table. It restricts the type of data that can be stored in that column, ensuring
data integrity and consistency. For example, a domain constraint might specify that an
age attribute must be a positive integer, or that a status attribute can only accept values
from a predefined list (e.g., "active," "inactive"). This constraint helps maintain data
quality by preventing invalid data from being entered into the database

6.
A.
B.
C.

(a) Distributed databases offer several advantages, including increased availability,


scalability, and fault tolerance. Data can be geographically dispersed, improving
accessibility for users in different locations and reducing the impact of single-point
failures. Scalability allows for easier expansion to accommodate growing data volumes
and user demands. However, distributed databases also present challenges. Data
consistency and integrity can be more difficult to maintain across multiple locations,
requiring complex synchronization mechanisms. Transaction management becomes
more complex, and the potential for network latency and communication overhead can
impact performance. Security can also be a concern, as securing data across a
distributed network requires robust measures. Finally, the complexity of managing a
distributed database system often requires specialized expertise and can increase
administrative overhead

(b) A single-user computer system is designed to be used by only one person at a time.
Resources like the CPU, memory, and storage are dedicated to that single user.
Examples include personal computers used at home or in small offices. A multiuser
computer system, on the other hand, allows multiple users to access and share
resources simultaneously. This typically involves a central server managing access and
allocating resources to different users. Examples include mainframe computers, servers
in a network environment, and cloud computing platforms

(c) Parallel database architecture involves distributing the database across multiple
processors or computers to improve performance and scalability. Data is partitioned and
distributed among these nodes, allowing for parallel processing of queries and
transactions. This architecture can significantly improve query response times and
handle larger volumes of data than a single-processor system. Different parallel
architectures exist, including shared-nothing, shared-disk, and shared-memory
architectures, each with its own trade-offs in terms of cost, complexity, and performance

7.
A.
B.
C.

(a), (b), and (c) answered above


(a) Describe the concept of transaction.

A transaction, in the context of databases, is a single logical unit of work that accesses
and potentially modifies data. It's a sequence of operations performed as a single,
atomic unit. This means either all operations within the transaction succeed, or none do.
This ensures data consistency and integrity

(b) What are the states that involve in transaction? Describe it with state diagram.

A transaction typically goes through several states:

Active: The transaction is executing.


Partially Committed: The transaction has completed its operations but hasn't
yet been permanently written to the database.
Failed: An error occurred during transaction execution.
Committed: The transaction has successfully completed and its changes are
permanently stored.
Terminated/Aborted: The transaction was rolled back due to failure, and its
changes are undone.

State Diagram:

(c) Explain ACID properties?

ACID properties are crucial for ensuring database reliability and consistency. They
stand for:

Atomicity: A transaction is treated as a single, indivisible unit of work. Either all


changes within the transaction are applied successfully, or none are. Partial
completion is not allowed.
Consistency: A transaction must maintain the database's integrity constraints. It
must transform the database from one valid state to another.
Isolation: Concurrent transactions should not interfere with each other. Each
transaction should appear to be executed in isolation, as if it were the only
transaction running. This prevents data corruption and inconsistencies due to
interleaved execution.
Durability: Once a transaction is committed, its changes are permanently stored
in the database and survive even system failures (e.g., power outages,
crashes). The data is persistent.

8.
A.
B.
C.
(a) E-R Diagram: An Entity-Relationship diagram (ERD) is a visual representation of
data used in database design. It shows entities (things of interest, like customers or
products), attributes (characteristics of entities, like customer name or product price),
and relationships between entities (how entities relate to each other, such as a
customer placing an order). ERDs use symbols to represent these components, making
it easier to understand the structure of a database before it's implemented. They are
crucial for planning and communicating database design

(c) Distributed Database: A distributed database system is one where the database is
not stored in a single location but is spread across multiple computers or sites, often
geographically dispersed. This allows for better scalability, fault tolerance (if one site
fails, others can still operate), and data locality (users access data closer to them).
However, managing a distributed database is more complex than a centralized one,
requiring careful consideration of data consistency, concurrency control (managing
simultaneous access), and network communication. Different approaches exist for
distributing data, such as replication (copying data to multiple sites) or partitioning
(dividing data among sites)

You might also like