SQL Challenge: Counting Word Occurrences with Recursive CTE

✅ Solved a SQL problem on StrataScratch — Day 59 of my SQL Journey 💪 Text data looks simple…   until you try to break it into meaningful pieces 👀  Today’s challenge: count how many times each word appears across all rows.  The approach:  • Cleaned and normalised text using LOWER() and REPLACE()   • Used a recursive CTE to split sentences into individual words   • Extracted words step by step using SUBSTRING_INDEX()   • Counted occurrences using GROUP BY  What I practised:  • Recursive CTEs   • String splitting in SQL   • Text normalisation   • Aggregation on derived data  What stood out —  Real-world data isn’t structured.   You often have to create structure first.  Once you break data into the right form,   analysis becomes much easier.  SQL isn’t just about querying tables —   It’s about shaping data into something usable.  Consistent learning, one query at a time 🚀  #SQL #StrataScratch #DataAnalytics #LearningInPublic #SQLPractice

  • stratascratch_sql_problem

To view or add a comment, sign in

Explore content categories