{"id":23066359,"url":"https://github.com/thomas-nyanumba/seattle-sql-airbnb-project","last_synced_at":"2025-10-09T07:33:15.110Z","repository":{"id":262558834,"uuid":"887649546","full_name":"Thomas-Nyanumba/Seattle-SQL-Airbnb-Project","owner":"Thomas-Nyanumba","description":"Analytics Extra Mentorship SQL Capstone Project","archived":false,"fork":false,"pushed_at":"2024-11-14T13:51:01.000Z","size":2455,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T09:12:25.457Z","etag":null,"topics":["database-management","mssm","queries","relational-databases","sql","sql-server"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/thomasnyanumba","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thomas-Nyanumba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T03:26:11.000Z","updated_at":"2024-11-20T09:20:21.000Z","dependencies_parsed_at":"2024-12-16T05:12:48.568Z","dependency_job_id":"66a63c77-d502-495a-982e-bf7c2970de77","html_url":"https://github.com/Thomas-Nyanumba/Seattle-SQL-Airbnb-Project","commit_stats":null,"previous_names":["thomas-nyanumba/seattle-airbnb-project","thomas-nyanumba/seattle-sql-airbnb-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Thomas-Nyanumba/Seattle-SQL-Airbnb-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thomas-Nyanumba%2FSeattle-SQL-Airbnb-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thomas-Nyanumba%2FSeattle-SQL-Airbnb-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thomas-Nyanumba%2FSeattle-SQL-Airbnb-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thomas-Nyanumba%2FSeattle-SQL-Airbnb-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thomas-Nyanumba","download_url":"https://codeload.github.com/Thomas-Nyanumba/Seattle-SQL-Airbnb-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thomas-Nyanumba%2FSeattle-SQL-Airbnb-Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000960,"owners_count":26082973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-management","mssm","queries","relational-databases","sql","sql-server"],"created_at":"2024-12-16T05:12:45.663Z","updated_at":"2025-10-09T07:33:15.095Z","avatar_url":"https://github.com/Thomas-Nyanumba.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Seattle Airbnb SQL Capstone Project\n![](https://github.com/Thomas-Nyanumba/Seattle-Airbnb-Project/blob/main/Seattle%20Airbnb.png)\n\n## Introduction \nThis project [link](https://github.com/Thomas-Nyanumba/Seattle-Airbnb-Project/blob/main/ProjectSQLCode.sql) represents a detailed SQL analysis of Airbnb listings in Seattle, conducted as part of the **Analytics Extra Data Analytics Mentorship Program.** The analysis explores various aspects of the Airbnb market, including pricing trends, host revenue, guest sentiment, and seasonal trends. This project demonstrates my proficiency in SQL through data cleaning, transformation, aggregation, and insightful analysis.\n\n## Problem Statement\nThis analysis addressed the following business questions:\n1. Which neighborhood generates the highest total revenue, and what is the average listing price?\n2. How do average listing prices vary across neighborhoods?\n3. How frequently does the word \"comfortable\" appear in guest reviews?\n4. Which listings have a high proportion of positive reviews?\n5. How much revenue did each host generate from listings reviewed within the past year?\n6. How many hosts are named \"Stan\" (case-insensitive)?\n7. What is the total revenue from listings priced above $700?\n8. Which listing has the highest number of reviews?\n9. Which listings were last reviewed in the final quarter of 2022?\n10. How can listings be categorized as \"high-priced\" or \"low-priced\" based on neighborhood averages?\n\n## Skills and Concepts Demonstrated\n- **SQL Joins**: Inner, Left joins to combine data from multiple tables.\n- **Data Cleaning**: Type conversion, NULL value handling, and filtering.\n- **Data Aggregation and Filtering**: SUM, AVG, COUNT, and `WHERE` clauses.\n- **Conditional Logic**: Using `CASE` statements for categorization.\n- **Window Functions and CTEs**: Using `ROW_NUMBER()` and `WITH` clauses.\n\n## Data Overview\nThe dataset consists of three tables:\n1. **Listings**: Contains unique listing details, including location and pricing.\n2. **Pricing**: Captures pricing and availability data over time.\n3. **Reviews**: Stores guest reviews, ratings, and feedback for each listing.\n\n## Results and Analysis\n### 1. Neighborhood with the Highest Revenue and Average Price\nThis query identifies the neighborhood with the highest total revenue and the average listing price.\n\n**Result:** The neighborhood with the highest revenue and average price highlights areas of high demand.\n\u003cpre\u003e\u003ccode class=\"sql\"\u003e\nSELECT TOP 1  l.neighbourhood,\n    SUM(p.price) AS total_revenue,\n    AVG(p.price) AS avg_price_per_listing\nFROM listings l\nJOIN pricing p ON l.id = p.listing_id\nGROUP BY l.neighbourhood\nORDER BY total_revenue DESC;\n\u003c/code\u003e\u003c/pre\u003e\n\n### 2. Average Listing Price by Neighbourhood\nHere, I compare the average price of listings across neighborhoods to identify pricing trends.\n\n**Result:** Some neighborhoods have significantly higher average prices, indicating potential for premium markets.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    l.neighbourhood,\n    AVG(p.price) AS avg_price\nFROM listings 1\nJOIN pricing p ON l.id = p.listing_id\nGROUP BY l.neighbourhood\nORDER BY avg_price DESC;\n\u003c/code\u003e\u003c/pre\u003e\n\n### 3. Count of \"Comfortable\" in Reviews\nThis query counts the occurrences of the word **comfortable** in the reviews.\n\n**Result:** The count shows guest sentiment trends based on commonly used terms.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    COUNT(*) AS comfortable_count\nFROM reviews r\nWHERE LOWER(CAST(r.comments AS VARCHAR (MAX))) LIKE '%comfortable%'; \n\u003c/code\u003e\u003c/pre\u003e\n\n### 4. Listings with High Proportion of Positive Reviews\nI filtered listings with positive review keywords (**great**, **comfortable**, **good**) to identify highly rated properties.\n\n**Result:** Identifies listings that maintain a high ratio of positive feedback.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    l.id AS listing_id,\n    l.name AS listing_name,\n    COUNT(r.ID) AS total_reviews,\n    SUM(CASE WHEN LOWER (CAST(r.comments AS VARCHAR (MAX))) LIKE '%great%' \n\tOR LOWER(CAST(r.comments AS VARCHAR (MAX))) LIKE '%comfortable%' \n\tOR LOWER(CAST(r.comments AS VARCHAR (MAX))) LIKE '%good%' THEN 1 ELSE 0 END) AS positive_reviews\n\nFROM listings l\nJOIN reviews r ON l.id = r.listing_id\nGROUP BY l.id, l.name\nHAVING (SUM(CASE WHEN LOWER(CAST(r.comments AS VARCHAR (MAX))) LIKE '%great%' \nOR LOWER(CAST(r.comments AS VARCHAR (MAX))) LIKE '%comfortable%' \nOR LOWER(CAST(r.comments AS VARCHAR (MAX))) LIKE '%good%' THEN 1 ELSE 0 END) / COUNT(r.ID)) \u003e 0.5;\n\u003c/code\u003e\u003c/pre\u003e\n\n### 5. Revenue by Host for Recent Reviews\nCalculated revenue from listings reviewed in the last year to understand recent host performance.\n\n**Result:** Lists hosts with notable recent revenue performance.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    l.host_name,\n    SUM(p.price) AS total_revenue\nFROM listings l\nJOIN pricing p ON l.id = p.listing_id\nJOIN reviews r ON l.id = r.listing_id\nWHERE r.date IS NOT NULL\nAND r.date \u003e= DATEADD(YEAR, -1, GETDATE())\nGROUP BY l.host_name;\n\u003c/code\u003e\u003c/pre\u003e\n\n### 6. Hosts Named \"Stan\"\nI performed a case-insensitive search to find hosts named **Stan.**\n\n**Result:** Provides a count of hosts named Stan, useful for networking or demographic analysis.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    DISTINCT l.host_name\nFROM listings l\nWHERE LOWER(l.host_name) = 'stan';\n\u003c/code\u003e\u003c/pre\u003e\n\n### 7. Total Revenue from High-Priced Listings\nRevenue generated by listings priced above $700 helps identify high-value properties.\n\n**Result:** Shows the revenue impact of high-priced listings.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    l.id AS listing_id,\n    l.name AS listing_name,\n    SUM(p.price) AS total_revenue\nFROM listings l\nJOIN pricing p ON l.id = p.listing_id\nWHERE p.price \u003e 700\nGROUP BY l.id, l.name;\n\u003c/code\u003e\u003c/pre\u003e\n\n### 8. Most Reviewed Listing\nThis query finds the listing with the highest review count.\n\n**Result:** Highlights the most popular listing based on review volume.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT TOP 1\n    l.id AS listing_id,\n    l.name AS listing_name,\n    COUNT(r.ID) AS review_count\nFROM listings l\nJOIN reviews r ON l.id = r.listing_id\nGROUP BY l.id, l.name\n\u003c/code\u003e\u003c/pre\u003e\n\n### 9. Listings Reviewed in Q4 2022\nFinds listings with reviews from October to December 2022, focusing on recent performance.\n\n**Result:** Provides data on recent listings’ review activity.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\nSELECT \n    l.id AS listing_id,\n    l.name AS listing_name,\n    r.date AS last_review_date\nFROM listings l\nJOIN reviews r ON l.id = r.listing_id\nWHERE r.date IS NOT NULL\nAND r.date BETWEEN '2022-10-01' AND '2022-12-31';\n\u003c/code\u003e\u003c/pre\u003e\n\n### 10. Categorization of Listings as High- or Low-Priced\nUsing a neighborhood average, I categorized listings into \"high-priced\" or \"low-priced.\"\n\n**Result:** Shows the categorization of listings and highlights the potential pricing strategy.\n\u003cpre\u003e\u003ccode class = \"sql\"\u003e\n    WITH neighborhood_avg AS (\n    SELECT \n        neighbourhood,\n        AVG(p.price) AS avg_neighborhood_price\n    FROM listings l\n    JOIN pricing p ON l.id = p.listing_id\n    GROUP BY neighbourhood\n)\nSELECT \n    l.id AS listing_id,\n    l.name AS listing_name,\n    p.price,\n    CASE \n        WHEN p.price \u003e na.avg_neighborhood_price THEN 'high-priced'\n        ELSE 'low-priced'\n    END AS price_category,\n    SUM(p.price) AS total_revenue\nFROM listings l\nJOIN pricing p ON l.id = p.listing_id\nJOIN neighborhood_avg na ON l.neighbourhood = na.neighbourhood\nGROUP BY l.id, p.price, na.avg_neighborhood_price, l.name;\n\u003c/code\u003e\u003c/pre\u003e\n\n## Conclusion \nThis analysis offers insights into Seattle's Airbnb market by examining revenue, pricing, guest sentiment, and listing performance. These findings provide Airbnb hosts with actionable insights for optimizing pricing and improving guest experience.\n\n## Recommendations \n1. Dynamic Pricing: Adjust prices seasonally to match occupancy patterns.\n2. Customer Satisfaction: Encourage positive feedback by enhancing amenities.\n3. Targeted Marketing: Promote high-rated and high-priced listings in premium areas.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas-nyanumba%2Fseattle-sql-airbnb-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomas-nyanumba%2Fseattle-sql-airbnb-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas-nyanumba%2Fseattle-sql-airbnb-project/lists"}