Hotel Reservation Management System: A CAL Project Report On

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

A CAL Project Report

on
Hotel Reservation Management System

to be submitted in partial fulfilling of the requirements for the course on


Database Management Systems – ITE 1003
(Slot: A1)

by

Nirmit Jatana 19BIT0017


Parth Jaiswal 19BIT0014
Aniket Kumar 19BIT0035
Ravi Kumar Rungta 19BIT0016

Under the guidance of :

Prof. Dharmendra Singh Rajput

1
Fall Semester 2020-2021
TABLE OF CONTENTS

1. Declaration…………………………………………………………….03

2. Abstract ................................................................................................. 04

3. Project Description ................................................................................. 04

4. Design of Diagram and Initial Prototype……………………………..05


5. Development of Model……………………………………………….. 17
6. Snapshots………………………………………………………....……17
7. Conclusion……………………………………………………………..24
8. References……………………………………………………………...25

2
DECLARATION

We, the undersigned solemnly declare that the project report Hotel Reservation Management
System is based on our own work carried out during the course of our study under the supervision
of Prof. Dharmendra Singh Rajput. We assert the statements made and conclusions drawn are an
outcome of our research work.

Nirmit Jatana
(19BIT0017)

Aniket Kumar
(19BIT0035)

Ravi Kumar Rungta


(19BIT0016)

Parth Jaiswal
(19BIT0014)

3
ABSTRACT:

Customer can make reservation for stay in hotel. The reservation data is managed by Employee
of the hotel. Reservation generates invoice which is to be paid by customer. Reservation
contains room details. Room details can also be accessed by the customer, if any, room details
also contains room damage details.

PROJECT DESCRIPTION:

We have created a database schema according to following requirements:

i) Hotel stores employee data as their unique emp-id, Name (First,


Middle, Last), Phone no. and Job-type.

ii) Employee manages the reservation made by the customer, they also serve to
various customer requirements.

iii) Customer data is also store by the hotel as their unique Customer
Id, Complete Name, E-mail, DOB and country.

iv) Invoice contains bill amount, invoice status and Invoice id which is generated by
the reservation which contains data as Reservation no., chk in date, chk out date
and stay duration.

v) Reservation contains Room details as Room no., Room Price and Room type,
and further, if any, contains Room Damage Details.

vi) Not all employees manage reservations.

vii) All reservations are made by customer.

viii) A customer may have several room details.

ix) Invoice is only generated if customer makes a reservation.

x) If any, Room damage details have data like Room damage id, Repair status and
damage amount.

4
DIAGRAMS:
RELATIONAL SCHEMA

5
ER DIAGRAM

CREATION OF TABLES:

create table employee (


emp_id int(5) auto_increment,
fname varchar (20) not null,
mname varchar(20),
lname varchar(20),
job_type varchar(3) ,
gender varchar(1),
primary key (emp_id),
check (job_type in ("MGR", "WTR", "RSV", "KCN")),
check ( gender in ("M","F","T"))
);
6
create table employee_details (
emp_id int(5) unique auto_increment,
id_proof varchar(10),
id_no VARCHAR(20),
contact_no varchar(10) not null,
email varchar(50),
house_no varchar(100),
city varchar(50) not null,
state varchar(50) not null,
country varchar(50) not null,
primary key (id_proof, id_no)
);

create table customer (


cust_id int auto_increment,
fname varchar (20) not null,
mname varchar(20),
lname varchar(20),
DOB date,
gender varchar(1),
primary key (cust_id),
CHECK ( gender in ("M","F","T"))
);

create table customer_details (


cust_id int unique auto_increment,
id_proof varchar(10),
id_no varchar(20),
contact_no varchar(10) not null,
email varchar(50),
house_no varchar(100),
city varchar(50) not null,
state varchar(50) not null,
7
country varchar(50) not null,
primary key (id_proof, id_no)
);

create table reservation (


booking_no varchar(7),
cust_id int(9),
room_no int not null,
from_date date not null,
to_date date not null,
primary key (booking_no)
);

create table room(


room_no int,
room_type varchar(7),
primary key (room_no),
check ( room_type in ("NORMAL","PREMIUM","SUITE") )
);

create table pricing (


room_type varchar(7),
price int,
check ( room_type in ("NORMAL","PREMIUM","SUITE") )
);

create table invoice(


invoice_no varchar(7),
booking_no varchar(7) unique,
cust_id int,
room_charge int not null,
food_charge int,
damage_charge int,
status varchar(6),
8
primary key (invoice_no),
check ( status in ("PAID", "UNPAID") )
);

create table feedback (


cust_id int,
rating int(1) default null,
comments varchar(255) default null,
primary key (cust_id)
);

