Cosmas Mwirigi@MwirigiCosmas1
Day 7 of #100DaysOfSQL 🚀
Today: changing data with UPDATE, changing tables with ALTER COLUMN, and working with dates in PostgreSQL.
A thread 🧵👇
Code and notes:
30230
Posts with #100DaysOfSQL
Public posts on X that use #100DaysOfSQL.
Data is Life @kafilat_yekeenDay 28 of #100DaysOfSQL Find Followers Count Focus: COUNT() + GROUP BY Counted followers per user with COUNT(follower_id). Grouped by user_id to get totals. Ordered results for clarity. Reinforced basic aggregation and grouping skills. #DataAnalytics #100DaysOfCode
Data is Life @kafilat_yekeenDay 32 of #100DaysOfSQL Task: Get employee names with no bonus or bonus < 1000. Focus: Used LEFT JOIN + IS NULL / < 1000. Highlights employees below bonus threshold. #DataAnalytics #100DaysOfCode
Data is Life @kafilat_yekeenDay 37 of #100DaysOfSQL Friend Requests II – Who Has the Most Friends Key takeaway: Learned how to treat friendships as bidirectional by combining sender & receiver IDs with UNION ALL, then grouping to count total friends per user. #DataAnalytics #DataScience #100DaysOfCode
Data is Life @kafilat_yekeenDay 30 of #100DaysOfSQL Rising Temperature 🌡️ Goal: Identify days where the temperature was higher than the previous day. Focus: Self join on the same table, compare consecutive days, and filter rising temps. #100DaysOfCode #DataAnalytics
Data is Life @kafilat_yekeenDay 29 of #100DaysOfSQL Delete Duplicate Emails Focus: DELETE with subquery + ROW_NUMBER() Used ROW_NUMBER() over Email to flag duplicates. Deleted rows where row_num > 1. Ensured only 1 unique email per user. Learned data cleaning with DELETE + window functions. #DataAnalytics