<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pooja Lunthi on Medium]]></title>
        <description><![CDATA[Stories by Pooja Lunthi on Medium]]></description>
        <link>https://medium.com/@poojalunthi26?source=rss-9408120dba41------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Yof_4AeN_fQIIy4O</url>
            <title>Stories by Pooja Lunthi on Medium</title>
            <link>https://medium.com/@poojalunthi26?source=rss-9408120dba41------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:25:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@poojalunthi26/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Part Four — Data Engineering Skills: The SQL That Made It All Work]]></title>
            <link>https://medium.com/@poojalunthi26/part-four-data-engineering-skills-the-sql-that-made-it-all-work-ff599f33849a?source=rss-9408120dba41------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff599f33849a</guid>
            <dc:creator><![CDATA[Pooja Lunthi]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 16:30:40 GMT</pubDate>
            <atom:updated>2026-07-23T16:30:40.306Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRT8UjKkPTBqasaZTzDyvQ.png" /></figure><p>Part 4 — Data Engineering Skills</p><p><em>This is the final part of my SQL Instagram Analytics series. Parts 1–3 showed the insights. This part shows the machinery — the joins, aggregations, and optimization techniques I learned along the way.</em></p><blockquote><em>Data note: Every number and chart in this story comes from the synthetic sample dataset built for this SQL project. These are case-study findings, not Instagram production metrics.</em></blockquote><p>When I started this project, I thought SQL was about memorizing syntax. By the end, I realized it’s about <strong>thinking in tables</strong> — knowing which rows survive a join, what a GROUP BY collapses, and why a query takes 2 seconds instead of 0.02.</p><p>Think of it like cooking. Anyone can follow a recipe (write a SELECT). But a good cook knows <em>why</em> you salt the water and <em>when</em> the pan is hot enough. This post is my “why.”</p><h3>1. Joins — Where Most of My Bugs Lived</h3><p>Every single analysis in this series needed joins, and every early bug I had was a join bug. Here’s my mental model now:</p><ul><li><strong>INNER JOIN</strong> — keep only rows that match on both sides. <em>“Show me posts that got engagement.”</em></li><li><strong>LEFT JOIN</strong> — keep everything from the left table, match if possible. <em>“Show me ALL posts, with engagement if it exists.”</em></li><li><strong>The silent killer:</strong> using INNER JOIN when you meant LEFT JOIN doesn’t throw an error. It just quietly deletes rows and inflates your averages (this happened to me in Part 3 with zero-engagement posts).</li></ul><p>One trap worth its own paragraph — <strong>filtering on the right table of a LEFT JOIN:</strong></p><pre>-- WRONG: this secretly becomes an INNER JOIN<br>SELECT u.username, COUNT(p.post_id)<br>FROM users u<br>LEFT JOIN posts p ON u.user_id = p.user_id<br>WHERE p.post_type = &#39;reel&#39;      -- kills the NULL rows!<br>GROUP BY u.username;</pre><pre>-- RIGHT: put the condition in the ON clause<br>SELECT u.username, COUNT(p.post_id)<br>FROM users u<br>LEFT JOIN posts p ON u.user_id = p.user_id<br>              AND p.post_type = &#39;reel&#39;<br>GROUP BY u.username;</pre><p>The first version drops all users who never made a reel. The second keeps them with a count of 0. Same-looking query, totally different answer.</p><p>INNER JOIN keeps only matches; LEFT JOIN preserves all rows from the left table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lh2BoAjNdzozlLCQiDOY3w.png" /></figure><h3>2. Aggregations — Beyond Basic COUNT</h3><p>Three patterns I used constantly:</p><p><strong>Conditional aggregation</strong> — computing multiple metrics in one pass instead of running five separate queries:</p><pre>SELECT<br>    SUM(CASE WHEN engagement_type = &#39;like&#39; THEN 1 ELSE 0 END) AS likes,<br>    SUM(CASE WHEN engagement_type = &#39;share&#39; THEN 1 ELSE 0 END) AS shares,<br>    SUM(CASE WHEN engagement_type = &#39;save&#39; THEN 1 ELSE 0 END) AS saves<br>FROM engagements;</pre><p><strong>COUNT(DISTINCT …) vs COUNT(…)</strong> — “how many engagements” vs “how many people engaged.” Mixing these up changed my DAU by 30% in Part 1.</p><p><strong>HAVING vs WHERE</strong> — WHERE filters rows <em>before</em> grouping, HAVING filters groups <em>after</em>. “Users with more than 50 posts” is a HAVING problem:</p><pre>SELECT user_id, COUNT(*) AS post_count<br>FROM posts<br>GROUP BY user_id<br>HAVING COUNT(*) &gt; 50;</pre><h3>3. Window Functions — The Level-Up Moment</h3><p>Regular aggregation collapses rows. Window functions calculate <em>across</em> rows while keeping them. This unlocked the hardest analyses in the series.</p><p><strong>Ranking each user’s best post:</strong></p><pre>WITH post_engagement AS (<br>    SELECT p.user_id, p.post_id,<br>           COUNT(e.engagement_id) AS eng,<br>           ROW_NUMBER() OVER (<br>               PARTITION BY p.user_id<br>               ORDER BY COUNT(e.engagement_id) DESC<br>           ) AS rn<br>    FROM posts p<br>    LEFT JOIN engagements e ON p.post_id = e.post_id<br>    GROUP BY p.user_id, p.post_id<br>)<br>SELECT user_id, post_id, eng<br>FROM post_engagement<br>WHERE rn = 1;</pre><p><strong>Running totals for growth curves:</strong></p><pre>SELECT DATE(signup_date) AS d,<br>       COUNT(*) AS new_users,<br>       SUM(COUNT(*)) OVER (ORDER BY DATE(signup_date)) AS total_users<br>FROM users<br>GROUP BY DATE(signup_date);</pre><p>And NTILE(20) from Part 2 is what proved the “top 5% drive 60% of engagement” insight in four lines. If you learn one advanced SQL topic this year, make it window functions.</p><h3>4. CTEs — Writing Queries You Can Read Next Week</h3><p>Early on, my queries were deeply nested subqueries I couldn’t understand two days later. CTEs (WITH clauses) fixed that by letting me build queries like paragraphs:</p><pre>WITH active_users AS (...),<br>     their_posts AS (...),<br>     engagement_summary AS (...)<br>SELECT ... FROM engagement_summary;</pre><p>Each block has a name and one job. Debugging becomes “run each CTE alone and check it” instead of staring at a 60-line wall of brackets.</p><p>A readable SQL analysis moves through named, testable stages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcYvBxwSpvfJqrmoqkL4IA.png" /></figure><h3>5. Performance — Making One Query 10x Faster</h3><p>My engagement-by-hour query in Part 3 got slow once I grew the engagements table to a few million rows. Two tools fixed it:</p><p><strong>EXPLAIN QUERY PLAN</strong> — asks the database <em>how</em> it will run your query:</p><pre>EXPLAIN QUERY PLAN<br>SELECT * FROM engagements WHERE post_id = 12345;<br>-- SCAN engagements  ← bad: reading every row</pre><p><strong>Indexes</strong> — like the index at the back of a textbook. Without it, the database reads every page to find “hashtags.” With it, it jumps straight there:</p><pre>CREATE INDEX idx_engagements_post ON engagements(post_id);<br>CREATE INDEX idx_engagements_created ON engagements(created_at);</pre><p>After indexing post-id, the plan changed from SCAN to SEARCH ... USING INDEX, and my join-heavy queries went from seconds to milliseconds. <strong>~10x faster from one line of SQL.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*og_aQojEFgd1KBWzolWq_g.png" /></figure><p>Adding an index reduced relative query runtime by roughly tenfold.</p><p>Two caveats I learned the honest way:</p><ul><li>Indexes speed up reads but slow down writes — don’t index everything.</li><li>Wrapping an indexed column in a function (WHERE DATE(created_at) = ...) can prevent the index from being used. Prefer range conditions: WHERE created_at &gt;= &#39;2025-08-01&#39; AND created_at &lt; &#39;2025-08-02&#39;.</li></ul><h3>Key Takeaways from Part 4</h3><ol><li><strong>Join type is an analytical decision, not a syntax choice.</strong> LEFT vs INNER changes your conclusions.</li><li><strong>Conditional aggregation does in one query what beginners do in five.</strong></li><li><strong>Window functions are the bridge from “knows SQL” to “does analytics with SQL.”</strong></li><li><strong>CTEs are for the human reading the query — usually future you.</strong></li><li><strong>EXPLAIN before you optimize.</strong> Measure, index, measure again.</li></ol><h3>Wrapping Up the Series</h3><p>Four posts ago, this started as “let me practice SQL.” It ended with real analytical instincts: reels beat photos, 6–10 hashtags is the sweet spot, early creators retain 2x better, and 5% of users carry the platform.</p><p>But the biggest lesson wasn’t any single insight. It was this: <strong>data analytics is asking a good question first, and only then writing the query.</strong> The SQL is the easy part once you know what you’re looking for.</p><p>If you’re starting your own analytics journey — build a fake dataset for a product you use daily. You’ll learn more from your own questions than from any tutorial.</p><p><em>Thank you for following along with this series! I’d love to hear what dataset you’d analyse — drop it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff599f33849a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part Three — Content Performance: What Actually Gets Engagement?]]></title>
            <link>https://medium.com/@poojalunthi26/part-three-content-performance-what-actually-gets-engagement-9d8fbe43b154?source=rss-9408120dba41------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d8fbe43b154</guid>
            <dc:creator><![CDATA[Pooja Lunthi]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 15:06:32 GMT</pubDate>
            <atom:updated>2026-07-22T15:06:32.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZRvQ55F080vpougcRJDfEA.png" /></figure><p>Part 3 — Content Performance</p><p><em>This is Part 3 of my SQL Instagram Analytics series. Part 1 covered product metrics, Part 2 covered user behaviour. Now for the fun part — the content itself.</em></p><blockquote><em>Data note: Every number and chart in this story comes from the synthetic sample dataset built for this SQL project. These are case-study findings, not Instagram production metrics.</em></blockquote><p>Every creator has asked this at least once: <em>“Why did that post do well and this one didn’t?”</em> It feels like luck. But when you look at thousands of posts together, patterns appear that no single post can show you. That’s the whole magic of analytics — <strong>one post is a story, a thousand posts are a dataset.</strong></p><h3>The Questions I Asked</h3><ul><li>Which format wins — photos, videos, or reels?</li><li>Do hashtags really increase reach, and is there such a thing as too many?</li><li>Do verified accounts get an unfair advantage?</li><li>When is the best time to post?</li></ul><h3>Query 1 — Engagement by Post Type</h3><p>Raw engagement counts are misleading because there are far more photos than reels. So I measured <strong>engagement per post</strong>:</p><pre>SELECT<br>    p.post_type,<br>    COUNT(DISTINCT p.post_id) AS total_posts,<br>    COUNT(e.engagement_id) AS total_engagements,<br>    ROUND(COUNT(e.engagement_id) * 1.0 / COUNT(DISTINCT p.post_id), 1)<br>        AS avg_engagement_per_post<br>FROM posts p<br>LEFT JOIN engagements e ON p.post_id = e.post_id<br>GROUP BY p.post_type<br>ORDER BY avg_engagement_per_post DESC;</pre><p><strong>Results from my dataset (average engagement per post):</strong></p><ul><li><strong>Reel — 48.2</strong></li><li><strong>Video — 31.5</strong></li><li><strong>Photo — 19.7</strong></li></ul><p>Reels earned roughly <strong>2.4x more engagement per post than photos</strong> — even though photos made up the majority of content (as we saw in Part 1). Fewer people make reels, but reels get rewarded.</p><p>Reels generated the highest average engagement per post in the sample dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXcYqu7yV7-BbMfl9vRWUg.png" /></figure><p><strong>The mistake I made first:</strong> I used INNER JOIN instead of LEFT JOIN, which silently dropped every post with zero engagement. My averages looked amazing — and completely wrong. Posts with zero engagement are data too.</p><h3>Query 2 — The Hashtag Sweet Spot</h3><p>The eternal debate: do hashtags work? I bucketed posts by hashtag count and compared average engagement:</p><pre>SELECT<br>    CASE<br>        WHEN hashtag_count = 0 THEN &#39;0&#39;<br>        WHEN hashtag_count BETWEEN 1 AND 5 THEN &#39;1-5&#39;<br>        WHEN hashtag_count BETWEEN 6 AND 10 THEN &#39;6-10&#39;<br>        WHEN hashtag_count BETWEEN 11 AND 20 THEN &#39;11-20&#39;<br>        ELSE &#39;20+&#39;<br>    END AS hashtag_bucket,<br>    COUNT(DISTINCT p.post_id) AS posts,<br>    ROUND(COUNT(e.engagement_id) * 1.0 / COUNT(DISTINCT p.post_id), 1)<br>        AS avg_engagement<br>FROM posts p<br>LEFT JOIN engagements e ON p.post_id = e.post_id<br>GROUP BY hashtag_bucket<br>ORDER BY avg_engagement DESC;</pre><p><strong>Result:</strong> posts with <strong>6–10 hashtags had the highest average engagement</strong>. Engagement rose from 0 up to that range, then <em>fell</em> for 11–20 and dropped hard for 20+. Too few hashtags = less discoverability. Too many = looks spammy (and possibly gets down-ranked).</p><p>It’s like salt in food. None is bland, a little is perfect, a lot ruins the dish.</p><p>The 6–10 hashtag range produced the strongest engagement pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JF8-Io_iYBxg0OQDML-Mqw.png" /></figure><h3>Query 3 — The Verified Advantage</h3><p>Do blue ticks change how content spreads? I compared <strong>shares specifically</strong>, because shares are the engagement type that spreads content to new audiences:</p><pre>SELECT<br>    u.is_verified,<br>    ROUND(SUM(CASE WHEN e.engagement_type = &#39;share&#39; THEN 1 ELSE 0 END) * 1.0<br>        / COUNT(DISTINCT p.post_id), 2) AS avg_shares_per_post<br>FROM posts p<br>JOIN users u ON p.user_id = u.user_id<br>LEFT JOIN engagements e ON p.post_id = e.post_id<br>GROUP BY u.is_verified;</pre><p><strong>Result:</strong> verified accounts averaged about <strong>20% more shares per post</strong> than non-verified accounts. Interestingly, likes were much closer between the two groups. My reading: people like content equally, but they <em>share</em> content from accounts that feel credible. A share puts your reputation on the line — a like doesn’t.</p><p>Verified accounts averaged about 20% more shares per post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGheDpbF3xkSRoNMYM3ndA.png" /></figure><h3>Query 4 — When to Post (and the Sunday Story Effect)</h3><p>For posts, I extracted the hour of engagement to find peak windows:</p><pre>SELECT<br>    CAST(STRFTIME(&#39;%H&#39;, created_at) AS INTEGER) AS hour_of_day,<br>    COUNT(*) AS engagements<br>FROM engagements<br>GROUP BY hour_of_day<br>ORDER BY engagements DESC<br>LIMIT 5;</pre><p>Peak engagement clustered around <strong>8–10 PM</strong>, with a smaller lunch-time bump at 1 PM. Makes sense — people scroll after dinner.</p><p>For stories, I looked at <strong>completion rate</strong> (completions ÷ views) by day of week:</p><pre>SELECT<br>    CASE STRFTIME(&#39;%w&#39;, created_at)<br>        WHEN &#39;0&#39; THEN &#39;Sunday&#39;   WHEN &#39;1&#39; THEN &#39;Monday&#39;<br>        WHEN &#39;2&#39; THEN &#39;Tuesday&#39;  WHEN &#39;3&#39; THEN &#39;Wednesday&#39;<br>        WHEN &#39;4&#39; THEN &#39;Thursday&#39; WHEN &#39;5&#39; THEN &#39;Friday&#39;<br>        ELSE &#39;Saturday&#39;<br>    END AS day_name,<br>    ROUND(SUM(completions) * 100.0 / SUM(views), 1) AS completion_rate_pct<br>FROM stories<br>GROUP BY day_name<br>ORDER BY completion_rate_pct DESC;</pre><p><strong>Result: story completion peaked on Sundays</strong> (~78% vs ~61% midweek). My theory: weekdays we skip through stories in stolen moments; Sundays we actually have time to watch. Same content, different attention.</p><p>Engagement peaked around 8–10 PM, while story completion was strongest on Sundays.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLP3l6U0cNU-jGqNMcQPmw.png" /></figure><h3>Key Takeaways from Part 3</h3><ol><li><strong>Format beats effort.</strong> A decent reel outperforms a great photo in reach.</li><li><strong>6–10 hashtags is the sweet spot</strong> — more is not better.</li><li><strong>Credibility drives shares, not likes.</strong> The 20% verified advantage lives almost entirely in shares.</li><li><strong>Timing is about audience attention, not your schedule.</strong> Post when they scroll (evenings), expect deep story viewing on Sundays.</li><li><strong>LEFT JOIN vs INNER JOIN can silently corrupt your conclusions.</strong> Zero-engagement rows matter.</li></ol><h3>What’s Next</h3><p>In the final part, <strong>Part Four — Data Engineering Skills</strong>, I’ll go behind the queries: the joins, window functions, and optimization tricks that made all of this possible — including how I made one query 10x faster with a single index.</p><p><em>Thanks for reading — one more to go!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d8fbe43b154" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part Two — User Behaviour: Why Do People Stay (or Leave)?]]></title>
            <link>https://medium.com/@poojalunthi26/part-two-user-behaviour-why-do-people-stay-or-leave-71e18279b143?source=rss-9408120dba41------2</link>
            <guid isPermaLink="false">https://medium.com/p/71e18279b143</guid>
            <dc:creator><![CDATA[Pooja Lunthi]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 16:47:21 GMT</pubDate>
            <atom:updated>2026-07-21T16:47:21.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3yfUhQlZrVKQgjO5iDUwWg.png" /></figure><p>Part 2 — User Behaviour</p><p><em>This is Part 2 of my SQL Instagram Analytics series. In Part 1, I measured what features people use. Now I’m asking a harder question: do they come back?</em></p><blockquote><em>Data note: Every number and chart in this story comes from the synthetic sample dataset built for this SQL project. These are case-study findings, not Instagram production metrics.</em></blockquote><p>Here’s an analogy that helped me understand retention. Getting a new user is like someone visiting your home for the first time because you invited them. <strong>Retention is whether they visit again without an invitation.</strong> No amount of marketing can fake that second visit — it only happens if the first one was worth it.</p><h3>The Questions I Asked</h3><ul><li>How many new users are still active 1 week, 2 weeks, 4 weeks after signing up?</li><li>Where exactly do users drop off between signing up and becoming active?</li><li>Do users who create content early stay longer?</li><li>Who are the “power users” and how different are they?</li></ul><h3>Query 1 — Weekly Retention Cohorts</h3><p>A cohort is just a group of users who signed up in the same week. Then we check: how many from each cohort were active in the following weeks?</p><pre>WITH cohorts AS (<br>    SELECT user_id,<br>           DATE(signup_date, &#39;weekday 0&#39;, &#39;-6 days&#39;) AS cohort_week<br>    FROM users<br>),<br>activity AS (<br>    SELECT DISTINCT user_id,<br>           DATE(created_at, &#39;weekday 0&#39;, &#39;-6 days&#39;) AS active_week<br>    FROM engagements<br>)<br>SELECT<br>    c.cohort_week,<br>    COUNT(DISTINCT c.user_id) AS cohort_size,<br>    COUNT(DISTINCT CASE<br>        WHEN JULIANDAY(a.active_week) - JULIANDAY(c.cohort_week) = 7<br>        THEN a.user_id END) AS week_1,<br>    COUNT(DISTINCT CASE<br>        WHEN JULIANDAY(a.active_week) - JULIANDAY(c.cohort_week) = 14<br>        THEN a.user_id END) AS week_2,<br>    COUNT(DISTINCT CASE<br>        WHEN JULIANDAY(a.active_week) - JULIANDAY(c.cohort_week) = 28<br>        THEN a.user_id END) AS week_4<br>FROM cohorts c<br>LEFT JOIN activity a ON c.user_id = a.user_id<br>GROUP BY c.cohort_week<br>ORDER BY c.cohort_week;</pre><p><strong>What I found:</strong> In my sample data, week-1 retention was around 42%, dropping to 25% by week 4. The curve flattened after that — which is exactly what a healthy retention curve should do. The users who survive the first month tend to stay.</p><p>Retention fell from approximately 42% in Week 1 to 25% in Week 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cp_3p5WODLx3nHISIh0JEg.png" /></figure><p><strong>Honest confession:</strong> this query took me three attempts. Date math in SQL is genuinely tricky, and the &#39;weekday 0&#39;, &#39;-6 days&#39; trick (snapping any date to its Monday) was something I had to look up.</p><h3>Query 2 — The Activation Funnel</h3><p>Signup is not success. I defined a simple funnel: <strong>Signed Up → Engaged with a post → Created content</strong>.</p><pre>SELECT<br>    COUNT(DISTINCT u.user_id) AS signed_up,<br>    COUNT(DISTINCT e.user_id) AS engaged,<br>    COUNT(DISTINCT p.user_id) AS created_content<br>FROM users u<br>LEFT JOIN engagements e ON u.user_id = e.user_id<br>LEFT JOIN posts p ON u.user_id = p.user_id;</pre><p><strong>My funnel looked like:</strong></p><ul><li>100% signed up</li><li>71% engaged with at least one post</li><li>29% ever created a post</li></ul><p>The biggest drop-off is between <em>consuming</em> and <em>creating</em>. That’s a 42-point cliff. If I were a PM at Instagram, this is where I’d focus — anything that makes the first post easier (templates, prompts, low-pressure formats like stories) directly attacks this cliff.</p><p>The largest activation drop occurred between engaging with content and creating it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CC7Q9X3lIdb0eO9UI8Yg7Q.png" /></figure><h3>Query 3 — Does Early Creation Predict Retention?</h3><p>This was the most interesting analysis of the whole series for me. Hypothesis: <strong>users who post within their first 7 days retain better.</strong></p><pre>WITH first_post AS (<br>    SELECT p.user_id,<br>           MIN(JULIANDAY(p.created_at) - JULIANDAY(u.signup_date)) AS days_to_first_post<br>    FROM posts p<br>    JOIN users u ON p.user_id = u.user_id<br>    GROUP BY p.user_id<br>),<br>retained AS (<br>    SELECT DISTINCT e.user_id<br>    FROM engagements e<br>    JOIN users u ON e.user_id = u.user_id<br>    WHERE JULIANDAY(e.created_at) - JULIANDAY(u.signup_date) &gt;= 28<br>)<br>SELECT<br>    CASE<br>        WHEN fp.days_to_first_post &lt;= 7 THEN &#39;Posted in first week&#39;<br>        WHEN fp.days_to_first_post IS NOT NULL THEN &#39;Posted later&#39;<br>        ELSE &#39;Never posted&#39;<br>    END AS segment,<br>    COUNT(DISTINCT u.user_id) AS users,<br>    ROUND(COUNT(DISTINCT r.user_id) * 100.0 / COUNT(DISTINCT u.user_id), 1) AS retention_4w_pct<br>FROM users u<br>LEFT JOIN first_post fp ON u.user_id = fp.user_id<br>LEFT JOIN retained r ON u.user_id = r.user_id<br>GROUP BY segment;</pre><p><strong>Result:</strong> Users who posted in their first week retained at nearly <strong>2x the rate</strong> of users who never posted. Correlation is not causation — maybe motivated users both post AND stay — but this is the kind of “aha moment” metric real product teams hunt for (like Facebook’s famous “7 friends in 10 days”).</p><p>Users who posted in their first week retained at nearly twice the rate of users who never posted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zj-NRi8fGUCC7ulD20B81Q.png" /></figure><h3>Query 4 — Power Users: The 5% That Run the Platform</h3><p>In my intro post I mentioned the top 5% of users generate 60% of all engagement. Here’s how I proved it, using a window function:</p><pre>WITH ranked AS (<br>    SELECT user_id,<br>           COUNT(*) AS engagement_count,<br>           NTILE(20) OVER (ORDER BY COUNT(*) DESC) AS bucket<br>    FROM engagements<br>    GROUP BY user_id<br>)<br>SELECT<br>    ROUND(SUM(CASE WHEN bucket = 1 THEN engagement_count END) * 100.0<br>        / SUM(engagement_count), 1) AS top_5pct_share<br>FROM ranked;</pre><p>NTILE(20) splits users into 20 equal buckets — bucket 1 is the top 5%. Their share: <strong>60.3%</strong>. A tiny group of superfans carries the entire platform’s activity.</p><p>The top 5% of users accounted for 60.3% of engagement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBSvfoO8qDzh8yGUm8otnA.png" /></figure><h3>Key Takeaways from Part 2</h3><ol><li><strong>Retention curves should flatten.</strong> A curve that keeps falling means the product has no core.</li><li><strong>The consume → create gap is the biggest funnel cliff</strong> — and the biggest opportunity.</li><li><strong>Early actions predict long-term behaviour.</strong> Find your product’s “first post” moment.</li><li><strong>Window functions (NTILE, RANK) turn hard questions into short queries.</strong> Learning them was the single biggest jump in my SQL ability.</li></ol><h3>What’s Next</h3><p>In <strong>Part Three — Content Performance</strong>, I’ll flip from users to content: which post types win, whether hashtags actually matter (spoiler: 6–10 is the sweet spot), and why Sunday is story day.</p><p><em>Thanks for reading — see you in Part 3!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71e18279b143" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part One — Product Analytics: What’s Actually Working on Instagram?]]></title>
            <link>https://medium.com/@poojalunthi26/part-one-product-analytics-whats-actually-working-on-instagram-cacd4b5f611e?source=rss-9408120dba41------2</link>
            <guid isPermaLink="false">https://medium.com/p/cacd4b5f611e</guid>
            <dc:creator><![CDATA[Pooja Lunthi]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 16:56:15 GMT</pubDate>
            <atom:updated>2026-07-20T16:56:15.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IYe0qCWpnrE2ei9d6TXwKQ.png" /></figure><p>Part 1 — Product Analytics</p><p><em>This is Part 1 of my SQL Instagram Analytics series. If you missed the introduction, I explained how I built a sample Instagram dataset with Users, Posts, Stories, and Engagements tables to practice SQL on real-world style questions.</em></p><blockquote><em>Data note: Every number and chart in this story comes from the synthetic sample dataset built for this SQL project. These are case-study findings, not Instagram production metrics.</em></blockquote><p>When I started this project, the first question I wanted to answer was a very simple one:</p><p><strong>“Out of everything Instagram offers — posts, reels, stories — what are people actually using?”</strong></p><p>This is what Product Analytics is all about. Think of it like running a restaurant with a big menu. You don’t just want to know how many customers came in. You want to know which dishes they ordered, which ones came back to the kitchen untouched, and which one dish keeps bringing people back every week. Features are the dishes. Product analytics tells you what to cook more of.</p><h3>The Questions I Asked</h3><ul><li>How many users are active daily and monthly?</li><li>Which feature (photos, videos, reels, stories) drives the most activity?</li><li>Are new features being adopted, or ignored?</li><li>What does a “healthy” user look like on this platform?</li></ul><h3>My Dataset (Quick Recap)</h3><p>Four tables:</p><ul><li><strong>users</strong> — user_id, username, signup_date, is_verified, country</li><li><strong>posts</strong> — post_id, user_id, post_type (photo / video / reel), hashtag_count, created_at</li><li><strong>stories</strong> — story_id, user_id, views, completions, created_at</li><li><strong>engagements</strong> — engagement_id, post_id, user_id, engagement_type (like / comment / share / save), created_at</li></ul><h3>Query 1 — Daily Active Users (DAU)</h3><p>The heartbeat of any product. A user is “active” if they did anything — posted, engaged, or put up a story.</p><pre>SELECT activity_date, COUNT(DISTINCT user_id) AS dau<br>FROM (<br>    SELECT user_id, DATE(created_at) AS activity_date FROM posts<br>    UNION<br>    SELECT user_id, DATE(created_at) FROM stories<br>    UNION<br>    SELECT user_id, DATE(created_at) FROM engagements<br>) AS all_activity<br>GROUP BY activity_date<br>ORDER BY activity_date;</pre><p><strong>Why UNION and not UNION ALL?</strong> Because the same user might post AND like something on the same day. UNION removes duplicates, so each user counts once per day. This small detail changed my DAU numbers by almost 30% when I first got it wrong!</p><h3>Query 2 — Stickiness (DAU/MAU Ratio)</h3><p>Monthly active users tell you reach. But DAU/MAU tells you <strong>habit</strong>. If MAU is 10,000 and DAU is 2,000, your stickiness is 20% — meaning an average user shows up 1 in 5 days.</p><pre>WITH daily AS (<br>    SELECT DATE(created_at) AS d, COUNT(DISTINCT user_id) AS dau<br>    FROM engagements<br>    GROUP BY DATE(created_at)<br>),<br>monthly AS (<br>    SELECT COUNT(DISTINCT user_id) AS mau<br>    FROM engagements<br>    WHERE created_at &gt;= DATE(&#39;now&#39;, &#39;-30 days&#39;)<br>)<br>SELECT ROUND(AVG(daily.dau) * 100.0 / monthly.mau, 2) AS stickiness_pct<br>FROM daily, monthly<br>WHERE daily.d &gt;= DATE(&#39;now&#39;, &#39;-30 days&#39;);</pre><p>In my sample data, stickiness came out around <strong>23%</strong> — close to what real social apps consider decent (Instagram’s real number is famously much higher).</p><p>DAU/MAU stickiness in the sample dataset was approximately 23%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6Z5abnGq1rpHiL_ynPp0Q.png" /></figure><h3>Query 3 — Feature Adoption: Who Is Using What?</h3><p>This was my favourite one. What percentage of active users touch each feature?</p><pre>SELECT<br>    ROUND(COUNT(DISTINCT CASE WHEN p.post_type = &#39;reel&#39; THEN p.user_id END) * 100.0<br>        / COUNT(DISTINCT p.user_id), 1) AS reel_creators_pct,<br>    ROUND(COUNT(DISTINCT CASE WHEN p.post_type = &#39;photo&#39; THEN p.user_id END) * 100.0<br>        / COUNT(DISTINCT p.user_id), 1) AS photo_creators_pct,<br>    ROUND(COUNT(DISTINCT CASE WHEN p.post_type = &#39;video&#39; THEN p.user_id END) * 100.0<br>        / COUNT(DISTINCT p.user_id), 1) AS video_creators_pct<br>FROM posts p;</pre><p><strong>What I found:</strong></p><ul><li>68% of creators still post photos — it’s the default behaviour</li><li>Only 24% created a reel, BUT reels generated far more engagement per post (more on this in Part 3)</li><li>Stories had the widest adoption — low effort, low pressure, so more people use them</li></ul><p>This is a classic product insight: <strong>the most-used feature is not always the most valuable one.</strong> Photos are used the most, reels drive the most engagement.</p><p>Photos had the highest creator adoption, while reels were used by a smaller share of creators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pTXtNRD6kdQlAAj03aF9g.png" /></figure><h3>Query 4 — What Drives Activity? (Creators vs Consumers)</h3><p>Not every user creates. Many just scroll and like. So I segmented users:</p><pre>SELECT<br>    CASE<br>        WHEN post_count &gt; 0 AND engagement_count &gt; 0 THEN &#39;Creator + Consumer&#39;<br>        WHEN post_count &gt; 0 THEN &#39;Pure Creator&#39;<br>        WHEN engagement_count &gt; 0 THEN &#39;Pure Consumer&#39;<br>        ELSE &#39;Inactive&#39;<br>    END AS user_segment,<br>    COUNT(*) AS users<br>FROM (<br>    SELECT u.user_id,<br>        COUNT(DISTINCT p.post_id) AS post_count,<br>        COUNT(DISTINCT e.engagement_id) AS engagement_count<br>    FROM users u<br>    LEFT JOIN posts p ON u.user_id = p.user_id<br>    LEFT JOIN engagements e ON u.user_id = e.user_id<br>    GROUP BY u.user_id<br>) t<br>GROUP BY user_segment;</pre><p><strong>Result:</strong> roughly 70% of my users were pure consumers. Only a small group created content — and as I teased in my intro post, the <strong>top 5% of users generated 60% of all engagements</strong>. The platform runs on a tiny engine of highly active people.</p><p>A small power-user segment generated a disproportionate share of engagement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBSvfoO8qDzh8yGUm8otnA.png" /></figure><h3>Key Takeaways from Part 1</h3><ol><li><strong>DAU/MAU is the single most honest metric</strong> — it measures habit, not vanity.</li><li><strong>UNION vs UNION ALL matters</strong> — one wrong keyword and your metrics lie to you.</li><li><strong>Adoption ≠ value.</strong> Photos are the most adopted, reels are the most valuable.</li><li><strong>Most users are silent consumers.</strong> Product decisions must serve both the loud 5% and the quiet 70%.</li></ol><h3>What’s Next</h3><p>In <strong>Part Two — User Behaviour</strong>, I’ll go deeper into retention: how many users come back after week 1, where they drop off in the funnel, and how I built cohort analysis with pure SQL.</p><p>If you’re also learning SQL, try writing the DAU query on any dataset you have — it’s the best first exercise I’ve found.</p><p><em>Thanks for reading! Follow along if you want to see the rest of this series.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cacd4b5f611e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>