Workers Behind The Scene in Dbms in Detail
Workers Behind The Scene in Dbms in Detail
Disadvantages of Triggers:
Increased Server Overhead: Triggers can increase the overhead costs on the
server, impacting performance and resource utilization
Limited Validations: Triggers provide only extended validations, not replacing
all validations, which can limit their effectiveness in certain scenarios
Troubleshooting Complexity: Debugging errors caused by triggers can be
challenging and time-consuming, consuming development resources
Potential for Logical Errors: Even minor mistakes in trigger queries can lead to
logical errors in the application, affecting data integrity and functionality
Risk of Data Loss: Incorrectly setting triggers can lead to the loss of original
data, highlighting the importance of careful trigger implementation and
management
timestamp ordering protocol------The timestamp ordering protocol is a
mechanism used in database management systems to order transactions based
on their timestamps. This protocol assigns a unique timestamp to each
transaction, which helps in determining the order of execution and resolving
conflicts. Timestamp ordering protocols ensure that conflicting read and write
operations are executed in timestamp order, maintaining the serializability of
schedules. The protocol compares timestamps of transactions to ensure correct
order and prevent deadlock situations. While this protocol offers benefits like
avoiding deadlock and ensuring serializability, it also has drawbacks such as
potential unnecessary aborts that can impact system efficiency. There are two
main types of timestamp ordering protocols: basic timestamp ordering (BTO)
and optimistic concurrency control (OCC), each suitable for different system
characteristics and requirements
inference rule-------The inference rule is a fundamental concept in artificial
intelligence and logic that serves as a template for generating valid arguments.
In artificial intelligence, inference involves creating new logic from existing logic
or evidence to draw conclusions. There are various types of inference rules,
each with its specific function:
Modus Ponens: This rule states that if P and P → Q are true, then Q can be
inferred as true.
Modus Tollens: It states that if P → Q is true and ¬Q is true, then ¬P will also be
true.
Hypothetical Syllogism: This rule asserts that if P → R is true whenever P → Q is
true, and Q → R is true.
Disjunctive Syllogism: It states that if P∨Q is true, and ¬P is true, then Q will be
true.
Addition: This rule indicates that if P is true, then P∨Q will be true.
Simplification: It states that if P∧Q is true, then Q or P will also be true.
Resolution: This rule asserts that if P∨Q and ¬P∧R are true, then Q∨R will also
be true.
These rules play a crucial role in logical reasoning and are essential tools in
artificial intelligence for deriving conclusions from given premises.
schema instance database state
The concepts of schema, instance, and database state are fundamental in
database management systems (DBMS).
Schema: The schema is the blueprint or design of the database, defining the
structure and layout of how data will be stored. It includes the attributes and
relationships within the database. Schemas are of three types: Logical Schema,
Physical Schema, and View Schema. The schema remains relatively constant
and represents the database's structure
Instance: An instance, also known as a database state, refers to the actual data
stored in the database at a specific moment in time. It is a snapshot of the
database containing the current set of occurrences or "instances." Instances
change frequently as data is added, deleted, or updated in the database. For
example, if a table initially has 50 records and then 50 more are added, the
instance will have a total of 100 records
Database State: The database state is synonymous with the instance,
representing the content of the database at a particular moment. It includes all
the data stored in the database at that specific time. The database state
changes every time the database is updated, reflecting the dynamic nature of
the data within the database
In summary, the schema is the static design of the database, the instance is the
dynamic data stored in the database at a specific time, and the database state
refers to the content of the database at a particular moment, capturing the
current set of data occurrences or instances.
different types of recovery techniques in dbms-----
Database recovery techniques are used in database management systems
(DBMS) to restore a database to a consistent state after a failure or error has
occurred. The main goal of recovery techniques is to ensure data integrity and
consistency and prevent data loss. There are mainly two types of recovery
techniques used in DBMS
Rollback/Undo Recovery Technique
The rollback/undo recovery technique is based on the principle of backing out
or undoing the effects of a transaction that has not been completed
successfully due to a system failure or error. This technique is accomplished by
undoing the changes made by the transaction using the log records stored in
the transaction log. The transaction log contains a record of all the transactions
that have been performed on the database. The system uses the log records to
undo the changes made by the failed transaction and restore the database to
its previous state.
Commit/Redo Recovery Technique
The commit/redo recovery technique is based on the principle of reapplying
the changes made by a transaction that has been completed successfully to the
database. This technique is accomplished by using the log records stored in the
transaction log to redo the changes made by the transaction that was in
progress at the time of the failure or error. The system uses the log records to
reapply the changes made by the transaction and restore the database to its
most recent consistent state.
Checkpoint Recovery is a technique used to reduce the recovery time by
periodically saving the state of the database in a checkpoint file. In the event of
a failure, the system can use the checkpoint file to restore the database to the
most recent consistent state before the failure occurred, rather than going
through the entire log to recover the database.
different type of end users in dbms----
The different types of end users in a Database Management System (DBMS)
can be categorized based on their interaction with the databases. Here are the
main categories:
Casual End Users: These users access the database occasionally and use
sophisticated database query language to retrieve data. An example is high-
level managers who access data on a weekly basis.
Parametric End Users: Parametric end users spend most of their time querying
and updating the database using standard types of queries. They include
individuals like bank tellers who perform these activities during their shift.
Sophisticated End Users: These users access the database to implement their
own applications to meet specific goals. They are familiar with the system
capabilities and interact with the system without writing programs. Examples
include business analysts, engineers, and scientists.
Standalone Users: Standalone end users maintain their own databases by
creating them using ready-made program packages with graphical user
interfaces.
These categories reflect the varying levels of knowledge and interaction that
end users have with a DBMS, from occasional users to those who develop their
own applications and maintain personal databases.
Triggers
Triggers are the SQL statements that are automatically
executed when there is any change in the database. The
triggers are executed in response to certain
events (INSERT, UPDATE or DELETE) in a particular table.
These triggers help in maintaining the integrity of the
data by changing the data of the database in a systematic
fashion.
Syntax
create trigger Trigger_name
(before | after)
[insert | update | delete] on [table_name] [for each row]
[trigger_body]
Advantages of Triggers
Disadvantages of Triggers