<?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 S the Data Nerd on Medium]]></title>
        <description><![CDATA[Stories by S the Data Nerd on Medium]]></description>
        <link>https://medium.com/@s__e__d?source=rss-b78d61d4bd06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by S the Data Nerd on Medium</title>
            <link>https://medium.com/@s__e__d?source=rss-b78d61d4bd06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:19:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s__e__d/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[Two Data Presentation Interviews, One Rejection, and Everything I Learned in Between]]></title>
            <link>https://medium.com/@s__e__d/two-data-presentation-interviews-one-rejection-and-everything-i-learned-in-between-004fb43902bb?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/004fb43902bb</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Mon, 25 May 2026 20:12:06 GMT</pubDate>
            <atom:updated>2026-05-25T20:12:06.034Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I am still waiting on the second one. Here is the full story anyway.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrBe_G7at5J49Ubxht9-aw.png" /></figure><p>I have sat across from two interview panels in the last few months and presented my analysis to rooms full of people whose job it was to decide if I was good enough.</p><p>One of them said no. The other one has not said anything yet.</p><p>I am writing this now, in the middle of it, because I think that is exactly when this kind of article is most useful. Not from someone who already got the job and is looking back with the confidence of hindsight, but from someone who is still in it, still learning, and honest enough to tell you what actually went wrong.</p><h3>The First One: I Showed Up as Myself, Not as Them</h3><p>The first presentation was for a senior analyst role. I was proud of what I submitted. I had built a full case study around a dashboard I had worked on previously, pulled in multiple datasets, connected the dots between different data sources, and told what I genuinely believed was a compelling, data-driven story.</p><p>I picked a clean template I liked. I color-coded my charts. I walked through every single visual, explained every choice, and dedicated several slides to showing my SQL code because I wanted them to know I could do the technical work.</p><p>I ran out of time. I had 20-something slides and not enough minutes to get through them without rushing.</p><p>Then came the panel questions. I did not see them coming the way they did. The final round case study interview, it turns out, is not just a presentation. It is an interrogation. A quiet, professional, polite interrogation where every person in that room is watching how you think on your feet, not just what you prepared at home.</p><p>I did not perform well under that pressure because I had not prepared for it. I had prepared a presentation, not a conversation.</p><p>On Friday afternoon, my possible boss’s boss told me she had no qualms about me if the others agreed.</p><p>On Monday night at 8pm, as I was packing my bag for work the next morning, I got the rejection.</p><p>I will be honest. My soul got a little crushed.</p><h3>What I Should Have Done Differently</h3><p>Looking back, the mistakes were not technical. My analysis was solid. My insights were real. The problem was everything around the analysis.</p><p><strong>I did not dress the presentation in their language.</strong> I used a template I liked instead of mirroring the company’s brand, colors, and overall visual style. It sounds like a small thing. It is not. A presentation that looks like it belongs in their world signals that you did your homework and that you pay attention to details. Mine looked like it could have been for anyone.</p><p><strong>I explained every visual instead of trusting them.</strong> If your chart needs a paragraph of explanation, the chart is not working hard enough. I over-narrated because I was nervous and wanted to fill the silence. What I should have done is let the visuals speak and save my words for the so-what.</p><p><strong>I tried to prove everything in the slides themselves.</strong> Twenty slides of SQL code and methodology is not a presentation, it is a portfolio dump. The technical proof belongs in an appendix. Your slides should tell the story. Let them ask about the how if they want to, and then you can show them.</p><h3>The Second One: I Came Back With Different Priorities</h3><p>The second opportunity was for a lead analyst role. I approached it differently from the first slide.</p><p>I researched the company’s visual identity and matched it. The colors, the fonts, the tone. When they opened my deck, it looked familiar to them before they had read a single word.</p><p>I led with my assumptions. Instead of presenting the data as if it were objective truth, I was upfront about the lens I used to look at it. Here is what I assumed. Here is why. Here is what the data told me given those assumptions. That transparency actually generated better questions because the panel was engaging with my thinking process, not interrogating my conclusions.</p><p>I did not just show what the data said. I showed what we should do about it and what the impact could look like. I included projected impact ranges with percentage estimates, which I sourced through competitive research and, honestly, with the help of AI tools to move faster. When they asked how I arrived at those numbers, I told them exactly that. They were fine with it. More than fine, actually. It opened a real conversation about how the team uses AI in their workflows.</p><p>I also walked in expecting the personality questions this time. The quiet observations from different people on the panel. The moments where they are watching how you respond to pressure, not just what you say. I had been in that room before, in a different building, and I recognized it for what it was.</p><h3>What I Think Actually Matters in These Rounds</h3><p>Based on two attempts and a lot of reflection, here is where I think the real evaluation happens:</p><p><strong>Do your homework on the company, not just the data.</strong> The dataset they give you is a test. The presentation you build around it is a window into how you would actually show up on the job. Mirror their world.</p><p><strong>Assumptions are a strength, not a weakness.</strong> Every dataset has gaps. Pretending otherwise makes you look naive. Naming your assumptions and defending them makes you look like someone who has done this before.</p><p><strong>The appendix exists for a reason.</strong> Put your SQL there. Put your methodology there. Keep your slides for the story and the recommendation.</p><p><strong>They are not just watching the slides. They are watching you.</strong> How you handle a question you did not expect. Whether you get defensive or curious when challenged. How you talk about your work when nobody is prompting you. That is the real interview.</p><p><strong>Impact is the point.</strong> Counts and averages are a starting point. What the business should do next, and what it is worth to them if they do, is the finish line.</p><h3>The Part I Cannot Wrap Up Neatly</h3><p>I am still waiting to hear about the second one. The recruiter told me I am a top contender. Key decision makers are out of the office this week. So I am here, writing this, which is what I do when I am trying to make sense of something.</p><p>The first rejection hurt more than I expected, partly because of the timing and partly because of how close it felt. But I walked into the second interview because of everything that first one taught me. And whatever the answer is, I walked out of that room feeling like I had finally shown them the right version of what I can do.</p><p>That counts for something.</p><p>If you are preparing for one of these right now, I hope something in here was useful. And if you are also waiting on an answer, I see you.</p><p><em>I write about SQL, data analytics, and the less glamorous parts of working in data. Follow along if that sounds like your kind of thing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=004fb43902bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 24]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-24-4180c892d58e?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/4180c892d58e</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 16:52:23 GMT</pubDate>
            <atom:updated>2025-12-29T16:52:23.816Z</atom:updated>
            <content:encoded><![CDATA[<p>Last day of this challenge! It is so bittersweet. I am very grateful to have stumbled upon this advent calendar challenge and I got to make it a habit to post here. I think it helped me with the SQL syntax, how I approach problems, and how I also communicate them.</p><blockquote>Without further ado, here is today’s question: <strong>As the New Year begins, the goals tracker team wants to understand how user types differ. How many completed goals does the average user have in each user_type?</strong></blockquote><p>I genuinely find this question interesting, because it looks like a question a marketing analyst would try to solve 😊 We usually want our customers to complete their goals and also convert from being a free user to a paid one, so this is a very nice question to finish this challenge with.</p><p>We are given the user_goals dataset and its first few rows look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZOyFucUjqt0diERUPLxcdQ.png" /><figcaption>the user_goals dataset with the fields goal_id, user_id, user_type, and goal_status</figcaption></figure><p>We want to count the goals where status is Completed and we want to find the average number of completes for both the free and pro accounts.</p><p>Before I post my query, I want to highlight that we have 2 different kinds of aggregation going on:<br>1. User level aggregation. We need to count the number of goals where status = complete. We will count the completed goals per user by filtering to completed goals and then grouping by user.<br>2. User type level aggregation. We need to average the counts we find in bullet point 1 per user level (whether free or pro), and finish with a group by user_type.</p><p>When we see this type of pattern, we usually think of CTEs. The number of completed goals per user looks like this:</p><pre>SELECT<br>    user_id,<br>    user_type,<br>    COUNT(goal_id) AS completed_goal_count<br>FROM user_goals<br>WHERE goal_status = &#39;completed&#39;<br>GROUP BY user_id, user_type;</pre><p>Now, this query becomes part of the CTE and here is my final query that passed this question:</p><pre>WITH user_completed_goals AS (<br>SELECT user_id, user_type, COUNT(goal_id) AS completed_goal_count<br>FROM user_goals<br>WHERE goal_status = &#39;completed&#39;<br>GROUP BY user_id, user_type)<br>SELECT user_type, AVG(completed_goal_count) AS avg_completed_goals_per_user<br>FROM user_completed_goals<br>GROUP BY user_type;</pre><p>Thank you for following me along! I hope you enjoyed solving SQL problems with me for the past 24 days. Stay tuned for more challenges, more questions, and more posts about how I tackle complex business problems as a data analyst in marketing 😁</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4180c892d58e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 23]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-23-122169e0763a?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/122169e0763a</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <category><![CDATA[data-analyst]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Sun, 28 Dec 2025 16:59:23 GMT</pubDate>
            <atom:updated>2025-12-28T16:59:23.791Z</atom:updated>
            <content:encoded><![CDATA[<p>Today’s question will help us analyze top gingerbread house builders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6EqeTPn0NSwwiVlo" /><figcaption>Photo by <a href="https://unsplash.com/@sklepacki?utm_source=medium&amp;utm_medium=referral">Stephanie Klepacki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Here is today’s problem: <strong>The Gingerbread House Competition wants to feature the top 3 builders who used the most distinct candy types in their designs. How would you find the builders with the highest count of unique candies, and return only the top three?</strong></blockquote><p>For this question, we are given the gingerbread designs datasets and its first few rows look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YzyQpu64KkPf2DFi066Mcg.png" /><figcaption>gingerbread_designs data with the fields builder_id, candy_type, and builder_name</figcaption></figure><p>We want to rank 3 distinct builders where the count of candy type is highest. We need to do a distinct count of candy types as we want not only who used the most candy (someone could have used gumdrops twice like Clara Claus did above) but the highest number of different candy types. Then we need to group them by builder and rank the top 3. And we also need to make sure, as per the question, that these builders used at least 4 different types of candy.</p><p>Here is what my query looked like for this problem:</p><pre>SELECT builder_name, COUNT(DISTINCT candy_type) as candy_count<br>FROM gingerbread_designs<br>GROUP BY builder_name<br>HAVING candy_count &gt;= 4<br>ORDER BY candy_count DESC<br>LIMIT 3;</pre><p>Notice how I used HAVING instead of WHERE, it is important for queries where you are aggregating. Here is what the query returned:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFd9U96grBx6bGXDY7xMqA.png" /></figure><p>We can see that the query would have returned these top 3 individuals without the HAVING clause, but it was still important to add it to show that we fully understood what the question entailed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=122169e0763a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 22]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-22-4a721d380911?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a721d380911</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 17:02:21 GMT</pubDate>
            <atom:updated>2025-12-27T17:02:21.797Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>We will be looking at: <strong>The penguins are signing up for a community sleigh ride, but the organizers need a list of everyone who did NOT choose the “Evening Ride.” How would you return all penguins whose selected time is not the evening slot?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VjMJ2T8TgY6tWxpK" /><figcaption>Photo by <a href="https://unsplash.com/@corneliusventures?utm_source=medium&amp;utm_medium=referral">Cornelius Ventures</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For this problem, we are given the following dataset, sleigh_ride_signups:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZao1po0fyVxj1zOxki3SA.png" /><figcaption>sleigh_ride_signups with the fields ride_time, signup_id, and penguin_name</figcaption></figure><p>This question asks us to find everyone who did a morning or afternoon ride, but not an evening ride. Here is how I solved this quickly:</p><pre>SELECT *<br>FROM sleigh_ride_signups<br>WHERE ride_time &lt;&gt; &#39;Evening&#39;</pre><p>And here is the result of my query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfklkCSPk3brBYmXokKclQ.png" /></figure><p>Overall, this was a fun and easy question, and now we have visibility into which penguins went on sleigh rides in the morning and afternoon. 🐧</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a721d380911" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 21]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-21-077900be6ab9?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/077900be6ab9</guid>
            <category><![CDATA[sql-challenge]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-analyst]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 16:03:53 GMT</pubDate>
            <atom:updated>2025-12-26T16:03:53.215Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Today we will be looking at running totals and here is our question: <strong>The Snow Queen hosts nightly fireside chats and records how many stories she tells each evening. Can you calculate the running total of stories she has shared over time, in the order they were told?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V_Ffv2w7KJtZPpsg" /><figcaption>Photo by <a href="https://unsplash.com/@bcm_photography?utm_source=medium&amp;utm_medium=referral">Ben McKibben</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For this question, we are given the story_log dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ASLMqxs1zW471iEf5Poxxg.png" /><figcaption>story_log dataset with the fields log_date and stories_shared</figcaption></figure><p>We need to understand the running total of stories the Snow Queen has shared over time. What does this sound like? It sounds like we need the cumulative stories told up to that date (meaning of running total in this case), and this is why we need to use a window function to be able to solve this problem. We need a window function with the sum of the stories shared and order them by the date they are told (log dates).</p><pre>SELECT<br>    log_date,<br>    stories_shared,<br>    SUM(stories_shared) OVER (<br>        ORDER BY log_date<br>        ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW<br>    ) AS running_total_stories<br>FROM story_log<br>ORDER BY log_date;</pre><p>I also needed to add the ROWS BETWEEN because we were told in the problem that we needed the sum of stories told over time up to that evening.</p><p>Here is the result of my query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5tSwMRLGg2IDr6b0rzIJw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=077900be6ab9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 20]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-20-4740d0e5c4af?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/4740d0e5c4af</guid>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 16:29:04 GMT</pubDate>
            <atom:updated>2025-12-25T16:29:04.495Z</atom:updated>
            <content:encoded><![CDATA[<p>Today’s question is focused on hot cocoa break logs ☕️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XE5qgd7ia52OcUwN" /><figcaption>Photo by <a href="https://unsplash.com/@katishna?utm_source=medium&amp;utm_medium=referral">Katya Azimova</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Today’s problem is: <strong>Jack Frost wants to review all the cocoa breaks he actually took — including the cocoa type and the location he drank it in. How would you combine the necessary tables to show each logged break with its matching cocoa details and location?</strong></blockquote><p>For this problem, we are given 4 tables: cocoa_logs, break_schedule, cocoa_types, and locations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MDesXj0BbUTfIhQ-dSiYw.png" /><figcaption>locations table with the fields location_id and location_name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HndzclCvxLZFgSZTSa3leQ.png" /><figcaption>cocoa_logs table with the fields log_id, break_id, and cocoa_id</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*ANvsB597icE_KLAf9kFRHA.png" /><figcaption>cocoa_types table with the fields cocoa_id and cocoa_name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*paVEB6CU6q8NAxVbp-8GUA.png" /><figcaption>break_schedule table with the fields break_id and location_id</figcaption></figure><p>For Jack Frost, we need to review his cocoa breaks including the locations and cocoa types. Our end goal is to show each logged break with its matching cocoa break and location. Here is how I solved this:</p><pre>SELECT lo.log_id,lo.break_id,l.location_name,t.cocoa_name<br>FROM cocoa_logs lo<br>JOIN break_schedule s<br>ON lo.break_id = s.break_id<br>JOIN cocoa_types t<br>ON lo.cocoa_id = t.cocoa_id<br>JOIN locations l<br>ON l.location_id = s.location_id<br>ORDER BY lo.log_id;</pre><p>The query is pretty straightforward, but if we wanted to, it can be optimized by indexing the join keys (break_id, cocoa_id, location_id). Although that is not necessary for this challenge. Here is what the query resulted in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Fp3uKn7mb--mr-e2-jEQQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4740d0e5c4af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 19]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-19-423612d9dda6?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/423612d9dda6</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Wed, 24 Dec 2025 17:16:54 GMT</pubDate>
            <atom:updated>2025-12-24T17:16:54.738Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we will be taking a look at the gift wrap paper usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1fNTrXFD8hfuOCe_" /><figcaption>Photo by <a href="https://unsplash.com/@jessbaileydesigns?utm_source=medium&amp;utm_medium=referral">Jess Bailey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Today’s question is: <strong>Clara is reviewing holiday orders to uncover hidden patterns — can you return the total amount of wrapping paper used for orders that were both gift-wrapped and successfully delivered?</strong></blockquote><p>We are given the holiday orders table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ehw2yJNJXl2-tBBgxcGckg.png" /><figcaption>holiday_orders with the fields order_id, gift_wrap, order_date, customer_name, delivery_status, and paper_used_meters.</figcaption></figure><p>We need to return the total amount of wrapping paper used for delivered orders that were gift wrapped. Here is what my query looked like:</p><pre>SELECT SUM(paper_used_meters)<br>FROM holiday_orders<br>WHERE delivery_status = &#39;Delivered&#39; AND gift_wrap = 1</pre><p>My initial query almost had gift_wrap = true, but when we look at the data type for that field, we see that it’s Boolean, so it needs to be replaced with 0 or 1 (in this case, true = 1).</p><p>Overall, this was a fun and easy question that tested my attention to detail more than it tested my SQL knowledge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=423612d9dda6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 18]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-18-3cfb307ca798?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cfb307ca798</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 13:13:44 GMT</pubDate>
            <atom:updated>2025-12-23T13:13:44.915Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we will be looking at progress tracking over 12 days of data and this question is marked as Hard, so I am very excited to dive in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*37wRB6l4hayDNCwt" /><figcaption>Photo by <a href="https://unsplash.com/@enginakyurt?utm_source=medium&amp;utm_medium=referral">engin akyurt</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Our question is: <strong>Over the 12 days of her data challenge, Data Dawn tracked her daily quiz scores across different subjects. Can you find each subject’s first and last recorded score to see how much she improved?</strong></blockquote><p>We are given the daily_quiz_scores dataset and it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMoMabNmcRasz9c8S2H_Hw.png" /><figcaption>daily_quiz_scores table with the fields score, subject, and quiz_date</figcaption></figure><p>For today’s problem we are asked to find each subjects first and last recorded score to see how much she improved. We will be looking at the maximum and minimum quiz dates and group the results by each subject. We will need to use a window function to pull the associated test scores with the dates.</p><p>Here is what I did:</p><pre>WITH ranked_scores AS (<br>    SELECT<br>        subject,<br>        quiz_date,<br>        score,<br>        ROW_NUMBER() OVER (PARTITION BY subject ORDER BY quiz_date) AS rn_first,<br>        ROW_NUMBER() OVER (PARTITION BY subject ORDER BY quiz_date DESC) AS rn_last<br>    FROM daily_quiz_scores<br>)<br>SELECT<br>    subject,<br>    MAX(CASE WHEN rn_first = 1 THEN score END) AS first_score,<br>    MAX(CASE WHEN rn_last = 1 THEN score END) AS last_score<br>FROM ranked_scores<br>GROUP BY subject;</pre><p>I initially did not realize I needed the scores and only queried the first and last quiz dates grouped by subject:</p><pre>SELECT<br>    subject,<br>    MIN(quiz_date) AS first_quiz,<br>    MAX(quiz_date) AS last_quiz<br>FROM daily_quiz_scores<br>GROUP BY subject;</pre><p>But this is of course wrong as it does not take the scores into account. I realized I needed a window function that ordered and ranked the scores by quiz date and still grouped them by subject. So, I created a common table expression (CTE) and called it ranked_scores. Then, I queried it to get the last and first rank to find the scores. As you can see, you need 2 window functions to correctly fetch the last and first ones. For the last ones, you need to order it descending for it to be the maximum of that date, meaning the last date a quiz was taken. The second select statement after the CTE is of course much easier.</p><p>Here is what my query returned:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35u7JrOhtLSnFLjXxkyswA.png" /></figure><p>We can see that Dawn improved her scores across all subjects, and the greatest increase in her quiz scores happened in her SQL quizzes.</p><p>Overall, this has been more challenging compared to the rest of this week’s questions, but I really enjoyed solving this problem.</p><p>Can you all believe there are only 6 days left in this challenge? Time really flies! 💨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cfb307ca798" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 17]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-17-6e76ee3b9c91?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e76ee3b9c91</guid>
            <category><![CDATA[sql-challenge]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 20:58:00 GMT</pubDate>
            <atom:updated>2025-12-22T20:58:00.015Z</atom:updated>
            <content:encoded><![CDATA[<p>Today’s question is marked as Medium and will be a nice change from yesterday’s Easy question. We will be looking at evening task categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XxpfTvW_d4czUxT9" /><figcaption>Photo by <a href="https://unsplash.com/@kellysikkema?utm_source=medium&amp;utm_medium=referral">Kelly Sikkema</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Today’s question is: <strong>During a quiet evening of reflection, Cindy Lou wants to categorize her tasks based on how peaceful they are. Can you write a query that adds a new column classifying each task as ‘Calm’ if its noise_level is below 50, and ‘Chaotic’ otherwise?</strong></blockquote><p>Here is what our data looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LxLwRgOmErlo2HYECrxVg.png" /><figcaption>evening_tasks table with the fields task_id, task_name, and noise_level</figcaption></figure><p>We are being asked to create a new column that looks at the noise level and classifies it as Calm if it is &lt;50 and Chaotic if it is &gt;50.</p><p>I need to create a CASE WHEN statement for this question, and I don’t necessarily need to use grouping or window functions for this.</p><p>Here is what my query looked like:</p><pre>SELECT task_id, task_name, noise_level, CASE<br>WHEN noise_level &lt; 50 THEN &#39;Calm&#39;<br>ELSE &#39;Chaotic&#39;<br>END AS task_category<br>FROM evening_tasks;</pre><p>And here is what the query resulted in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gt4zP0nCfhETKkWSa2W56g.png" /></figure><p>Overall, today was a very fun challenge where I created a new column using CASE logic. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e76ee3b9c91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Advent Calendar Day 16]]></title>
            <link>https://medium.com/@s__e__d/sql-advent-calendar-day-16-34210264206c?source=rss-b78d61d4bd06------2</link>
            <guid isPermaLink="false">https://medium.com/p/34210264206c</guid>
            <category><![CDATA[data-analyst]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql-challenge]]></category>
            <dc:creator><![CDATA[S the Data Nerd]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 22:04:46 GMT</pubDate>
            <atom:updated>2025-12-21T22:04:46.789Z</atom:updated>
            <content:encoded><![CDATA[<p>For today’s problem we will be looking at tasks that can be done on cozy snow days. ❄️</p><blockquote>The problem is: <strong>It’s a snow day, and Buddy is deciding which tasks he can do from under a blanket. Can you find all tasks that are either marked as ‘Work From Home’ or ‘Low Priority’ so he can stay cozy and productive?</strong></blockquote><p>We are given the daily_tasks table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMA5vM5lVaTlLsOeG0DywA.png" /><figcaption>daily_tasks table with the fields task_id, priority, task_name, and task_type.</figcaption></figure><p>We need to find all the tasks Buddy can do on a cozy snowy day, which are task_type= Work From Home or priority = Low.</p><p>Here is what my query looked like:</p><pre>SELECT task_name<br>FROM daily_tasks<br>WHERE priority = &quot;Low&quot; OR task_type = &quot;Work From Home&quot;;</pre><p>And here is the result of this very straightforward query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*_Rzw69tt-7wCgxV5tde_sA.png" /></figure><p>It seems like Buddy can get a lot done even on a cozy snowy day while working from home.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34210264206c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>