Hotel Bookings Analysis

Data Analysis
Microsoft SQL Server
Microsoft SQL Server Management Studio
Microsoft Power Bi

Table of contents

Goals

  • Is hotel revenue growing by year ?
  • Should we increase the parking lot size ?
  • What trends can we see in the data ?

Tools

  • Microsoft SQL Server
  • Microsoft SQL Server Management Studio
  • Microsoft Power Bi

Tasks

  • Build a Database
  • Analyze and Retrieve Data with SQL
  • Connect Power BI to Database
  • Visualize Data in Power BI

Analysis

SQL Server

WITH hotels AS (
	SELECT * FROM dbo.['2018$']
	UNION
	SELECT * FROM dbo.['2019$']
	UNION
	SELECT * FROM dbo.['2020$']
)

Is our Hotel data growing

By year

SELECT
	arrival_date_year,
	ROUND(SUM((stays_in_week_nights + stays_in_weekend_nights) * adr), 2) AS revenue
FROM hotels
GROUP BY arrival_date_year
arrival_date_yearrevenue
20184885517.06
201920188409.4
202014284246.24

By year and hotel type

SELECT
	arrival_date_year,
	hotel,
	ROUND(SUM((stays_in_week_nights + stays_in_weekend_nights) * adr), 2) AS revenue
FROM hotels
GROUP BY
    arrival_date_year,
    hotel
arrival_date_yearhotelrevenue
2018City Hotel1764667.57
2019City Hotel10755979.11
2020City Hotel8018122.43
2018Resort Hotel3120849.49
2019Resort Hotel9432430.29
2020Resort Hotel6266123.81

Power BI

Importing sql data in power BI

Import the SQL Server by using connection name and database name. Select Advanced Options and enter the following SQL Query

WITH hotels AS (
	SELECT * FROM dbo.['2018$']
	UNION
	SELECT * FROM dbo.['2019$']
	UNION
	SELECT * FROM dbo.['2020$']
)

SELECT * FROM hotels
	LEFT JOIN dbo.market_segment$
	ON hotels.market_segment = market_segment$.market_segment
	LEFT JOIN dbo.meal_cost$
	ON meal_cost$.meal = hotels.meal

Analysis Dashboard

Analysis Dashboard

Source Code

Deon Gracias
© 2025 All Rights Reserved