DBMS Remaining Experiments and Project
DBMS Remaining Experiments and Project
Title:- Study & Implementation of Database Backup & Recovery commands. Study &
Implementation of Rollback, Commit, Savepoint.
Objective:- Rollback, commit, and savepoint are database commands that are used to manage
transactions. Transactions are used to ensure the consistency and reliability of the database.
Theory:-
Database Backup
• Definition: A process of creating a copy of the data so that it can be restored in case of
data loss.
• Purpose: To protect data against accidental loss, corruption, or disasters.
• Types:
o Full Backup – entire database
o Incremental Backup – only the data changed since last backup
o Differential Backup – data changed since the last full backup
Database Recovery
ROLLBACK
• Definition: Undoes changes made by the current transaction and returns the database to
its last committed state.
• Use: When an error occurs or user cancels the transaction.
COMMIT
• Definition: Saves all the changes made in the current transaction permanently to the
database.
• Use: Used when a transaction is successful and changes need to be saved.
SAVEPOINT
• Definition: Sets a point within a transaction to which you can roll back without affecting
the whole transaction.
• Use: Partial rollback during complex transactions.
Code & Output:-
1. RollBack-
2. Commit-
3. Savepoint-
Experiment-11
SQL triggers are stored procedures that automatically execute in response to certain events in a
specific table or view in a database. They are used to maintain the integrity of the data, enforce
business rules, and automate tasks. We can set triggers to fire before or after an INSERT,
UPDATE, or DELETE operation.
Aim:- Perform Subqueries with IN clause, EXISTS clause, ANY clause, and ALL clause.
Objective:- To study about IN, EXIST, ANY and ALL clauses with example.
Theory:-
Clause Purpose
IN Checks if a value is in a list returned
by a subquery.
EXISTS Checks if the subquery returns any
rows.
ANY Compares a value to any value
returned by a subquery (works with
<, >, =).
ALL Compares a value to all values
returned by a subquery.
• The IN clause is used to filter records where a value matches any value in a list returned
by a subquery. It is commonly used when we want to compare a column's value to
multiple values from another table.
• The EXISTS clause checks whether a subquery returns any rows.If the subquery returns
at least one row, EXISTS returns TRUE; otherwise, it returns FALSE. Often used with
correlated subqueries.
• The ANY clause compares a value to any single value returned by a subquery.
It must be used with a comparison operator like =, <, >, etc. Returns TRUE if at least one
comparison is true.
• The ALL clause compares a value to every value returned by a subquery. It must also be
used with a comparison operator.Returns TRUE only if the condition is true for all values
returned by the subquery.
SELECT name
FROM employees
WHERE department_id IN (
SELECT id FROM departments WHERE location = 'New York'
);
2. Subqueries with EXISTS clause:
SELECT name
FROM departments d
WHERE EXISTS (
);
);
4. Subqueries with ALL clause:
FROM employees
);
Experiment-15
Aim:-. Designing an ER model. Case Study: General Hospital.
Objective:- To design an ER model based on case study of General Hospital.
Theory:-
• ER model stands for an Entity-Relationship model. It is a high-level data model. This
model is used to define the data elements and relationship for a specified system.
• It develops a conceptual design for the database. It also develops a very simple and easy
to design view of data.
• In ER modelling, the database structure is portrayed as a diagram called an entity-
relationship diagram.
• Procedural Language: PL/SQL allows for the use of control flow statements like
IF-THEN-ELSE, loops (FOR, WHILE, LOOP), and other procedural constructs,
enabling more complex logic within SQL queries.
• Stored Procedures, Functions, and Packages: PL/SQL allows developers to
create reusable code blocks stored directly within the database, which can be
executed efficiently.
• Tight Integration with SQL: PL/SQL can directly utilize SQL statements, allowing
for seamless data manipulation and access.
• Error Handling: PL/SQL provides mechanisms for handling exceptions and errors,
making applications more robust.
• Data Abstraction: PL/SQL allows for the definition of user-defined types and
data structures, enabling better organization and code reusability.
• Composite Variables: PL/SQL supports the use of records and collections
(VARRAYs, nested tables, and associative arrays) for handling complex data
structures.
• Cursors: PL/SQL provides mechanisms for iterating through query results,
enabling row-by-row processing.
• Triggers: PL/SQL can be used to define triggers, which automatically execute in
response to specific database events (e.g., INSERT, UPDATE, DELETE).
• High Performance: By compiling and storing PL/SQL units within the database,
PL/SQL can achieve high performance due to the reduced overhead of passing
data between different server processes.
• Portability: PL/SQL code is generally portable between different versions of the
Oracle database.
S.No Sections & Description
1 Declarations
This section starts with the keyword DECLARE. It is an optional section and defines all
variables, cursors, subprograms, and other elements to be used in the program.
2 Executable Commands
This section is enclosed between the keywords BEGIN and END and it is a mandatory
section. It consists of the executable PL/SQL statements of the program. It should have at
least one executable line of code, which may be just a NULL command to indicate that
nothing should be executed.
3 Exception Handling
This section starts with the keyword EXCEPTION. This optional section
contains exception(s) that handle errors in the program.
Syntax:
DECLARE
<declarations section>
BEGIN
<executable command(s)>
EXCEPTION
<exception handling>
END;
Numeric
1
Numeric values on which arithmetic operations are performed.
Character
2
Alphanumeric values that represent single characters or strings of characters.
Boolean
3
Logical values on which logical operations are performed.
Datetime
4
Dates and times.
Code:-
Output:-
Statement processed.
689
Experiment-14
Aim:- Minor Project on hostel management system.
Objective:
The objective of this project is to develop a simple, user-friendly hostel management website
that allows users to:
The website provides an organized online presence for the hostel, improving accessibility and
communication with potential residents.
Introduction:
Hostels are an essential facility for students and working individuals who seek affordable living
spaces. Traditionally, hostel information and booking were handled manually or via phone,
causing inconvenience.
This project aims to digitalize hostel management by designing a simple static website that
presents hostel services, room options, and a basic booking interface, making the process
smoother, faster, and available 24/7.
System Study:
➤ Problem Domain:
• Difficulty for users to view hostel details, room types, and facilities remotely.
➤ Solution Domain:
• Ensure that users can quickly fill a booking request form for further communication.
System Development Environment:
Category Tools/Technology Used
Frontend Development HTML5, CSS3
Web Browser Google Chrome, Mozilla Firefox
Code Editor Visual Studio Code / Sublime Text
Hosting (optional) Localhost (XAMPP) / GitHub Pages
Operating System Windows 10 / Windows 11 / MacOS
3. The design follows the Responsive Web Design principle (basic responsiveness) to
ensure it looks good across devices.
4. Basic Form Elements are used to collect booking information from users (like name,
email, room type).
Summary:
This project covers a basic hostel management system website using front-end technologies
only.
It serves as a foundation for a more advanced project that can later include backend
programming, database integration, admin panels, and payment gateways.
This is perfectly suitable if you need a mini project submission or a college project on web
development basics!
This project highlights the importance of having an accessible, organized, and responsive web
platform for modern hostel facilities.
References:
2. W3Schools — https://www.w3schools.com/
(For learning basic web design concepts)
3. Unsplash — https://unsplash.com/
(For free, high-quality background images)
4. FreeCodeCamp — https://www.freecodecamp.org/
(For tutorials and examples on web development)