Hospital Data Analysis

This project demonstrates how to clean, join, and analyse real-world hospital data using SQL. The final output is a Tableau-ready dataset that tracks customer service and patient experience across hospitals in the United States.
altText of the image

Project Overview

This project is divided into two parts:

  1. SQL Data Preparation: Combining and cleaning two datasets:

    1. HCAHPS (Hospital Consumer Assessment of Healthcare Providers and Systems) survey data.

    2. Hospital beds data.

  2. Tableau Dashboard: Creating an interactive dashboard to visualise hospital performance based on survey responses and hospital sizes.

Features

  • Cleaning raw data by formatting dates and correcting CMS certification numbers.

  • Handling duplicates by selecting the most recent hospital bed reports.

  • Joining HCAHPS data with hospital bed data for enhanced insights.

  • Exporting the cleaned data to a .csv file for use in Tableau.

Prerequisites

  • PostgreSQL with PGAdmin installed.

  • Tableau (or any data visualisation tool capable of processing .csv files).

Datasets

  • HCAHPS Data: Contains survey responses, hospital names, and survey metrics.

  • Hospital Beds Data: Contains hospital names, the number of beds, and fiscal year reporting.

SQL Steps

  1. Create Tables:

    1. Define tables for HCAHPS data and hospital beds data.
  2. Clean Data:

    1. Format dates and pad CMS certification numbers to six digits.
  3. Handle Duplicates:

    1. Use ROW_NUMBER() to select the most recent records for each hospital.
  4. Join Data:

    1. Combine the two datasets into one unified dataset.
  5. Export Data:

    1. Save the cleaned dataset as tableau_file.csv.