INSERTION OF SAMPLE DATA:


insert into employee values (10000, "Parth", "", "Jaiswal", "MGR","M");
insert into employee values (10001, "Ram", "", "Kumar", "WTR","M");
insert into employee values (10002, "Rose", "", "William", "KCN","F");
insert into employee values (10003, "Ananya", "", "Nagar", "RSV","F");
insert into employee values (10004, "Soumik", "Bala", "Bhatta", "RSV","M");

insert into employee_details values (10000, "AADHAR", "789654123654",


9874563214, "parth@vit.com" ,"BD212, Saltlake", "Kolkata","West Bengal","India");
insert into employee_details values (10001, "PAN", "AAAAA99999", 9878554214, null
,"AD110, Saltlake","Kolkata","West Bengal","India");
insert into employee_details values (10002, "AADHAR", "789665123654",
7456663214, "rose@kcn.com" ,"110, Biju City","Cuttack","Odisha","India");
insert into employee_details values (10003, "AADHAR", "745654242654",
9234323414,null ,"Block 7, Kalinga Nagar","Bhubaneswar","Odisha","India");
insert into employee_details values (10004, "DRIVING","MH1420110062821",
9874563223, "sbb@gmail.com" ,"ABC123, XYZ Nagar","Kanpur","Uttar
Pradesh","India");

insert into customer values (10001, "Aniket", "", "Kumar", '2001-01-02',"M");


insert into customer values (10002, "Ravi", "Kumar", "Rungta", '2000-02-03',"M");
insert into customer values (10003, "Nirmit", "", "Jatana", '2001-07-30',"M");

9
insert into customer values (10004, "Victoria", "", "Bekham", '1965-05-05',"F");
insert into customer values (10005, "David", "Robert Joseph", "Bekham", '1964-12-
12',"M");

insert into customer_details values (10001, "AADHAR", "784444423654", 9555563214,


"aniket@vit.com" ,"001 Lakshmi Bai Nagar", "Jhansi","Uttar Pradesh","India");
insert into customer_details values (10002, "AADHAR", "785555423654", 9555568214,
"ravi@vit.com" ,"171, Biju Street","Jhasguda","Odisha","India");
insert into customer_details values (10003, "PAN", "BBBBB77777", 9577777214,
"nox@vit.com" ,"C102","Chandigarh","Punjab","India");
insert into customer_details values (10004, "PASSPORT", "999211981", 7911123456,
"victoris@england.com" ,"103, Churchill St.","Manchester","Greater
Manchester","United Kingdom");
insert into customer_details values (10005, "PASSPORT", "999888777", 7911456789,
"david@england.com" ,"103, Churchill St.","Manchester","Greater Manchester","United
Kingdom");

insert into reservation values ("B10001", 10001, 101, '2020-01-01', '2020-01-04');


insert into reservation values ("B10002", 10002, 102, '2020-01-02', '2020-01-08');
insert into reservation values ("B10003", 10003, 103, '2020-01-04', '2020-01-05');
insert into reservation values ("B10004", 10004, 104, '2020-01-05', '2020-01-10');
insert into reservation values ("B10005", 10005, 105, '2020-01-05', '2020-01-10');

insert into pricing values ("NORMAL", 1000);


insert into pricing values ("PREMIUM", 5000);
insert into pricing values ("SUITE", 10000);

insert into room values (101, "NORMAL");


insert into room values (102, "NORMAL");
insert into room values (103, "NORMAL");
insert into room values (104, "SUITE");
insert into room values (105, "SUITE");
insert into room values (106, "PREMIUM");
insert into room values (107, "PREMIUM");
10
insert into invoice values ("I10001","B10001" ,10001, 4000, 1000, 0, "PAID");
insert into invoice values ("I10002","B10002" ,10002, 6000, 3000, 500,"PAID");
insert into invoice values ("I10003","B10003" ,10003, 1000, 500, 0,"PAID");
insert into invoice values ("I10004","B10004" ,10004, 50000, 10000, 0,"PAID");
insert into invoice values ("I10005","B10005" ,10005, 50000, 10000, 1000,"PAID");

insert into feedback values (10001, 5, "Very good service");


insert into feedback values (10002, 3, "Need to improve food quality");

ADDING FOREIGN KEYS:


alter table employee_details
add foreign key (emp_id) references employee(emp_id);

alter table customer_details


add foreign key (cust_id) references customer(cust_id);

alter table invoice


add foreign key (cust_id) references customer(cust_id);

alter table feedback


add foreign key (cust_id) references customer(cust_id);

alter table reservation


add foreign key (cust_id) references customer(cust_id);

alter table invoice


add foreign key (booking_no) references reservation(booking_no);

alter table reservation


add foreign key (room_no) references room(room_no);

11
Description of Tables:

desc employee;

desc employee_details;

desc customer;

desc customer_details;

desc feedback;

12
desc reservation;

desc invoice;

desc pricing;

desc room;

13
select * from employee;

select * from employee_details;

select * from customer;

select * from customer_details;

select * from feedback;

14
select * from reservation;

select * from invoice;

select * from pricing;

select * from room;

15
Example Queries:

16
DEVELOPMENT OF MODEL AND SNAPSHOTS:

SNAPSHOTS OF WEB APP:

Booking Page:

Admin Page:

17
Availability Page:

Invoice Page:

Customer Details Page:

18
Feedback Page:

WORKING OF THE WEB APP (OUTPUTS):

Inserting Data:

19
Console Output

Customer Page after insertion:

Invoice Page:

20
Checking Availability:

Feedback Page:

21
QUERIES USED IN WEB APP:

For Insertion:

 Inserion into Customer: insert into customer (fname, mname, lname,


DOB, gender) values ('${cust.fname}', "${cust.mname}",
"${cust.lname}", '${cust.dob}', '${cust.gender}')

 Insertion into customer_details:


insert into customer_details (id_proof, id_no, contact_no, email, hous
e_no, city, state, country) values ('${cust.idtype}', "${cust.idno}", "$
{cust.contact}", '${cust.email}', '${cust.house}', '${cust.city}', '${cus
t.state}', '${cust.country}')

 Insert into Reservation:

o select MAX(cust_id) as custid from customer

o select min(r.room_no) as rno from reservation r inner join


room ro on r.room_no = ro.room_no where ro.room_type =
'${cust.roomtype}' and not (r.to_date between
'${cust.checkin}' and '${cust.checkout}' or (r.from_date
between '${cust.checkin}' and '${cust.checkout}')

o insert into reservation values('B${custid}', ${custid},


${result2[0].minrno}, '${cust.checkin}', '${cust.checkout}')

 Selecting Pricing for a customer and insert into Invoice:

o select r.booking_no, (datediff(r.to_date, r.from_date) * x.price)


as cost from reservation r inner join (select ro.room_no, price
from room ro inner join pricing p on ro.room_type =
p.room_type) x on x.room_no = r.room_no order by
r.booking_no desc limit 1

22
o insert into invoice (invoice_no, booking_no, cust_id,
room_charge, status) values ('I${custid}', 'B${custid}',
${custid}, ${cost}, 'UNPAID')

 Displaying Employee Details: select * from employee e inner join


employee_details ed on e.emp_id = ed.emp_id group by e.emp_id

 Insert into Employees: insert into employee (fname, mname, lname,


job_type, gender) values ('${emp.fname}', "${emp.mname}",
"${emp.lname}", '${emp.jobtype}', '${emp.gender}')

 Insert into Employee Details: insert into employee_details (id_proof,


id_no, contact_no, email, house_no, city, state, country) values
('${emp.idtype}', "${emp.idno}", "${emp.contact}", '${emp.email}',
'${emp.house}', '${emp.city}', '${emp.state}', '${emp.country}')

 Display Customer: select * from customer c inner join


customer_details cd on c.cust_id = cd.cust_id

 Updating Invoice: update invoice set food_charge = ${food_charge},


damage_charge = ${damage_charge}, status = '${payment}' where
(cust_id = ${custid} and booking_no ='${booking_no}')

 Checking Availability: select * from reservation r inner join room ro


on r.room_no = ro.room_no where ro.room_type = '${roomtype}'
and (r.to_date between '${from}' and '${to}' or (r.from_date between
'${from}' and '${to}'))

 Display Feedbacks: select c.fname, f.rating, f.comments from


feedback f inner join customer c on f.cust_id = c.cust_id

 Insert Feedback: insert into feedback values (${cust_id}, ${rating},


"${comments}")
Note: ‘${}’ represents the values inserted by the user through HTML forms.
23
CONCLUSION:
This web-app demonstrates a computerized version of hotel database management system
which can replace paperwork database management in small hotels.
It makes entire process digital where admin can add customers and employees, review the
database and edit invoice. Through this project, database admin can digitally monitor the
status of rooms. It also helps in maintaining a systematic and structured database for old
and new reservations.
The future scope of this project is that many more features such as online automated cloud
backup, Images addition, and extension to various online services like Oyo rooms can be
added.

24
REFERENCES:
[01] Varalakshmi P., Hima S. and Surekha Mariam Varghese, “CASSANDRA A
DISTRIBUTED NOSQL DATABASE FOR HOTEL MANAGEMENT SYSTEM”,
International Journal on Cybernetics & Informatics (IJCI) Vol. 5, No. 2, April 2016

25

You might also like