0% found this document useful (0 votes)
9 views12 pages

Dbms Casestudy

D

Uploaded by

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

Dbms Casestudy

D

Uploaded by

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

DATA BASE MANAGEMENT

SYSTEM

CASE STUDY ON HOTEL MANAGEMENT


Introduction:
Hotel needs to maintain the record of guests and
reserve rooms beforehand. Customers should be
able to know the availability of the rooms on a
particular date. They should be able to reserve
the available rooms according to their need in
advance. To make their stay comfortable, they
are provided with food and other services. The
record of the food taken by each customer and
the services availed by the customer should be
kept. These records help in generating bill.
2. Requirements

The hotel management system should be able to


satisfy the following requirements :
 The system should be able to keep the
records of the guests and the room allotted
to them.
 Customers should be able to know the
availability of the rooms on a particular date.
 Guests should be able to book the available
rooms online.
 The record of food and services availed by
the customer should be kept.
 The system should be able to generate the
bill for a customer.
Entities and Attributes:
 HOTEL has the attributes name,code,location,contact
number and number of rooms available in the hotel.
 EMPLOYEE has the attributes like name,employee
id,their experience,email id and phone number.
 CUSTOMER has the attributes like name,id,age,contact
number and address.
 RESERVATION has the attributes id,room number,type
of room,check in and out dates,number of guests, status
and mode of reservation.
 BILL has the attributes bill id,customer id,amount,date
of payment and mode of payment.

Relations and their description


 CUSTOMERS are ALLOTED ROOM from CheckIn Date to
CheckOut Date.
 One CUSTOMER can be alloted more than one room.
 CUSTOMER PAYS BILL .BILL payment can be of any
mode.
 EMPLOYEE takes care of the facilities provided to the
CUSTOMERS.
 CUSTOMERS RESERVE the room either via online or
offline.
 HOTEL GIVES the information to the CUSTOMERS and
provides EMPLOYMENT to EMPLOYEES.
Schema of Hotel Management System

No_of_rooms
id
location Hotel_id
email
experience
name Ph_no name
phno

hotel Works in employee

choose Works for


s age

Id phno

address
name

customer

makes

guests
amount checkin
date
cust_id checkout
mode Room_no

Bill_id Bill reservation id

mode
status Room_type
Coding:
Creating tables
mysql> create database hotel_management;

Query OK, 1 row affected (0.09 sec)

mysql> use hotel_management;

>Database changed

mysql> create table hotel(hotel_name varchar(30) Not Null,hotel_code


varchar(20) Primary Key,location varchar(30) Not Null,no_of_rooms int(4) Not
Null,ph_no int(12) Not Null);

Query OK, 0 rows affected, 2 warnings (0.12 sec)

mysql> create table employee(emp_name varchar(20) Not Null,emp_id


varchar(15) Primary Key,emp_experience varchar(10) Not Null,emp_email
varchar(35) Unique, emp_phno int(12) Unique);

Query OK, 0 rows affected, 1 warning (0.06 sec)

mysql> create table reservation(reserve_id varchar(20) Primary Key,room_no


varchar(8) Unique,room_type varchar(15) Not Null,check_in date,check_out
date,no_of_guests int(4) Not Null,status varchar(15),mode_of_reservation(15));

Query OK, 0 rows affected (0.05 sec)

mysql> create table customer(customer_id varchar(15) Primary


Key,customer_name varchar(30) Not Null,customer_age int(4) Not
Null,customer_phno int(12) Unique,customer-addr varchar(30) Not Null);

Query OK, 0 rows affected, 2 warnings (0.05 sec)

mysql> create table bill(bill_id varchar(15) Primary Key,customer_id


varchar(15),amount decimal,date_of_payment date,mode_of_payment
varchar(10));

Query OK, 0 rows affected (0.04 sec)

Insertion into tables


mysql> insert into hotel
values("Sitara","sitara111","secunderabad",40,"9484746454");
Query OK, 1 row affected (0.02 sec)
mysql> insert into hotel values("Maurya International
Hotel","maurya111","madhapur",50,"9080706050");
Query OK, 1 row affected (0.01 sec)
mysql> insert into hotel
values("Novotel","novotel111","Kondapur",125,"8090080900");
Query OK, 1 row affected (0.01 sec)
mysql> insert into hotel values("Royalton
Hotel","royalton111","Abids",70,"9000080000");
Query OK, 1 row affected (0.01 sec)
mysql> insert into hotel values("Hotel park
Continental","pcontinental111","Masab tank",74,"9898989898");
Query OK, 1 row affected (0.01 sec)

mysql> insert into employee


values("virat","e123","4years","[email protected]","9595950000");
Query OK, 1 row affected (0.01 sec)
mysql> insert into employee
values("nivettha","e124","2years","[email protected]","8000900706");
Query OK, 1 row affected (0.01 sec)
mysql> insert into employee
values("harshith","e125","5years","[email protected]","8686856540");
Query OK, 1 row affected (0.01 sec)
mysql> insert into employee values("priya","e126","1.5
years","[email protected]","8009687654");
Query OK, 1 row affected (0.01 sec)
mysql> insert into employee values("sudharshan","e127","7
years","[email protected]","6300078654");
Query OK, 1 row affected (0.01 sec)

mysql> insert into reservation values("R123","s15","single


room",20221218,20221220,1,"reserved","offline");
Query OK, 1 row affected (0.01 sec)
mysql> insert into reservation values("R124","s17","double
room",20221224,20221228,3,"reserved","online");
Query OK, 1 row affected (0.02 sec)
mysql> insert into reservation values("R125","f04","twin
room",20230105,20230108,2,"unreserved","online");
Query OK, 1 row affected (0.01 sec)
mysql> insert into reservation values("R126","404","single
room",20221206,20221211,1,"reserved","online");
Query OK, 1 row affected (0.01 sec)
mysql> insert into reservation values("R127","217","quad
room",20221228,20221231,4,"unreserved","offline");
Query OK, 1 row affected (0.01 sec)

mysql> insert into customer


values("c123","sumeeth",32,"1234567890","Banglore");
Query OK, 1 row affected (0.01 sec)
mysql> insert into customer
values("c124","Neesha",45,"2345678901","Hyderabad");
Query OK, 1 row affected (0.01 sec)
mysql> insert into customer values("c125","Rahul",29,"3456789012","kurnool");
Query OK, 1 row affected (0.01 sec)
mysql> insert into customer
values("c126","mounik",35,"4567890123","Hyderabad");
Query OK, 1 row affected (0.01 sec)
mysql> insert into customer
values("c127","vishika",38,"5678901234","siddipet");
Query OK, 1 row affected (0.01 sec)

mysql> insert into bill values("123","c123",9475,20221222,"online");


Query OK, 1 row affected (0.01 sec)
mysql> insert into bill values("456","c124",4523,20230102,"upi");
Query OK, 1 row affected (0.01 sec)
mysql> insert into bill values("789","c125",20235,20221212,"debit card");
Query OK, 1 row affected (0.01 sec)
mysql> insert into bill values("012","c126",6800,20221201,"cash");
Query OK, 1 row affected (0.01 sec)
mysql> insert into bill values("0123","c127",10150,20221218,"online");
Query OK, 1 row affected (0.01 sec)
Output:

You might also like