0% found this document useful (0 votes)
6 views17 pages

DBMS Remaining Experiments and Project

The document outlines various experiments related to database management, including backup and recovery commands, SQL triggers, subqueries, PL/SQL, and designing an ER model for a hospital management system. It emphasizes the importance of transaction management and data integrity in databases, as well as the development of a hostel management website to improve accessibility and communication. Each section includes objectives, theoretical background, and practical implementations with code examples.

Uploaded by

Sudarshan Panwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views17 pages

DBMS Remaining Experiments and Project

The document outlines various experiments related to database management, including backup and recovery commands, SQL triggers, subqueries, PL/SQL, and designing an ER model for a hospital management system. It emphasizes the importance of transaction management and data integrity in databases, as well as the development of a hostel management website to improve accessibility and communication. Each section includes objectives, theoretical background, and practical implementations with code examples.

Uploaded by

Sudarshan Panwar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Experiment-10

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

• Definition: Process of restoring data from a backup after data loss.


• Goal: Ensure data consistency and minimize downtime.
• Methods:
o Rollback operations
o Restore from backup
o Log-based 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

Aim:- Study & Implementation of SQL triggers.


Objective:- To learn basics of PL/SQL and understood its implementation through a program.
Theory:- SQL triggers are powerful tools in database management that automate tasks in
response to specific events. By understanding and implementing SQL triggers, you can ensure
data integrity, automate repetitive tasks, and enhance overall database performance.

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.

1. trigger_name: The name of the trigger to be created.


2. BEFORE | AFTER: Specifies whether the trigger is fired before or after the
triggering event (INSERT, UPDATE, DELETE).
3. {INSERT | UPDATE | DELETE}: Specifies the operation that will activate the
trigger.
4. table_name: The name of the table the trigger is associated with.
5. FOR EACH ROW: Indicates that the trigger is row-level, meaning it executes
once for each affected row.
6. trigger_body: The SQL statements to be executed when the trigger is fired.
Syntax:
create trigger [trigger_name]
[before | after]
{insert | update | delete}
on [table_name]
FOR EACH ROW
BEGIN
END;

Code & Output:-


Trigger is defined here-
Experiment-12

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.

Code & Output:-


1. Subqueries with IN clause:

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 (

SELECT 1 FROM employees e WHERE e.department_id = d.id

);

3. Subqueries with ANY clause:

SELECT name, salary


FROM employees

WHERE salary > ANY (

SELECT salary FROM employees WHERE department_id = 1

);
4. Subqueries with ALL clause:

SELECT name, salary

FROM employees

WHERE salary > ALL (


SELECT salary FROM employees WHERE department_id = 3

);
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.

A General Hospital Database Management System (GHDMS) is a computer or web-based


system that facilitates managing the functioning of a hospital or any medical set up. This system
will help in making the whole functioning paperless.
The hospital database includes all the necessary patient data. The disease history, test results,
prescribed treatment can be accessed by doctors without much delay in order to make an
accurate diagnosis and monitor the patient's health. It enables lower risks of mistakes.
A hospital is a place where patients come up for general checks for general prevailing diseases.
Hospitals provide them facilities like:
• Consultation by doctors
• Diagnosis for diseases
• Providing treatment facilities
• Facility for admitting patients
ER Model for the General Hospital management system:
Experiment-13
Aim:- Study & Implementation of PL/SQL.
Objective:- To learn basics of PL/SQL and understood its implementation through a program.
Theory:-
PL/SQL (Procedural Language/Structured Query Language) is Oracle's procedural
extension to SQL. It allows you to write complex database operations in the form of stored
procedures, functions, packages, and triggers. It combines SQL’s capabilities with the procedural
constructs of programming languages, such as variables, control structures, loops, and error
handling.

Key features and benefits of PL/SQL:

• 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;

S.No Date Types & Description

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:

• View hostel details

• Explore available rooms

• Read about the hostel's history

• Fill out a booking form to reserve a room

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:

• Lack of online presence for many hostels.

• Inconvenience in manually booking or enquiring about rooms.

• Difficulty for users to view hostel details, room types, and facilities remotely.

➤ Solution Domain:

• Develop a fully responsive website displaying hostel information.

• Provide sections such as Home, About, Rooms, and Booking Form.

• Create a simple UI/UX for easy navigation.

• 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

Theory Behind the Project:


1. HTML5 is used to design the structure of the website, organizing the content into
different sections like header, navigation, body, and footer.
2. CSS3 is used to style the website, making it visually appealing by using background
images, custom fonts, colors, layouts (flexbox/grid), and animations.

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).

5. Separation of Concerns: HTML handles structure, CSS handles presentation — making


the code clean and easy to maintain.

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!

Would you also like me to quickly give you:

• A future scope section (what can be added later)?

• A flowchart or diagram to show how users move inside the website?


(It’ll make your report even stronger!)
ER DIAGRAM OF HOSTEL MANGEMENT SYSTEM

SNAPSHOTS OF HOSTEL MANAGEMENT SYSTEM :


Conclusion:
The Hostel Management Website project successfully demonstrates the application of
fundamental web development skills using HTML and CSS.
The system provides an efficient and user-friendly interface for users to:

• View hostel details

• Explore available rooms


• Make preliminary booking requests
By digitalizing the hostel's presence, the website improves communication, enhances user
experience, and modernizes the hostel’s management approach.
Although this version is static, it lays a strong foundation for future enhancements like dynamic
content, database integration, user authentication, and online payment systems.

This project highlights the importance of having an accessible, organized, and responsive web
platform for modern hostel facilities.

References:

1. MDN Web Docs — https://developer.mozilla.org/


(For HTML and CSS official documentation)

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)

You might also like