NASHVILLE HOUSING DATA CLEANING

A SQL Server data cleaning project transforming a 56,000+ row Nashville housing dataset into a clean, consistent and analysis-ready dataset.

PROJECT OVERVIEW

This project takes a real-world Nashville, Tennessee property sales dataset and cleans it using T-SQL in SQL Server. The objective is to standardize inconsistent data, handle missing values, split combined fields, remove duplicate records and prepare the dataset for further analysis.

KEY ANALYSIS

The project focuses on practical data-cleaning techniques required when working with messy real-world datasets, including relationship-based missing-value handling, address transformation, categorical standardization and business-rule-based duplicate detection.

TOOLS & TECHNOLOGIES

SQL Server 2025   |   SQL Server Management Studio (SSMS)   |   T-SQL

DATA CLEANING TECHNIQUES

  • Date Standardization: Converted the original SaleDate datetime values into a clean date format.
  • Missing Property Addresses: Used a self-join on ParcelID to populate missing PropertyAddress values from related records.
  • Address Splitting: Split PropertyAddress into address and city fields and OwnerAddress into address, city and state fields.
  • Categorical Standardization: Converted inconsistent Y/N and Yes/No values in SoldAsVacant into standardized Yes/No values.
  • Duplicate Removal: Used ROW_NUMBER() with PARTITION BY to identify duplicate records according to business rules.
  • Column Cleanup: Removed redundant original columns after creating cleaned replacement fields.

KEY SQL TECHNIQUES

Self-Joins   |   ISNULL()   |   CASE WHEN   |   SUBSTRING()   |   CHARINDEX()   |   PARSENAME()   |   CTEs   |   ROW_NUMBER()   |   PARTITION BY   |   ALTER TABLE

KEY LEARNINGS

Real-world datasets rarely import cleanly. This project demonstrates how SQL can be used not only for querying data, but also for systematically transforming messy operational data into a reliable foundation for analysis and reporting.

A major focus was defining duplicates using business logic rather than relying only on technical identifiers. The project also demonstrates how self-joins can be used to recover missing information from related records.

PROJECT REPOSITORY

The complete commented T-SQL script and project documentation are available on GitHub.