Skip to content

sql data analysis on san diego airbnb listings data

Notifications You must be signed in to change notification settings

n8tmps/airbnb-analysis-sd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airbnb Listings Analysis in San Diego

Introduction

Understanding market trends is essential for Airbnb hosts and property managers to optimize their strategies and boost profitability. Analyzing which listings are most popular can reveal features that attract the most guests, offering valuable insights for enhancing other properties.

This analysis aims to provide insights to the following questions of interest:

  1. Which neighborhoods have the highest number of listings?
  2. What are the most expensive neighbourhoods to book?
  3. Who are the hosts with the most listings?
  4. Which months are the most popular to book in prominent neighborhoods?

The detailed lisitings data can be found here.

Setup and Installation

The procedure involved using SQLAlchemy in Python to import a CSV file into a MySQL database. Initially, the CSV data was read into a pandas DataFrame. Then, an SQLAlchemy engine was created to establish a connection with the MySQL database. Using pandas 'to_sql' method, the DataFrame contents were efficiently transferred into a MySQL table. This method facilitated a streamlined data import process, optimizing data management and enabling straightforward analysis through MySQL's capabilities.

Insights

From the analyis carried out, I was able to gain the following insights:

1. The neighborhoods with the highest number of bookings are Mission Bay, Pacific Beach, La Jolla, Ocean Beach, and North Hills.
2. The most expensive neighbourhoods to book are Torrey Pines, Moreno Mission, La Jolla, Wooded Area, and Del Cerro.
3. The hosts with the most listings are Surf Style, Bluewater Vacation Homes, Coast Vacation Homes, Evan, and La Jolla.
4. March is the most popular month to book Airbnbs in San Diego. This could be attributed to students going on Spring Break.

Analysis

Queries used to obtain these insights and the results will be shown below each of the business question.

Which neighborhoods have the highest number of listings?

  SELECT neighbourhood_cleansed, count(*) AS num_listings
  FROM listings
  GROUP BY neighbourhood_cleansed
  ORDER BY num_listings DESC;

What are the most expensive neighbourhoods to book?

  SELECT neighbourhood_cleansed,
         AVG(CAST(REPLACE(REPLACE(price, '$', ''), ',', '') AS DECIMAL(10, 2))) AS avg_price
  FROM listings
  GROUP BY neighbourhood_cleansed
  ORDER BY avg_price DESC;

Who are the hosts with the most listings?

  SELECT host_id, host_name, host_neighbourhood,
      count(*) as num_listings
  FROM listings
  GROUP BY host_neighbourhood, host_id, host_name
  ORDER BY num_listings DESC;

Which months are the most popular to book in prominent neighborhoods?

SELECT 
		MONTH(last_review) AS month,
		COUNT(name) AS num_reviews
FROM 
		listings
WHERE
		last_review IS NOT NULL
		AND neighbourhood_cleansed IN ('La Jolla', 'Mission Bay', 'North Hills', 'Ocean Beach', 'Pacific Beach')
GROUP BY 
		MONTH(last_review)
ORDER BY 
		num_reviews DESC;

Dashboard

Check out my interactive Tableau Dashboard

About

sql data analysis on san diego airbnb listings data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages