Built with datascienceportfol.io

Hotel Analysis

Project photo

Skills

About this project

SQL Query Used

--Total Revenue Hotels made in a Year by Hotels
with H as(
Select * from Hotel_Revenue2022
      union 
Select * from Hotel_Revenue2023
)

Select hotel,arrival_date_year,
round(SUM((stays_in_weekend_nights + stays_in_week_nights)*adr),2) as Revenue
from H
group by hotel,arrival_date_year,stays_in_weekend_nights,stays_in_week_nights,adr
Order by arrival_date_year,hotel asc

--Total Revenue made
With H as (
Select * from Hotel_Revenue2022
      union 
Select * from Hotel_Revenue2023
)

Select
SUM((stays_in_weekend_nights + stays_in_week_nights)* (discount * adr)) as Revenue
from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal

--Hotel by Market Segment and MealCost
With H as (
Select * from Hotel_Revenue2022
      union 
Select * from Hotel_Revenue2023
)

Select * from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal

 


--Average Salary Made by Hotels
With H as(
Select * from Hotel_Revenue2022    
        union
Select * from Hotel_Revenue2023
)
  Select  
  CAST(AVG(adr) as decimal(10,2))as AverageSalary
  from H
 Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
 Left Join meal_cost$ on  meal_cost$.meal = h.meal

--Total Nights at the Hotel
With H as(
Select * from Hotel_Revenue2022 as F    
        union
Select * from Hotel_Revenue2023 as A
)
  Select 
  SUM(stays_in_week_nights + stays_in_weekend_nights) as TotalNights 
 from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal


--Average Discount 
With H as(
Select * from Hotel_Revenue2022 as F
    union
Select * from Hotel_Revenue2023
)

 
   Select AVG(Discount) as AverageDiscount from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal

--Car Space Available for parking
With H as(
Select * from Hotel_Revenue2022 
    union
Select * from Hotel_Revenue2023
)

 
   Select Sum(Park_Space) as Park_Space from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal


--Revenue by Reservation Status and Hotel Type
With H as(
Select * from Hotel_Revenue2022 
    union
Select * from Hotel_Revenue2023
)

 
   Select Reservation_status,hotel,
   SUM((stays_in_weekend_nights + stays_in_week_nights)* (discount * adr)) as Revenue
   from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal
Group by reservation_status,hotel

--Hotel Type by arrival date year parking Space percentage 
With H as(
Select * from Hotel_Revenue2022 
    union
Select * from Hotel_Revenue2023
)

 
   Select arrival_date_year,hotel,
   SUM(stays_in_week_nights + stays_in_weekend_nights) * 100 / SUM(park_space) as Park_Percentage
  
   from H
Left JOIN marketsegment$ on H.market_segment = marketsegment$.market_segment
Left Join meal_cost$ on  meal_cost$.meal = h.meal
Group by arrival_date_year,hotel