Welcome to the Airbnb Data Analysis repository! In this project, we explore and analyze Airbnb data using SQL queries. This analysis provides valuable insights into the Airbnb market, allowing us to understand pricing trends, popular neighborhoods, host activity, and more.
The dataset used for this analysis contains information about Airbnb listings in Menorca. It includes the following columns:
- host_id: The ID of the host
- neighbourhood: The neighborhood where the property is located
- room_type: The type of room (e.g., entire home/apartment, private room, shared room)
- price: The price per night for the listing
- minimum_nights: The minimum number of nights required for booking
- number_of_reviews: The total number of reviews for the listing
- calculated_host_listings_count: The number of listings the host has
- availability_365: The number of days the listing is available in a year
- number_of_reviews_ltm: The number of reviews in the last twelve months
SELECT * FROM airbnb_menorca
ORDER BY number_of_reviews DESC LIMIT 10;
SELECT host_id, COUNT(*) AS num_properties
FROM airbnb_menorca
GROUP BY host_id
ORDER BY num_properties DESC LIMIT 10;
SELECT DISTINCT neighbourhood, COUNT(host_id) AS num_Airbnb
FROM airbnb_menorca
GROUP BY neighbourhood
ORDER BY num_Airbnb DESC LIMIT 10;
SELECT room_type, COUNT(room_type) AS num_Airbnb
FROM airbnb_menorca
GROUP BY room_type
ORDER BY room_type DESC;
SELECT neighbourhood, AVG(availability_365) AS avg_availability
FROM airbnb_menorca
GROUP BY neighbourhood;
SELECT
AVG(availability_365) AS avg_availability,
MAX(availability_365) AS max_availability,
MIN(availability_365) AS min_availability
FROM airbnb_menorca;
SELECT
minimum_nights,
AVG(price) AS avg_price,
COUNT(*) AS num_listings
FROM airbnb_menorca
GROUP BY minimum_nights
ORDER BY minimum_nights;
SELECT room_type, AVG(availability_365) AS avg_availability
FROM airbnb_menorca
GROUP BY room_type;
SELECT
CASE
WHEN number_of_reviews <= 10 THEN '0-10'
WHEN number_of_reviews <= 50 THEN '11-50'
WHEN number_of_reviews <= 100 THEN '51-100'
ELSE '101+'
END AS review_range,
AVG(price) AS avg_price
FROM airbnb_menorca
GROUP BY review_range;
SELECT DISTINCT neighbourhood, room_type, AVG(price) AS avg_price
FROM airbnb_menorca
GROUP BY neighbourhood, room_type
ORDER BY avg_price DESC;
SELECT DISTINCT neighbourhood, COUNT(host_id) AS num_Airbnb
FROM airbnb_menorca
GROUP BY neighbourhood
ORDER BY num_Airbnb DESC;
SELECT
neighbourhood,
SUM(number_of_reviews_ltm) AS total_reviews_ltm
FROM airbnb_menorca
GROUP BY neighbourhood;
SELECT neighbourhood,room_type,
AVG(minimum_nights) AS avg_min_nights
FROM airbnb_menorca
GROUP BY neighbourhood, room_type;
SELECT DISTINCT neighbourhood,
AVG(price) OVER (PARTITION BY neighbourhood) AS avg_price
FROM airbnb_menorca
ORDER BY avg_price DESC;
SELECT DISTINCT neighbourhood, CONCAT(ROUND(AVG(price), 2),'€') AS avg_price
FROM airbnb_menorca
GROUP BY neighbourhood
ORDER BY avg_price DESC;