rdbms
rdbms
DBMS (Database Management System): It is a software system that allows users to define, create, manage,
and control access to databases. DBMS does not enforce any specific structure for organizing data.
RDBMS (Relational Database Management System): It is a type of DBMS that organizes data into tables with
rows and columns, where relationships between the tables are established using keys.
RDBMS enforces the relational model and supports SQL for querying and managing data.
b) What is timestamp?
A timestamp is a unique identifier assigned to each transaction in a database system to determine the
order of transactions.
It helps in maintaining the consistency and integrity of the database by providing a chronological order of
transactions.
c) Define Transaction.
A transaction is a logical unit of work performed on a database, which includes one or more database
operations such as read, write, update, or delete.
Transactions must follow the ACID properties (Atomicity, Consistency, Isolation, Durability) to ensure
database integrity.
d) What is cursor?
A cursor is a database object used to retrieve and manipulate data row by row, typically within a SQL
operation.
It enables traversal and processing of the result set returned by a SQL query in a procedural manner.
e) Define serializability.
Serializability is a property of a database transaction that ensures that the execution of concurrent
transactions produces the same result as if they were executed serially, one after another.
It prevents anomalies such as lost updates, inconsistent retrievals, and uncommitted data from occurring in
a concurrent database environment.
f) What is deadlock?
Deadlock occurs when two or more transactions are waiting indefinitely for each other to release locks on
resources that they need to proceed.
It results in a situation where none of the transactions can proceed, leading to a system-wide halt unless
resolved by a deadlock detection and resolution mechanism.
g) What is atomicity?
Atomicity is one of the ACID properties of database transactions, which ensures that either all operations
within a transaction are successfully completed, or none of them are.
It guarantees that transactions are indivisible and either fully commit their changes to the database or
leave the database unchanged in case of failure.
h) What is a procedure?
A procedure is a named set of SQL and PL/SQL statements stored in the database and executed as a single
unit.
It allows for code reusability and modularization by encapsulating a sequence of operations into a single
callable unit.
i) What is a trigger?
A trigger is a database object associated with a table that automatically executes a specified set of actions
(SQL statements) when a certain event (e.g., INSERT, UPDATE, DELETE) occurs on the table.
Triggers are used to enforce data integrity, implement business rules, and automate tasks within the
database.
Operators in PL/SQL are symbols or keywords used to perform operations on operands (variables,
constants, or expressions) to produce a result.
Examples of operators in PL/SQL include arithmetic operators (+, -, *, /), comparison operators (=, <>, >,
<), logical operators (AND, OR, NOT), and string concatenation operator (||). k) Characteristics of RDBMS.
Data Integrity: RDBMS enforces data integrity constraints such as primary keys, foreign keys, and unique
constraints to maintain the accuracy and consistency of data.
Data Independence: RDBMS separates the physical storage of data from its logical structure, allowing
changes to the database schema without affecting applications.
Conditional Statements: Includes IF-THEN-ELSE and CASE statements for branching based on conditions.
Looping Statements: Such as LOOP, WHILE, and FOR loops to iterate over a set of statements until a
condition is met.
m) Concurrent Execution.
Concurrent Execution refers to the simultaneous execution of multiple transactions or processes within a
database system.
It improves system performance and resource utilization by allowing multiple transactions to run
concurrently without waiting for each other.
n) What is the difference between DBMS and RDBMS?
DBMS (Database Management System): Manages databases without enforcing a specific structure for
organizing data.
RDBMS (Relational Database Management System): Organizes data into tables with rows and columns,
enforcing the relational model and supporting SQL for querying and managing data. o) Define
Transaction.
A transaction is a logical unit of work performed on a database, consisting of one or more database
operations like read, write, update, or delete.
Transactions must follow the ACID properties (Atomicity, Consistency, Isolation, Durability) to ensure
database integrity.
A lock is a mechanism used to control access to shared resources (e.g., data objects) in a multiuser
database environment to prevent conflicts and maintain data consistency.
Types of locks include shared locks (read-only access), exclusive locks (write access), and intent locks
(indicating an intention to acquire a specific type of lock).
q) What is timestamp?
A timestamp is a unique identifier assigned to each transaction in a database system to determine the
order of transactions.
It helps maintain the consistency and integrity of the database by providing a chronological order of
transactions.
Active: The initial state when the transaction is executing its operations.
Partially Committed: The state where the transaction has executed all its operations successfully and is
waiting to be committed.
Committed: The state where the changes made by the transaction have been permanently saved to the
database.
Failed: The state where the transaction encounters an error and cannot continue.
Aborted: The state where the transaction is rolled back to its initial state or an earlier consistent state due
to a failure.
Terminated: The final state after the transaction has been successfully completed or rolled back.
Enhanced Throughput: By enabling parallel processing, concurrent execution increases the number
of transactions processed per unit of time, improving system throughput. t) List the failure types.
Transaction Failure: When a transaction encounters an error and cannot proceed.
System Failure: Occurs due to hardware or software issues, leading to the loss of in-progress transactions or
database corruption.
sql
Copy code
ON table_name
DECLARE
BEGIN