<?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 Taru Sahu on Medium]]></title>
        <description><![CDATA[Stories by Taru Sahu on Medium]]></description>
        <link>https://medium.com/@tarusahu2?source=rss-29e3cad8b9b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*13vaul-mT_EbRD00wGpVVA.jpeg</url>
            <title>Stories by Taru Sahu on Medium</title>
            <link>https://medium.com/@tarusahu2?source=rss-29e3cad8b9b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:25:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tarusahu2/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[Char and varchar2]]></title>
            <link>https://medium.com/@tarusahu2/char-and-varchar2-f99801db35d6?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f99801db35d6</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 19:17:15 GMT</pubDate>
            <atom:updated>2026-02-22T19:17:15.813Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi folks,<br>I’m back with one of the most interesting topic in SQL i.e. difference between char and varchar2 along with their use case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*XeqB4qBpOO1ezchDxzfxSg.png" /></figure><p>Char and varchar2 both are datatypes in SQL used for storing characters or strings.</p><p><strong>Why the “2” in varchar2?<br></strong> It represents “Version 2” of Oracle’s variable character implementation. It was created to avoid behavior changes in the VARCHAR data type as SQL standards evolved.</p><p><strong>Char:</strong><br>1. It is used to store fixed length strings. <br>2. It’s used when we already know the length of variable.<br>3. Here string length is pre-defined hence when it’s not completely used it gets padded with spaces.<br>4. We should use the CHAR datatype when we expect the data values in a column are of the same length.<br>5. It can be used to store numbers in string format when there’s no requirement to perform mathematical operation e.g. Pincode, mobile no., Account number, IATA Airport Codes etc.</p><p><strong>Varchar2:</strong><br>1. It used to store variables of variable lengths. <br>2. It’s mostly used when variable length is not fixed.<br>3. Since here variable length is not pre-defined hence it get auto-adjusted depending on requirement.<br>4. We should use the VARCHAR datatype when we expect the data values in a column are of variable length.<br>5. It’s used to store variables such as First Name, Last Name, Product name, Location etc.</p><p>Thank you!<br>If you find it helpful please do follow for more such content…..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f99801db35d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Excel hacks]]></title>
            <link>https://medium.com/@tarusahu2/excel-hacks-092371bf3b0d?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/092371bf3b0d</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[excel-tutorial]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 19:50:45 GMT</pubDate>
            <atom:updated>2026-01-24T19:50:45.761Z</atom:updated>
            <content:encoded><![CDATA[<h3>excelExcel hacks</h3><p>Hi guys, <br>I’m starting an excel series where I’ll share some powerful excel hacks and useful functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGZ-lWxUXGKtT5vxPpsM0g.png" /></figure><p>You can watch all the videos in this playlist:</p><p><a href="https://youtube.com/playlist?list=PLev_d6ECd5JKTcXipH7CkxxYzXpTsPEBq&amp;si=xRjIwIRhGw4EFiYO">https://youtube.com/playlist?list=PLev_d6ECd5JKTcXipH7CkxxYzXpTsPEBq&amp;si=xRjIwIRhGw4EFiYO</a></p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=092371bf3b0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Credit cards default case study]]></title>
            <link>https://medium.com/@tarusahu2/credit-cards-default-case-study-c87a2cd71deb?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c87a2cd71deb</guid>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 17:14:10 GMT</pubDate>
            <atom:updated>2026-01-24T17:24:35.014Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi guys, I’m back with a new case study.</p><p><strong>Case: A bank sees a sudden spike in credit card defaults. How would you analyze the root cause?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*nBg49vaAa9rB2a9ZWunn3g.png" /></figure><p><strong>Interviewee:</strong><br>Clarifying Qs:<br>1. From how long we are experiencing the spikes in credit card defaults? Was this gradual spike or acute change.<br>2. Is this present across the board or linked to any specific customer profile? It could be age band, income band, CIBIL band, salary type<br>(Salaried/ Self-employed), acquisition channel ( digital onboarding/ physical onboarding). <br>* These will help us in understanding where the issue is concentrated <br><strong>Interviewer:<br>1. </strong>The increase started <strong>mid-quarter in Q4 and accelerated towards the end. <br></strong>It was gradual change and related to only credit cards not other lending products e.g. loans<br>2. Segment wise info:<br>a. Age band: 18–25 ( default rate increase significantly), other age bands are stable<br>b. Income band: &lt; 6LPA ( sharp increase), rest no major changes <br>c. CIBIL band: 650–720 ( major spike), &gt;720 ( segment remains stable)<br>d. Employment type: Self-employed, gig workers show high defaults<br>c. Onboarding channel: Digitally onboarded customers ( last 6 months) show a disproportionate increase</p><p><strong>Interviewee: <br></strong>Well from here we can conclude the rise in default rate spike is mainly concentrated among <strong>young, low-income, mid-CIBIL, self-employed customers</strong>, especially those <strong>onboarded digitally in last 6 months</strong></p><p>Follow up Qs: <br>Keeping all these points in mind I would like to ask, Has there been any recent changes in credit policy, underwriting rules or digital onboarding flow?</p><p><strong>Interviewer:<br>Yes, <br></strong>1. Bank <strong>reduced the minimum CIBIL cutoff from 700 to 650. </strong>It was done<strong> </strong>to boost card acquisition growth.<br>2. For digitally onboarded customers:<br>Initial credit limits were <strong>increased by ~25%<br></strong>Income verification was done using a <strong>model-based algorithm. No Physical document verification.</strong><br>3. Manual review for self-employed customers was <strong>removed </strong>and new <strong>instant approval flow</strong> was launched, it reduced Turnaround time from 2 days to 5 mins. <br>4. There was no hike in late payment fees or interest rates.</p><p><strong>Interviewee: <br>Well, All these points suggest that the spike was driven by a combination of loosened credit policy and reduced underwriting checks for self-employed and digitally onboarded customers who were given higher limits than before.</strong></p><p><strong>Interviewer:<br></strong>How would you prove that these policy and onboarding changes caused the spike in defaults?</p><p><strong>Interviewee:</strong><br>In order to confirm the cause and come with a strategic approach we can perform pre vs post analysis where I’ll take complete 1 financial year data from Q1 to Q4 and will check default rate for each quarter for different cohorts in order to know where we are seeing highest spike. <br>I’ll check what’s average DPD ( days past due) for this default set of customers and what’s the utilization rate for them. It help us in gaining insights on user behaviour e.g. if customers are over utilizing then we can put a cap on utilization limit, we can charge extra when they pay back.<br>If there are customers who are exhausting the credit limit too early then they need action from underwriting team as in long run they may cause high risk and loss to bank.</p><p><strong>Recommendation:</strong><br>i) Separate underwriting rules for <strong>digital vs branch</strong> onboarding.<br>ii) Risk-based credit limit assignment instead of flat increases. We can assign different % increase for different levers depending on their profile.<br>e.g. for self-employed, income band (30K), digitally onboarded, CIBIL band ( 650–700) we can assign 0.5% increase<br>while<br>for self-employed, income band(30K), physically onboarded, CIBIL band ( 650–700) we can assign 1.5% increase.<br>iii) Monitoring <strong>early delinquency KPIs</strong> weekly, not quarterly may help to catch defaulters in early time instead of stretching too long and causing high losses.</p><p>Hope it helps you!<br>If you have any more points to add you can…..<br>Thank you!<br>See you soon…..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c87a2cd71deb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connect with me this weekend over topmate!!!!]]></title>
            <link>https://medium.com/@tarusahu2/connect-with-me-this-weekend-over-topmate-2c11964e8f87?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c11964e8f87</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[freelancing]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 17:32:57 GMT</pubDate>
            <atom:updated>2026-01-22T16:53:37.874Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi guys, hope you all are fine. I just wanted to share it with you all that recently I launched my topmate page so if anyone of you is looking to format their resume or is facing challenges in a job search journey and you find I can help you then feel free to connect with me over topmate this weekend.</p><p>Link: <a href="https://topmate.io/taru_sahu11/">https://topmate.io/taru_sahu11/</a></p><p>Note: I’m available only on weekends and currently assisting analytics folks having less than 3 yrs of experience.</p><p>see you soon!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c11964e8f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Business technical terms]]></title>
            <link>https://medium.com/@tarusahu2/business-technical-terms-430daeedc6e7?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/430daeedc6e7</guid>
            <category><![CDATA[technical-analysis]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analysis]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 16:28:21 GMT</pubDate>
            <atom:updated>2025-12-01T16:28:21.849Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi genius, So today I’ve came back a very important topic i.e. business technical terms. Here I’ll share the technical terms for different processes and shift in user behaviour over the time. These terms help us in assessing our performance just looking at the number without any assistance to explain the whole thing going on behind the scenes.</p><p>Let’s start…….<br><strong><em>a) Retention rate: </em></strong><br>I believe if you are coming from analytics background then you must have heard it.<br><strong>Definition:</strong> <br>The existing set of customers who stayed with us, who kept using our services in a given time window.<br>It basically shows the %age of customers who return to our services.</p><p>e.g. %age of customers who kept visiting a site, using instagram, purchasing from E-commerce platforms etc. in a quarter, month, year.</p><p><strong>Calculation:</strong><br>To calculate retention rate we need just three numbers:</p><ul><li>Customers at the start of a given period<br>+ Customers at the end of that period<br>+ New customers acquired during that period</li><li>Formula = (Customers at the start of a given period — New customers acquired during that period)*100/ Customers at the start of a given period</li></ul><p><strong>Application: </strong><br>i) <strong>Customers loyalty:</strong> Retention rate shows how much % of customers actually enjoy our services.<br>ii ) <strong>Scope of improvement: </strong>It also helps us in tracking the scope of improvement our product carries because if customers are not really enjoying it that’s why they are not returning to us. <br>iii) <strong>Business Profitability: </strong>Retaining existing customers is more cost effective than acquiring new ones. Even we retain a smaller portion if customers it will boost profitability. And ultimately we know mouth words work as magic.</p><p><strong><em>b) Churn rate:</em></strong></p><p><strong>Definition:</strong><br>Churn rate shows what portion of existing customers have stopped using our services or haven’t made kind of activity in a given specific period although they used our services previously.</p><p><strong>Calculation:<br>Churn Rate = (Number of Customers Lost / Total Number of Customers at the Start of the Period) x 100</strong></p><p><strong>Application: <br></strong>i) <strong>Analyzing performance:</strong> It helps us in analyzing our performance over a given period of time. <br>Using different techniques, funnel analysis we can identify the affected areas and then we can accordingly form strategies to reverse the trend.<br>ii) <strong>Predicting future revenue:</strong> It is a vital metric for companies that depend on recurring revenue from subscriptions.</p><p><strong><em>c) Acquisition rate:</em></strong></p><p><strong>Definition: </strong><br>The acquisition rate measures how successful a business is in acquiring new customers within a specific timeframe. It’s a vital metric for assessing the effectiveness of marketing and sales efforts to expand the customer base. It quantifies the rate at which potential customers are converted into actual paying customers. It doesn’t include the existing set of customers. <br>It quantifies the success of acquisition marketing efforts.</p><p>Calculation:<br><strong>Acquisition Rate = (Number of New Customers / Total Number of Leads) x 100</strong></p><p><strong>Application:</strong><br>i) The acquisition rate provides actionable insights into how well different marketing channels, tactics, and strategies work. Businesses can allocate resources better by analyzing which channels or campaigns yield the highest acquisition rates. This data-driven approach helps optimize marketing budgets and maximize return on investment (ROI).<br>ii) the acquisition rate impacts <strong>Customer lifetime value (CLV)</strong>. Customers acquired through effective marketing strategies tend to have higher CLV, as they are more likely to remain customers for the long haul and make repeat purchases over time.</p><p><strong>Customer acquisition cost:</strong><br>Customer acquisition costs (CAC) alongside acquisition rate can help us assess the efficiency and profitability of marketing efforts. This metric tells you the Cost invested to acquire new customers, including expenses like marketing, sales, and other relevant departments.</p><p>When paired with acquisition rate, which measures the rate of successful customer acquisitions, businesses can gauge the effectiveness of their investment in acquiring new customers relative to their return.</p><p><strong><em>d) Conversion rate:</em></strong></p><p><strong>Definition:</strong><br>Conversion rate is the percentage of visitors or users who complete a desired action, such as making a purchase, filling out a form, or signing up for a newsletter. It is calculated by dividing the number of conversions by the total number of visitors and multiplying by 100.</p><p><strong>Calculation:<br>Conversion rate = total conversions*100/ total visitors</strong></p><p><strong>Application:</strong><br><strong>i) Measures effectiveness</strong>: Conversion rate directly measures how well your marketing is persuading people to take a desired action.<br>ii) <strong>Identifies issues</strong>: A low conversion rate can highlight problems with your website’s design, content, or call-to-actions.</p><p>Hope it helped you!<br>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=430daeedc6e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dense_rank and row_number in SQL]]></title>
            <link>https://medium.com/@tarusahu2/dense-rank-and-row-number-in-sql-15b257f6a141?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/15b257f6a141</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 17:08:31 GMT</pubDate>
            <atom:updated>2025-11-28T17:45:59.765Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey hi genius, so today I’ve brought a very important topic in SQL i.e. ranking functions which are basically window functions. <br>So let’s start….<br>You can read about ranking functions here:<br><a href="https://medium.com/@tarusahu2/ranking-functions-in-sql-30a00c3ce3e0">https://medium.com/@tarusahu2/ranking-functions-in-sql-30a00c3ce3e0</a></p><p>Well we all know ranks hold immense importance in our daily life from getting rank on the basis of marks to achieving badge of top 3/ top 5 in any competition. But as we know this doesn’t end here. In businesses also we check ranks of products, regions, acquisition channel etc. in order to analyze the performance and take actions accordingly to optimize the process.</p><p>So here starts the real game….</p><p><strong>Dense_rank</strong>:<br>Now let me give a business scenario.<br>Let’s assume you are working at Myntra and your stakeholder asks you to deliver a dashboard for best and worst performers of the quarter for each of the following:<br>product category, region, acquisition channel<br>depending on revenue generated.<br>What will you do here?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yc77w-DXu6xq-buO.png" /></figure><p>So our first step would be to calculate total revenue for each cohort given above.<br>Let’s say we want to get best and worst performer in product category.</p><p><strong>Best performer:</strong><br>We will assign rank to each product category on the basis of revenue.<br>Now here’s the catch, as there may be product categories generating same revenue in fact they both might be the top performer so in that case row_number can’t help as row_number assigns unique rank to each record so to deal with it we can use dense_rank() because it assigns same rank to tied records and next rank to next record without skipping unlike rank() does. <br>And then we will filter only those records where rank = 1<br>Finally we will get top performers following these steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*ioY8GtGHcIEQJL_DITmX6w.png" /><figcaption>Input table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*McZXmijgYd7PXaelwF67nw.png" /></figure><pre>with revenue as (select product_category, (Quantity_sold*Price) as revenue_amount<br>from Myntra_products<br>group by product_category<br>order by product_category desc),<br>ranker as (select product_category, revenue_amount,<br>dense_rank() over(partition by product_category order by revenue_amount desc) as descending_rank,<br>dense_rank() over(partition by product_category order by revenue_amount asc) as ascending_rank<br>from revenue)<br>select product_category as best_performer_product, revenue_amount<br>from ranker<br>where descending_rank=1;</pre><p><strong>Worst performer:</strong></p><blockquote>**sort revenue in ascending and assign rank 1<br>select product_category as worst_performer_product, revenue_amount<br>from ranker<br>where ascending_rank=1;</blockquote><p><strong>Row_number application:</strong></p><p>Whenever we want to find streak of dates or consecutive numbers with no gap then row_number saves us.</p><p>let’s say your manager asks you to get a list of those customers who have purchased in every month in last 6 months with no gap. <br>e.g. if we have three customers with userID Cu101, Cu102 &amp; Cu103 as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*NlU2wxh2OTG0apHU83QmIg.png" /><figcaption>last 7 months data of customers</figcaption></figure><p>Then how would you get those customers who ordered every month in last 6 months time frame without skipping any month.</p><p>Sol. <br>i) You firstly need to calculate order_month from each order_date using month() function. <br>ii) Then filter only last 6 months data using where clause.<br>iii) After that keep distinct months only for each customer. <br>iv) Next assign rank to each customer on the basis of month order from min as 1 to max as last.<br>v) After that find the streak group for each customer’s order by subtracting rank and month no. <br>vi) After that calculate the count of distinct months for each customer.<br>vii) Now take count of 0 from streak group for each customer…<br>viii) After that filter for customers where count of 0 from streak group is 6 and count of distinct months is also 6 using where clause. This insures that there are 6 distinct months with no gap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*IC6puBSJZUjCHqR_6V-uiA.png" /></figure><p>code:</p><pre>WITH last_6_months AS (<br>    -- 1. Filter last 6 months + extract month number<br>    SELECT <br>        customerID,<br>        order_date,<br>        EXTRACT(MONTH FROM order_date) AS order_month<br>    FROM orders<br>    WHERE order_date &gt;= DATEADD(MONTH, -6, CURRENT_DATE)<br>),<br><br>distinct_months AS (<br>    -- 2. Keep only distinct months per customer<br>    SELECT DISTINCT <br>        customerID,<br>        order_month<br>    FROM last_6_months<br>),<br><br>ranked AS (<br>    -- 3. Assign rank to each customer&#39;s months<br>    SELECT <br>        customerID,<br>        order_month,<br>        ROW_NUMBER() OVER (<br>            PARTITION BY customerID <br>            ORDER BY order_month<br>        ) AS rn<br>    FROM distinct_months<br>),<br><br>streak_groups AS (<br>    -- 4. Create group_id using (month - rank)<br>    SELECT<br>        customerID,<br>        order_month,<br>        rn,<br>        order_month - rn AS group_id<br>    FROM ranked<br>),<br><br>streak_count AS (<br>    -- 5. Count months in each streak per customer<br>    SELECT<br>        customerID,<br>        group_id,<br>        COUNT(*) AS streak_months<br>    FROM streak_groups<br>    GROUP BY customerID, group_id<br>),<br><br>month_count AS (<br>    -- 6. Count total distinct months for each customer<br>    SELECT<br>        customerID,<br>        COUNT(*) AS distinct_months<br>    FROM distinct_months<br>    GROUP BY customerID<br>)<br><br>-- 7. Final output: customers with 6 distinct months AND a 6-month streak<br>SELECT <br>    s.customerID<br>FROM streak_count s<br>JOIN month_count m<br>    ON s.customerID = m.customerID<br>WHERE s.streak_months = 6<br>  AND m.distinct_months = 6;</pre><p><strong>Chess problem:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*rw0dPDZ0GgM55z1t" /></figure><p>Let’s say you are being given with a chess table that contains playerID, playerDate i.e. date of game played and no. of games played as games_played.<br>Now you need to find player with the maximum streak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*PHuwHXDGrdGr4MQs5uQAjw.png" /></figure><p>Sol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*dzjrsyJbovYVT_uai25LAQ.png" /></figure><p>In order to solve it we will use following steps:<br>i) Get rank of playerDate using row_number as it will assign unique rank to each date.<br>ii) Calculate group_date in order to assign a group value to each consecutive date using date_sub(player_date, row_number).<br>iii) Now get streak_count using count function over group_date and grouping by playerID and group_date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*sS9gCGjY9vqDV9NR9WCy7w.png" /></figure><p>iv) Now get max of streak count for each player using max function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/1*JigExO1z45LdjF3BQN40Pw.png" /></figure><p>v) Now to get player with max streak either use subquery and match salary with maximum salary or use dense_rank function. Use these two methods in order to handle tied records.</p><pre>SQL sol.: <br>With ranker as (select *, row_number() over(partition by playerID order by PlayerDate asc) as row_number_rank <br>from Chess),<br>Streak_group as (select *, date_sub(PlayerDate, row_number_rank) as group_date<br>from ranker),<br>counter as( select playerID, group_date, count(group_date) as streak_count<br>from Streak_group<br>group by playerID, group_date),<br>maxStreak_per_player as ( select playerID, max(streak_count) as max_streak<br>from counter<br>group by playerID)<br>select playerID as max_streak_players, max_streak<br>from maxStreak_per_player<br>where max_streak = (select max(max_streak) from maxStreak_per_player);</pre><p>Hope it helped you in understanding the application of dense_rank and row_number.</p><p>Share your thoughts in comment section….</p><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15b257f6a141" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solve problems using SQL]]></title>
            <link>https://medium.com/@tarusahu2/solve-problems-using-sql-6c73902c8999?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c73902c8999</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 16:52:09 GMT</pubDate>
            <atom:updated>2025-11-17T03:18:15.061Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey hi, today I’ve brought few interesting SQL problems to you….</p><ol><li>You are being given with a theatere’s data which contains all the movies screened there on their release date, release date of movie and revenue collected in Crores.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*Gb4o6GSEV5tDlHaK5llGeA.png" /></figure><p>So here we need to find the movie name and it’s release date when revenue of Phoenix theatre reached 11000 Cr.</p><p>To solve it we will use cumulative sum and then we will filter on this cumulative sum.</p><p>with cumulative_collection as ( select *, sum(Collection_amount) over(order by Release_date asc) as running_amount<br>from Phoneix_theatre)<br>select Movie_Name, Release_date, running_amount<br>from cumulative_collection<br>where running_amount=11000;</p><p>2. You are being given two tables: table A and table B <br>and you are being asked to give new table along with total no. of records in table after joining both A and B on a and b using following joins:</p><p>i) Left Join<br>ii) Right Join<br>iii) Inner join<br>iv) Full outer join<br>v) Cross join</p><p>You can watch this embedded video for better understanding:</p><p><a href="https://youtu.be/TaV6OniK7ag?si=-qGtUasEDotvbtkG">Joins in SQL</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*afLH34jTsqHv9dhkY79lpw.png" /></figure><p>Left join:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/190/1*azuW12e1Ko05lul_6924Xg.png" /></figure><p>Right join:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/189/1*8RTE60lQ1qauzNwdF5koQQ.png" /></figure><p>Inner join:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*ZCAz26sX28mkHbXfYpuNVw.png" /></figure><p>Full outer join:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*kLiyMyaWkUJDYq7gjsy6kA.png" /></figure><p>Cross join:</p><p>Total 30 records will be returned as a result of cartesian product of column a and column b from table A and table B respectively.</p><p>If you find it insightful share your thoughts in comment box!<br>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c73902c8999" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swiss re credit portfolio analyst interview]]></title>
            <link>https://medium.com/@tarusahu2/swiss-re-credit-portfolio-analyst-interview-de02dcef6a78?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/de02dcef6a78</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[swissre]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 17:02:16 GMT</pubDate>
            <atom:updated>2025-11-15T17:02:16.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ocp2bagdu8nW8pG1.jpg" /></figure><p>Hi Fam, So I’m back with a new interview experience….</p><ol><li>Introduce yourself</li><li>Walk me through your one of the projects</li><li>What metrics did you use in this project? What’s meaning of them? How they help business?</li><li>What is NPA and what role does it play in bank?</li><li>How do you perform data cleaning in SQL?</li><li>How will you respond to stakeholder if he reports he isn’t getting correct nos. and you know what dataset he is using and from which column this arose?<br>Additionally the employee who handles all these tables in not available today given that it’s urgent to fix the issue.</li><li>Do you have experience in data modelling and pipeline creation?</li><li>Do you have experience in working with BI tools and how did you incorporate it in your work?</li><li>How did you create metrics in powerBI?</li><li>Do you know how can we reflect live changes in powerBI dashboard?</li><li>How will you optimize a query’s execution time if it’s taking longer than expected time?</li><li>What’s CTE in SQL?</li><li>You are being given a students table with Student’s roll no., subject and marks achieved by student in that subject. <br>How will you calculate top 3 students for each subject on the basis of marks scored by them?</li><li>You are being given a Movies table with movie_name, release_date, collection_amount<br>How will you get the release date and movie name when the collection from all movies reached 11000 Cr at theatre?</li><li>Why you left your last organization?</li><li>Why do you want to join Swiss re?</li></ol><p>Thanks for reading!!<br>Hope it helps you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de02dcef6a78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shiprocket Product Analyst Interview]]></title>
            <link>https://medium.com/@tarusahu2/shiprocket-product-analyst-interview-f727a2b881ec?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f727a2b881ec</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 10:29:28 GMT</pubDate>
            <atom:updated>2025-10-31T13:00:05.114Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Fam, I hope you are fine.<br>This time I’ve came up with a new story, new interview.<br>So recently I got a chance to appear for product analyst interview at Shiprocket.<br>Interview mostly revolved around SQL Qs, resume and behavioral Qs.<br>Let’s start…..</p><ol><li>Why are you looking for a job opportunity?<br>You can frame this ans according to you keeping in mind what opportunities you are looking for, why you are moving out of last organization, what’s attracting you to work in this field in long term.<br>Basically you should incorporate growth oriented laguage in your ans.</li><li>What was the learning curve in your last organization?<br>In my last organization I got opportunities to work on multiple projects around the risk assessment of credit card customers and personal loan customers. For analysis purpose I mostly used python, SQL, pyspark, Excel and powerBI. There I also got a chance to collaborate with different teams and know how actually they deal with complex problems and urgent adhoc requests.</li><li>What is your favourite product and why?<br>I personally find Gmail as a very good product for communication as it has these following features which make it standout from others:<br>i) No need to send invite and get approval for connecting and sending message.<br>ii) No need to share contact number or location and hence no chance to get spam calls <br>iii) We can schedule the message seeing the requirement<br>iv) We can include multiple persons in same thread and no need to make a group<br>v) We can star mark the important messages.<br><em>Follow up:<br>And what is it’s scope of improvement?<br></em>Well….Although I like this product but there are certain things I find that these need to be fixed e.g. <br>i) We can’t see if the mail is seen by receiver or not.<br>ii) Sometimes Important messages get into spam and junk hence important events are missed.</li><li>Who were your stakeholders in your last organization?<br>My ans: so basically I was working in risk dept. of cards team.<br>Note: You can manipulate your ans according to your work experience.</li></ol><p><strong>Technical:<br>Four tables are given and you need to ans few Qs.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*JkvihkAO_g8All2DY2mpmA.png" /><figcaption>Patient table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*JEcmDKoy1c8-1u7kkvSPOg.png" /><figcaption>Doctors table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Njbrx4Xgit0K5DbPt6JWXw.png" /><figcaption>Appointment table</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*unXFW1VF9zMEfCaovuvInw.png" /><figcaption>Payment table</figcaption></figure><p>5. Calculate the total no. of appointments.<br> select count(appointement_id) as total_appointments<br> from Appointment;</p><p>6. Calculate the total no. of appointments against each doctor.<br>select d.doctor_name, count(a.appointment_id) as total_appointments from doctor d <br>left join Appointment a<br>on d.doctor_id = a.doctor_id group by d.doctor_name;</p><p>7. Calculate the total no. of appointments against for each patient who has appointed more than 1 time.<br>select p.patient_name,count(a.appointment_id) as total_appointments from patient p <br>left join Appointment a <br>on p.patient_id = a.patient_id <br>group by p.patient_name <br>having total_appointments&gt;1;</p><p>8. Find the patient names who are listed as 2nd highest appointers.<br>with base as (<br>select p.patient_name,count(a.appointment_id) as total_appointments from patient p <br>left join Appointment a <br>on p.patient_id = a.patient_id <br>group by p.patient_name),</p><p>ranker as( select *, dense_rank() over(partition by patient_name order by total_appointments desc) as rn from base)</p><p>select patient_name, total_appointments <br>from ranker where rn=2;</p><p>9. Calculate the avg. fees charged by doctors as per the degree of specialization they carry.<br>Output will contain degree/ specialization and avg. fees for that.<br>select d.specialization, avg(p.amount) as avg_fees <br>from appointment a <br>left join doctor d <br>on d.doctor_id = a.doctor_id <br>left join payment p <br>on a.appointment_id = p.appointment_id <br>group by d.specialization</p><p>10. Calculate the total no. of appointments for each patient against each doctor.<br>select patient_id, doctor_id, count(appointments) as appoint_count<br>from appointment <br>group by patient_id, doctor_id;</p><p>11. Calculate the monthly growth in revenue for each doctor as compared to immediate prev month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*uowmWSfulHn-LATnLWblTQ.png" /></figure><p>select doctor_id, doctor_name, rev, ((lag(rev,1) over(partition by doctor_name order by month desc) — revenue)/ (lag(rev,1) over(partition by doctor_name order by month desc)))*100 <br>from a</p><p>12. Calculate the avg. time between the appointment creation and appointment attendance by patient in hours <br>select avg(datediff(‘day’,created_date, appointment_date)*24)<br>from Appointment;</p><p>Hope it helps you!<br>If you find it helping then kindly share your thoughts in comments section….<br>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f727a2b881ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retail Industry annual revenue…]]></title>
            <link>https://medium.com/@tarusahu2/retail-industry-annual-revenue-8b824fa6e60e?source=rss-29e3cad8b9b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b824fa6e60e</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Taru Sahu]]></dc:creator>
            <pubDate>Sun, 26 Oct 2025 18:13:08 GMT</pubDate>
            <atom:updated>2025-10-26T18:13:08.719Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*XzH2PmxnnvNXPzBBprtvCg.jpeg" /></figure><p>Hi fam, So recently I got a chance to appear for case study round at Tercept. And there we discussed a business case study.</p><p><em>Case: You are working as business analyst for a retail company it’s planning to expand it’s operation in India. You task is to conduct comprehensive analysis of the Indian retail market.</em></p><p>i)	Provide an estimate for the current population of India.<br>ii)	Segment the population based on income brackets.( Low, middle, high) and estimate the % of each segment use approximate income levels to define these.<br>iii)	Calculate the total addressable market for the retail industry based on the estimated population and the % of people likely to shop in a retail store. <br>iv)	Estimate the avg. spending per customer in retail stores in India.<br>v)	Based on the total addressable market and the avg. revenue per customer calculate the potential revenue that a retail company can generate annually.</p><p><strong>Clarifying Qs: </strong><br>a<em>.	What are these retail stores? : Dmart, Supermarket basically luxurious grocery stores<br>b.	Which cities we need to consider? Tier1, Tier2, Tier3 or all?: Only Tier1</em></p><p><strong>Solution:</strong><br>i)	Let population of India be 1.4 billion i.e. 140*10^7<br>ii)	Now I’m assuming urban population constitutes 60% of the population and out this base of urban population 30% live in Tier1 cities (rest 30% in Tier2 and rest 40% in Tier3) <br>iii)	Now I’ll divide this population into three income brackets based on their monthly income. <br>Low income(&lt;15k): 25% <br>Middle income(15k-50k): 50% <br>High income(&gt;50k): 20% <br>iv)	Now I’ll assume adoption % of retail stores for each income bracket:<br>Low income: 10%<br>Middle income: 80%<br>High income: 100% <br>v)	Now I’ll calculate total base of population or can say total addressable market for retail industry. 157.5 * 10^6<br>vi)	Now I’m assuming monthly spend for low income: 3000, middle income: 10000, high income: 20000<br>So avg. monthly spending per person = 110000<br>vii)	Now I’ll calculate total monthly spending by addressable base = 110000*addressable base: 157.5*10^6*110000 =&gt; 2.305*10^12</p><p>viii)	Finally to get annual spending I’ll multiply it by 12: 24.42*10^12</p><p>so total of approximately 24.4 trillion revenue is generated from tier1 cities in India in a year.</p><p>Hope it helps you!<br>If you find it helpful follow for more such stories. And leave you thoughts in comments 😊…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b824fa6e60e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>