SQL Projects with Table Relationships

Master joins, relationships, and multi-table analysis with real-world datasets.

Overview

Congratulations on completing Level 2 SQL concepts! You're now ready to take on more complex challenges that will help you master:

  • Multi-table JOINs and UNIONs for comprehensive data analysis
  • Advanced filtering techniques with CASE WHEN statements and complex aggregations
  • Pattern recognition and trend analysis using SQL logic
  • Working with messier, more nuanced real-world datasets
  • Independent problem-solving with minimal guidance

If you haven't set up your SQL environment yet, you can find detailed setup instructions on the Level 1 Projects page. Once you're ready, dive into these three challenging projects that will put your skills to the test.

Project 1: YouTube Comments & Popularity Analysis

Project Overview

Explore the relationship between a video's popularity and its most liked or relevant comments. You'll work with video-level statistics and user-generated comments, including sentiment analysis. This project gives you a chance to connect engagement metrics with audience reactions using SQL.


Your goal is to uncover what kinds of videos drive more engagement, what comment patterns appear for high-performing videos, and how sentiment relates to popularity.

High-level Business Questions

Remember: Your goal is to surface actionable recommendations for content creators or platform strategists.

1. Which keywords are associated with the highest-performing videos?

  • Consider analyzing by views, likes, and comments.
  • Are there common patterns in topics or content types?

2. Do videos with high engagement (likes/views/comments) tend to have more positive, negative, or neutral comments?

  • Use average sentiment across comments per video.
  • Do high-performing videos attract more extreme sentiment?

3. What is the relationship between comment volume and comment sentiment?

  • Do videos with more comments have more polarized (0 or 2) reactions?
  • Are neutral comments more common on low-engagement videos?

4. Which videos have the most liked comments, and what is the sentiment of those top comments?

  • Are the top-liked comments generally positive or critical?
  • Do they align with the video's popularity?

5. What proportion of videos have disabled comments or hidden like counts?

  • Do these videos still perform well in terms of views?
  • Is there a trend by keyword or publishing date?

6. Are there keywords that consistently result in higher comment sentiment or more liked comments?

  • Can creators use this insight to drive more engagement?

7. How does the publication date relate to performance?

  • Are newer videos trending better or worse than older ones?
  • Does sentiment vary over time?

Ready to get started?

Download the YouTube dataset collection below and import it into your PostgreSQL database to begin your analysis.

Download Dataset from Kaggle

Project 2: Mental Health Insights Dashboard

Project Overview

Analyze global mental health data across multiple tables to uncover patterns in prevalence, treatment gaps, and disease burden. You'll work with datasets on mental illness rates, healthcare coverage, depressive symptoms, and treatment disparities across countries and years.


Your goal is to build a mental health insights dashboard that helps public health organizations understand where the biggest needs and gaps are—and where they might focus future mental health resources.

High-level Business Questions

Remember: Your goal is to surface actionable recommendations for public health decision-makers.

1. Which countries and regions have the highest and lowest prevalence of different mental illnesses over time?

  • Are rates increasing or decreasing?
  • Which disorders are most common?

2. How does the burden of disease (DALYs) compare to the prevalence of mental illness across countries?

  • Do some illnesses cause disproportionate health loss?
  • Are there regions with high burden but low prevalence reporting?

3. Where is the treatment gap for anxiety disorders the largest?

  • Which countries have the highest percentage of untreated individuals?
  • How do potentially adequate treatment rates compare across countries?

4. What percentage of the global adult population is covered in primary data collection for different mental illnesses?

  • Are some disorders underrepresented in data?
  • Are some regions more frequently studied than others?

5. Which depressive symptoms are most commonly reported in the U.S., and which ones are least prevalent?

  • How do patterns shift by frequency (e.g., “nearly every day” vs. “several days”)?

6. Are there mismatches between disease burden (DALYs) and treatment coverage for depression and anxiety?

  • Can you spot regions where the need is high but treatment remains low?

7. Which disorders are well-represented across multiple datasets—and which ones might be underreported or underresearched?

  • Use `UNION` and filtering to check for consistency in coverage across data files.

Ready to get started?

Download the Mental Health dataset collection below and import it into your PostgreSQL database to begin your analysis.

Download Dataset from Kaggle

Wrap Up & Portfolio Building

Project Reflection Checklist

Use this checklist to evaluate your project work and ensure you're ready to showcase it:

  • Data Analysis Quality
    • - Did you effectively use JOINs and UNIONs to connect relevant data?
    • - Have you handled edge cases and null values appropriately?
  • Query Optimization
    • - Are your queries efficient and well-structured?
    • - Did you use appropriate indexes and filtering?
  • Documentation
    • - Have you documented your analysis process?
    • - Are your SQL queries well-commented and reusable?
  • Business Impact
    • - Can you quantify the potential impact of your findings?
    • - Have you identified areas for future analysis?
  • Actionable Recommendations
    • - Did you translate your SQL findings into clear business recommendations?
    • - Are your suggestions specific and implementable?

Build Your Data Portfolio

Ready to showcase your SQL projects? We recommend creating a portfolio to demonstrate your data analysis skills to potential employers.

Get started with our FREE Notion portfolio template

When you are ready, move on to the next stage of your SQL learning journey -- Advanced Analytics.

Back to SQL Learning Hub