2. HOP
Page 1
HOP
H O L I DAY O U T I N G P L A N N E D
OMIS 652
BUSINESS APPLICATIONS OF DATABASE MANAGEMENT SYSTEM
• PRAVEEN CHANDER RAMESH – Z1828096
• MOHAN BABU CHANDRASEKHAR – Z1835976
• NAVEEN KRISHNAMOORTHY – Z1829437
• MANIKANTA KUMAR CHEKURI – Z1829298
3. HOP
Page 2
TABLE OF CONTENTS
• ABSTRACT----------------------------------------------------------------------------------------------------- 3
• ER DIAGRAM------------------------------------------------------------------------------------------------- 4
• ASSUMPTIONS------------------------------------------------------------------------------------------------ 5
• DATABASE DIAGRAM---------------------------------------------------------------------------------------- 6
• QUERIES-------------------------------------------------------------------------------------------------------- 7
4. HOP
Page 3
ABSTRACT
HOP is a travel agency. This agency has a database in place to manage and store all the required
information of several processes. HOP has its branches in several locations of the country.
HOP has its own website and a mobile app to facilitate its services to the customers. The major services
offered by HOP are as follows:
1) Airline ticketing service
2) Railways ticketing service
3) Hotel booking service
4) Tours services
A customer can visit HOP’s website or access the mobile app of HOP to book tickets online for any of the
services described above. A customer can also walk in to a nearby HOP travel agency to get one’s tickets
booked with the help of a HOP’s employee. There is a payroll system for all the HOP’s employees, be it
employees maintaining website and online services or employees working at any of the agency’s branches.
Each employee belongs to either a specific location or is marked under online services in location if one
works for online system and does not belong to any of the HOP’s branches.
Each of the customer’s information such as phone number, address etc., is tracked from customer table in
the database. HOP offers several different coupons to its customers during holiday and festive seasons.
Each offer redeemed by the customer is tracked from an offers table.
Each booking of the customer is tracked by a booking ID. There exists a feedback table to store the
feedback provided by the customer. A booking status, whether the ticket has been reserved or cancelled,
is tracked through the Booking table. The payment for the service can be done either online through card
payment and net banking or through cash at the counter at one of the branches of the agency. All the
payment details are tracked from the payment table.
Each of the services such as airline, railways, hotel and tours booking are managed by separate tables to
track the specific information regarding the services such as airline number, hotel address, train number,
cost of tour packages etc.
The feedback of the customer, payment details, booking status, customers and service details can be
tracked by navigating through a centralized booking ID.
6. HOP
Page 5
ASSUMPTIONS
• Online services technical team will be tracked by one of the HOP’s locations.
• An employee works at one location only.
• Two or more employees/customers can have the same address.
• Payrolls of employees are taken only for the month of January 2017.
8. HOP
Page 7
QUERIES
1- Display booking id with customer details of those bookings which avails more than one service
select b.booking_id,b.Customer_ID, FirstName, LastName, Email, Phone, Customer_Details
from HOP_Bookings b, HOP_Service_Bookings sb, HOP_Customers c
where b.Booking_ID=sb.Booking_ID and b.Customer_ID=c.Customer_ID
group by b.Booking_ID, b.Customer_ID, FirstName, LastName, Email, Phone, Customer_Details
having COUNT(sb.Service_ID)>1
2- What are the booking ids with service ratings more than 3?
select b.Booking_ID
from HOP_Bookings b, HOP_Feedback_System fs
where b.Booking_ID=fs.Booking_ID and Service_Rating>3
3- Who are those employees having more than 1 payroll per month?
select employee_id
from HOP_Payroll
group by Employee_ID
having COUNT(Employee_ID) >1
4- Who are the employees having an increment of 1000?
select distinct employee_id
from HOP_Payroll
where Incentive_Type like '1000 increment'
5- Mention the service names and the total number of services booked under them?
select service_details, COUNT(Service_Details) as Total_Numbers_Booked
9. HOP
Page 8
from HOP_Services
group by Service_Details
6- What are those services offered between June 1st 2017 and December 31st 2017?
select sb.service_id, service_details
from HOP_Service_Bookings sb, HOP_Services s
where Booking_Start_Date between '1/6/2017' and '12/31/2017' and sb.Service_ID=s.Service_ID
7- what are the hotels having 4 star rating?
select hotel_id
from HOP_Hotels
where Hotel_Details like '4 star'
8- Provide the airline details of those airlines that come under regular category
select *
from HOP_Airlines
where Airline_Details like 'Regular'
9- Provide the railways details of rail routes that do not belong to the regular.
select *
from HOP_Railways
where Railway_Details not like 'Regular'
10- Provide the tour details of those tours that belong to weekend trip category
select *
from HOP_Tours
where Tour_Details like 'Weekend trip%'
10. HOP
Page 9
11- Provide details of new users
select *
from HOP_Customers
where Customer_Details like 'New user'
12- Provide the IDs of offers that are open
select offer_id
from HOP_Customer_Offer
where Status='Open'
13- Show all the offer details that are not BOGO
select *
from HOP_Offers
where Offer_Description not like 'Bogo Offer'
14- For all the confirmed bookings, what is the amount paid?
select b.booking_id,Payment_amount from HOP_Bookings b, HOP_Payments p
where b.Booking_ID=p.Booking_ID and b.Booking_Status='Confirmed'
15- Give the employee ID and corresponding address of those employees whose basic salary is 6000
select ea.employee_id, a.Address_ID,a.StreetAddress,a.City,a.State
from HOP_Employee e, HOP_Employee_Address ea, HOP_Payroll p, HOP_Addresses a
where ea.Employee_ID=e.Employee_ID and e.Employee_ID=p.Employee_ID and
ea.Address_ID=a.Address_ID and Basic_Salary =6000
16- Provide the details of employees working in Chicago?
select *
from HOP_Employee
11. HOP
Page 10
where Location_ID like (select Location_ID from HOP_Location where City like 'Chicago')
17- What are the agencies that has a rating of more than 3?
select *
from HOP_Agency
where Agency_Rating>3
18- In what states does HOP operate apart from New York and California?
select State
from HOP_Location
where State not like 'New York' and State not like 'California'
19- What is the first and last name of those employees who are team leaders?
select FirstName, LastName
from HOP_Employee
where Designation like 'Team Leader'
20- What are the total number of credit payments?
select COUNT(Payment_ID) as TotaNumberOfPaymentsInCredit
from HOP_Payments
where Payment_Methodology='Credit Card'