<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Malini's Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://maliniroychoudhury.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png</url><title>Malini&apos;s Substack</title><link>https://maliniroychoudhury.substack.com</link></image><generator>Substack</generator><lastBuildDate>Thu, 21 May 2026 14:34:18 GMT</lastBuildDate><atom:link href="https://maliniroychoudhury.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Malini RoyChoudhury]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[maliniroychoudhury@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[maliniroychoudhury@substack.com]]></itunes:email><itunes:name><![CDATA[Malini RoyChoudhury]]></itunes:name></itunes:owner><itunes:author><![CDATA[Malini RoyChoudhury]]></itunes:author><googleplay:owner><![CDATA[maliniroychoudhury@substack.com]]></googleplay:owner><googleplay:email><![CDATA[maliniroychoudhury@substack.com]]></googleplay:email><googleplay:author><![CDATA[Malini RoyChoudhury]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Cleaning Data with SQL and Python: The Real Analysis]]></title><description><![CDATA[Every dataset I&#8217;ve worked with has been messy.]]></description><link>https://maliniroychoudhury.substack.com/p/cleaning-data-with-sql-and-python</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/cleaning-data-with-sql-and-python</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Mon, 06 Apr 2026 17:43:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every dataset I&#8217;ve worked with has been messy. And here&#8217;s the truth: <strong>data cleaning isn&#8217;t a prep step it </strong><em><strong>is</strong></em><strong> the analysis.</strong></p><p>When you strip away the noise, four challenges always show up:</p><ul><li><p><strong>Missing values</strong></p></li><li><p><strong>Duplicates</strong></p></li><li><p><strong>Data types &amp; formatting</strong></p></li><li><p><strong>Outliers</strong></p></li></ul><p>These aren&#8217;t just technical hurdles. Each decision whether to impute, drop, cast, trim, or flag shapes the story your dataset tells.</p><div><hr></div><h3>SQL vs Python: Side&#8209;by&#8209;Side Syntax</h3><p>Here&#8217;s a quick reference for tackling the same problems in SQL and Python.</p><h4>&#128313; Missing Values</h4><p><strong>SQL</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;sql&quot;,&quot;nodeId&quot;:&quot;0d8e5181-97eb-43b3-a141-1c8f12546f89&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-sql">-- Find missing values 
SELECT * FROM table WHERE col IS NULL; 

-- Replace missing values 
SELECT COALESCE(col, 0) FROM table;</code></pre></div><p><strong>Python</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;01dfc6ec-44ff-4474-a178-906fcb88d773&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Find missing values 
df.isnull().sum() 
df[df[&#8217;col&#8217;].isna()] 

# Replace missing values 
df[&#8217;col&#8217;].fillna(0) 
df[&#8217;col&#8217;].fillna(df[&#8217;col&#8217;].mean())</code></pre></div><h4>&#128313; Duplicates</h4><p><strong>SQL</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;sql&quot;,&quot;nodeId&quot;:&quot;225b16a0-8a82-416f-bd6e-106f3305f16e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-sql">-- Remove duplicates 
SELECT DISTINCT * FROM table;</code></pre></div><p><strong>Python</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;eea352a5-53c5-4474-81bd-4123ff4703e3&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Count duplicates 
df.duplicated().sum() 

# Drop duplicates 
df.drop_duplicates()</code></pre></div><h4>&#128313; Data Types &amp; Formatting</h4><p><strong>SQL</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;sql&quot;,&quot;nodeId&quot;:&quot;22460097-3304-409e-9879-c336a70bb440&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-sql">-- Convert data type 
 SELECT CAST(col AS INT) FROM table; 

-- Convert date 
SELECT TO_DATE(col, &#8216;YYYY-MM-DD&#8217;) FROM table; 

-- Clean text 
SELECT TRIM(col) FROM table;</code></pre></div><p><strong>Python</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;7d10e7b2-cbb7-46a2-9d5d-e19926441ad0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Convert data type
df[&#8217;col&#8217;].astype(int) 
pd.to_numeric(df[&#8217;col&#8217;])
 
# Convert date 
pd.to_datetime(df[&#8217;col&#8217;], format=&#8217;%Y-%m-%d&#8217;)
 
# Clean text 
df[&#8217;col&#8217;].str.strip() 
df[&#8217;col&#8217;].str.lower()</code></pre></div><h4>&#128313; Outliers (IQR Method)</h4><p><strong>SQL</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;sql&quot;,&quot;nodeId&quot;:&quot;fbec554e-9169-45b4-a811-80005efa82b2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-sql">WITH q AS ( 
 SELECT 
    PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY col) q1, 
    PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY col) q3 
 FROM table 
) 
SELECT * FROM table 
WHERE col BETWEEN (q1 - 1.5*(q3 - q1)) 
AND (q3 + 1.5*(q3 - q1));</code></pre></div><p><strong>Python</strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;4ebb8a65-3fbe-419e-8efd-6d6dd6678289&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">Q1 = df[&#8217;col&#8217;].quantile(0.25) 
Q3 = df[&#8217;col&#8217;].quantile(0.75) 

IQR = Q3 - Q1 

df[(df[&#8217;col&#8217;] &gt; Q1 - 1.5*IQR) &amp; (df[&#8217;col&#8217;] &lt; Q3 + 1.5*IQR)]</code></pre></div><div><hr></div><h4>Why This Matters</h4><p>Cleaning is not housekeeping. It&#8217;s judgment, context, and domain knowledge in action. The insights don&#8217;t come <em>after</em> cleaning they emerge <em>through</em> it.</p><p>So whether you&#8217;re writing SQL queries or chaining Python methods, remember: every choice you make in cleaning is already shaping the analysis.</p><p></p>]]></content:encoded></item><item><title><![CDATA[8 Essential Ecommerce KPIs for Data Analysts]]></title><description><![CDATA[If you're breaking into data analytics, ecommerce is one of the best domains to learn.]]></description><link>https://maliniroychoudhury.substack.com/p/8-essential-ecommerce-kpis-for-data</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/8-essential-ecommerce-kpis-for-data</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Wed, 01 Apr 2026 16:30:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uBbT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you're breaking into data analytics, ecommerce is one of the best domains to learn.<br>Why? Because every metric has a direct business impact you can measure, explain, and act on.<br>Here are 8 KPIs every aspiring data analyst should know cold.<br>Save this. Your next interview might thank you.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uBbT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uBbT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 424w, https://substackcdn.com/image/fetch/$s_!uBbT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 848w, https://substackcdn.com/image/fetch/$s_!uBbT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!uBbT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uBbT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg" width="724" height="376.6294067067928" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:605,&quot;width&quot;:1163,&quot;resizeWidth&quot;:724,&quot;bytes&quot;:49990,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/192814957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uBbT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 424w, https://substackcdn.com/image/fetch/$s_!uBbT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 848w, https://substackcdn.com/image/fetch/$s_!uBbT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!uBbT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08150c8d-4ec1-43b1-9eaa-0e6662d180a0_1163x605.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>1. Conversion Rate (CVR)</h2><ol><li><p><strong>Definition:</strong> Conversion Rate measures the percentage of website visitors who complete a purchase.</p></li><li><p><strong>Formula:</strong> CVR = (Number of Orders &#247; Number of Sessions) &#215; 100</p></li><li><p><strong>Real-World Example:</strong> An ecommerce store gets 10,000 visitors and 200 make a purchase. CVR = (200 &#247; 10,000) &#215; 100 = 2%.</p></li><li><p><strong>Where Analysis Happens:</strong> Analysts track CVR using website analytics tools like Google Analytics or ecommerce platforms.</p></li><li><p><strong>Why It Matters:</strong> CVR shows how effectively a site turns visitors into buyers, directly impacting revenue.</p></li><li><p><strong>What Impacts CVR:</strong> Page load speed, checkout process simplicity, product appeal, trust signals, and marketing quality.</p></li><li><p><strong>How to Improve:</strong> Reduce page load time, simplify checkout, add social proof, and A/B test call-to-action buttons.</p></li><li><p><strong>Result/Conclusion:</strong> Even a 0.5% increase in CVR can significantly boost revenue without extra ad spend.</p></li><li><p><strong>Interview Tip:</strong> Explain CVR with formula, example, and suggest practical improvements.</p></li><li><p><strong>Business Impact:</strong> A 0.5% lift in CVR for a brand with 10,000 monthly visitors can mean 50 extra orders and &#8377;50,000+ additional revenue.</p></li></ol><div><hr></div><h2>2. Average Order Value (AOV)</h2><ol><li><p><strong>Definition:</strong> AOV is the average amount spent by a customer per order.</p></li><li><p><strong>Formula:</strong> AOV = Total Revenue &#247; Number of Orders</p></li><li><p><strong>Real-World Example:</strong> If revenue is &#8377;5,00,000 from 500 orders, AOV = &#8377;1,000.</p></li><li><p><strong>Where Analysis Happens:</strong> Sales and transaction data from ecommerce platforms or payment gateways.</p></li><li><p><strong>Why It Matters:</strong> Higher AOV means more revenue from the same number of customers.</p></li><li><p><strong>What Impacts AOV:</strong> Product pricing, upselling, cross-selling, discounts, and bundles.</p></li><li><p><strong>How to Improve:</strong> Offer product bundles, volume discounts, and personalized recommendations.</p></li><li><p><strong>Result/Conclusion:</strong> Increasing AOV by &#8377;200 across 2,000 orders adds &#8377;4,00,000 revenue monthly.</p></li><li><p><strong>Interview Tip:</strong> Show understanding of how AOV affects revenue and suggest strategies to increase it.</p></li><li><p><strong>Business Impact:</strong> Boosting AOV is a cost-effective way to increase revenue without acquiring new customers.</p></li></ol><div><hr></div><h2>3. Customer Acquisition Cost (CAC)</h2><ol><li><p><strong>Definition:</strong> CAC is the total cost spent to acquire one new customer.</p></li><li><p><strong>Formula:</strong> CAC = Total Marketing Spend &#247; Number of New Customers</p></li><li><p><strong>Real-World Example:</strong> Spending &#8377;1,00,000 on ads to get 200 customers means CAC = &#8377;500.</p></li><li><p><strong>Where Analysis Happens:</strong> Marketing spend and customer data from ad platforms and CRM systems.</p></li><li><p><strong>Why It Matters:</strong> CAC shows how efficiently a company acquires customers.</p></li><li><p><strong>What Impacts CAC:</strong> Ad targeting, campaign quality, channel choice, and brand reputation.</p></li><li><p><strong>How to Improve:</strong> Optimize ad campaigns, focus on high-ROI channels, and improve targeting.</p></li><li><p><strong>Result/Conclusion:</strong> Lower CAC means more profitable growth.</p></li><li><p><strong>Interview Tip:</strong> Emphasize the importance of CAC being lower than customer lifetime value.</p></li><li><p><strong>Business Impact:</strong> Healthy brands aim for a 3:1 ratio of LTV to CAC for sustainable growth.</p></li></ol><div><hr></div><h2>4. Lifetime Value (LTV)</h2><ol><li><p><strong>Definition:</strong> LTV is the total revenue a customer generates during their relationship with a brand.</p></li><li><p><strong>Formula:</strong> LTV = AOV &#215; Purchase Frequency &#215; Average Customer Lifespan</p></li><li><p><strong>Real-World Example:</strong> If a customer spends &#8377;1,000 per order, buys 3 times a year, and stays for 1 year, LTV = &#8377;3,000.</p></li><li><p><strong>Where Analysis Happens:</strong> Customer purchase history and retention data.</p></li><li><p><strong>Why It Matters:</strong> LTV helps decide how much to spend on acquiring customers.</p></li><li><p><strong>What Impacts LTV:</strong> Product quality, customer service, loyalty programs, and engagement.</p></li><li><p><strong>How to Improve:</strong> Enhance customer experience, offer loyalty rewards, and encourage repeat purchases.</p></li><li><p><strong>Result/Conclusion:</strong> Higher LTV allows higher CAC while maintaining profitability.</p></li><li><p><strong>Interview Tip:</strong> Discuss LTV&#8217;s role in balancing acquisition cost and profitability.</p></li><li><p><strong>Business Impact:</strong> Target LTV/CAC ratio of 3 or more for profitable scaling.</p></li></ol><div><hr></div><h2>5. Return on Ad Spend (ROAS)</h2><ol><li><p><strong>Definition:</strong> ROAS measures revenue earned for every rupee spent on advertising.</p></li><li><p><strong>Formula:</strong> ROAS = Revenue from Ads &#247; Advertising Spend</p></li><li><p><strong>Real-World Example:</strong> Spending &#8377;50,000 on ads generating &#8377;2,00,000 sales means ROAS = 4x.</p></li><li><p><strong>Where Analysis Happens:</strong> Ad platform reports and sales tracking.</p></li><li><p><strong>Why It Matters:</strong> ROAS indicates ad campaign effectiveness.</p></li><li><p><strong>What Impacts ROAS:</strong> Ad creative, targeting, bidding strategy, and product-market fit.</p></li><li><p><strong>How to Improve:</strong> Test ad creatives, refine targeting, and optimize bids.</p></li><li><p><strong>Result/Conclusion:</strong> ROAS must be considered with profit margins to assess true profitability.</p></li><li><p><strong>Interview Tip:</strong> Explain ROAS and its relation to margins.</p></li><li><p><strong>Business Impact:</strong> A 3.3x ROAS is needed to break even if margins are 30%.</p></li></ol><div><hr></div><h2>6. Churn Rate (CR)</h2><ol><li><p><strong>Definition:</strong> Churn Rate is the percentage of customers who stop buying over a period.</p></li><li><p><strong>Formula:</strong> CR = (Number of Lost Customers &#247; Number of Starting Customers) &#215; 100</p></li><li><p><strong>Real-World Example:</strong> If 100 customers bought last quarter but only 60 returned, churn = 40%.</p></li><li><p><strong>Where Analysis Happens:</strong> Customer purchase and subscription data.</p></li><li><p><strong>Why It Matters:</strong> High churn reduces revenue and growth.</p></li><li><p><strong>What Impacts CR:</strong> Product satisfaction, competition, pricing, and customer service.</p></li><li><p><strong>How to Improve:</strong> Improve product quality, customer support, and engagement.</p></li><li><p><strong>Result/Conclusion:</strong> Reducing churn by 5% can increase profits by 25&#8211;95%.</p></li><li><p><strong>Interview Tip:</strong> Highlight churn&#8217;s impact on retention and revenue.</p></li><li><p><strong>Business Impact:</strong> Lower churn means higher customer lifetime value.</p></li></ol><div><hr></div><h2>7. Net Promoter Score (NPS)</h2><ol><li><p><strong>Definition:</strong> NPS measures customer loyalty by asking how likely they are to recommend a brand on a scale of 0&#8211;10.</p></li><li><p><strong>Formula:</strong> NPS = % Promoters (9&#8211;10) &#8211; % Detractors (0&#8211;6)</p></li><li><p><strong>Real-World Example:</strong> If 60% are promoters and 20% detractors, NPS = 40.</p></li><li><p><strong>Where Analysis Happens:</strong> Customer surveys and feedback tools.</p></li><li><p><strong>Why It Matters:</strong> High NPS drives organic growth through referrals.</p></li><li><p><strong>What Impacts NPS:</strong> Product quality, customer experience, and brand reputation.</p></li><li><p><strong>How to Improve:</strong> Enhance customer service, address complaints, and engage customers.</p></li><li><p><strong>Result/Conclusion:</strong> Good NPS is 50+, excellent 70+, world-class 80+.</p></li><li><p><strong>Interview Tip:</strong> Explain NPS and its importance for customer advocacy.</p></li><li><p><strong>Business Impact:</strong> High NPS reduces acquisition costs via referrals.</p></li></ol><div><hr></div><h2>8. Customer Retention Rate (CRR)</h2><ol><li><p><strong>Definition:</strong> CRR measures the percentage of customers who return to buy again.</p></li><li><p><strong>Formula:</strong> CRR = ((Number of Customers at End &#8211; New Customers) &#247; Number of Customers at Start) &#215; 100</p></li><li><p><strong>Real-World Example:</strong> A 70% CRR means 7 out of 10 customers come back.</p></li><li><p><strong>Where Analysis Happens:</strong> Purchase history and CRM data.</p></li><li><p><strong>Why It Matters:</strong> Retained customers spend more and cost less to serve.</p></li><li><p><strong>What Impacts CRR:</strong> Customer satisfaction, loyalty programs, and communication.</p></li><li><p><strong>How to Improve:</strong> Personalize marketing, offer rewards, and maintain engagement.</p></li><li><p><strong>Result/Conclusion:</strong> Top ecommerce brands maintain 35&#8211;65% annual retention.</p></li><li><p><strong>Interview Tip:</strong> Discuss retention strategies and their impact on revenue.</p></li><li><p><strong>Business Impact:</strong> Higher retention leads to sustainable growth and profitability.</p></li></ol><div><hr></div><h1>Final Thoughts</h1><p>Mastering these 8 KPIs&#8212;CVR, AOV, CAC, LTV, ROAS, CR, NPS, and CRR&#8212;will not only strengthen your ecommerce analytics projects but also make your resume stand out. In interviews, being able to define, calculate, analyze, and suggest improvements for these metrics shows you understand how data translates directly into business impact.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item><item><title><![CDATA[Ecommerce KPI Analysis: Conversion Rate Optimization Explained for Interviews & Resumes]]></title><description><![CDATA[When analytics professionals or business analysts work with Ecommerce brands, Conversion Rate (CVR) is the KPI that makes or breaks their resume impact.]]></description><link>https://maliniroychoudhury.substack.com/p/ecommerce-kpi-analysis</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/ecommerce-kpi-analysis</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Mon, 23 Mar 2026 17:31:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!j2Z0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!j2Z0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!j2Z0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 424w, https://substackcdn.com/image/fetch/$s_!j2Z0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 848w, https://substackcdn.com/image/fetch/$s_!j2Z0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!j2Z0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!j2Z0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:91887,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/191505206?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!j2Z0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 424w, https://substackcdn.com/image/fetch/$s_!j2Z0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 848w, https://substackcdn.com/image/fetch/$s_!j2Z0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!j2Z0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b6f06d8-ab92-4b3a-a2e1-e78ffd03910c_1280x720.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When analytics professionals or business analysts work with Ecommerce brands, <strong>Conversion Rate (CVR)</strong> is the KPI that makes or breaks their resume impact. Interviewers love candidates who can:</p><ul><li><p>Define CVR with a formula</p></li><li><p>Show calculations with real numbers</p></li><li><p>Provide simple insights (e.g., &#8220;CVR improved from 2% &#8594; 3%&#8221;)</p></li><li><p>Suggest practical improvements (checkout flow, page speed, social proof)</p></li><li><p>Explain why it matters (e.g., &#8220;0.5% CVR lift = &#8377;10 lakh/month extra revenue&#8221;)</p></li></ul><p>This post follows the <strong>case study format</strong>: definition, formula, calculation, insight, improvement, and why it matters exactly how you should present it in interviews.</p><p><strong>What is Conversion Rate (CVR)?</strong></p><ul><li><p><strong>Definition</strong>: CVR measures the percentage of visitors who complete a purchase.</p></li></ul><p><strong>Real-world scenario</strong></p><blockquote><p>An Indian D2C skincare brand drives 10,000 sessions per month through Instagram ads. Of those, 200 customers complete a purchase. Their CVR is <strong>2%</strong>  right at the industry average. Now imagine improving that to 2.5% without spending a single extra rupee on ads. That translates to 50 more orders, potentially &#8377;50,000+ in additional monthly revenue. </p></blockquote><div><hr></div><p><strong>Example:</strong></p><ul><li><p>Sessions = 10,000</p></li><li><p>Purchases = 200</p></li></ul><p>&#9989; <strong>Formula: CVR = (Orders &#247; Sessions) &#215; 100</strong></p><p>&#9989; <strong>Calculation:</strong> (200 &#247; 10,000) &#215; 100 = <strong>2%</strong></p><p>&#128161; <strong>Simple Insight:</strong> Out of every 100 visitors, 2 become paying customers. If CVR improves to 2.5%, that&#8217;s 50 extra orders worth &#8377;50,000+ in additional monthly revenue without spending more on ads.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!doBy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!doBy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 424w, https://substackcdn.com/image/fetch/$s_!doBy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 848w, https://substackcdn.com/image/fetch/$s_!doBy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!doBy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!doBy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg" width="887" height="97" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:97,&quot;width&quot;:887,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10876,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/191505206?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!doBy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 424w, https://substackcdn.com/image/fetch/$s_!doBy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 848w, https://substackcdn.com/image/fetch/$s_!doBy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!doBy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e27e37d-d4fe-405c-87fe-8d6331c8b02e_887x97.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Industry Benchmark</strong></p><p>Let me break down the meaning of what you shared in simple terms:</p><ul><li><p><strong>Industry Average (1&#8211;3%)</strong> &#8594; Most e&#8209;commerce stores convert about 1&#8211;3% of visitors into buyers.</p></li><li><p><strong>Top Performers (5%+)</strong> &#8594; The very best stores achieve 5% or higher conversion rates.</p></li><li><p><strong>Your Target (&#8805; 2.5%)</strong> &#8594; A realistic goal is to aim for at least 2.5% conversion rate.</p></li></ul><div><hr></div><p><strong>Actionable levers (ways to improve CVR):</strong></p><ul><li><p><strong>Reduce page load time</strong> &#8594; Every 1&#8209;second delay can drop conversions by up to 7%.</p></li><li><p><strong>Simplify checkout flow</strong> &#8594; Fewer form fields, guest checkout, and multiple payment options make buying easier.</p></li><li><p><strong>Add social proof</strong> &#8594; Reviews, user&#8209;generated photos, and trust badges build credibility and push hesitant buyers to purchase.</p></li><li><p><strong>A/B test CTAs</strong> &#8594; Testing different call&#8209;to&#8209;action buttons (like &#8220;Buy Now&#8221; vs. &#8220;Add to Cart&#8221;) can increase conversions.</p></li></ul><div><hr></div><p><strong>Why it matters:</strong><br>Even a <strong>0.5% CVR increase</strong> can add <strong>&#8377;10 lakh/month in extra revenue</strong> without additional ad spend. That&#8217;s why CVR optimization is the <strong>highest-ROI activity in Ecommerce.</strong></p><div class="pullquote"><p>&#128204;<strong>Stay ahead with the full series. </strong>Subscribe to my channel to receive <strong>resume-ready analytical projects</strong> with interview explanations. Coming up next &#8594; more Ecommerce KPIs you should know to stand out.</p></div>]]></content:encoded></item><item><title><![CDATA[How to Analyze Ecommerce Funnel Drop-offs in Interviews (With Formula & Resume Insights)]]></title><description><![CDATA[If you&#8217;re an analytics professional or business analyst interviewing for an Ecommerce role, you&#8217;ll almost always be asked about conversion funnels. Recruiters want to see if you can:]]></description><link>https://maliniroychoudhury.substack.com/p/ecommerce-conversion-funnel-case</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/ecommerce-conversion-funnel-case</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Thu, 19 Mar 2026 17:59:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CpB_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you&#8217;re an analytics professional or business analyst interviewing for an Ecommerce role, you&#8217;ll almost always be asked about <strong>conversion funnels</strong>. Recruiters want to see if you can:</p><ul><li><p>Define the funnel clearly</p></li><li><p>Apply formulas to calculate drop-offs</p></li><li><p>Interpret insights simply</p></li><li><p>Suggest improvements that drive measurable business impact</p></li></ul><p>This case study walks through a <strong>real-world funnel scenario</strong>: definition, formula, calculation, insight, and why it matters.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CpB_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CpB_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CpB_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CpB_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CpB_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CpB_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg" width="882" height="436" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:882,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39066,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/191501354?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CpB_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CpB_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CpB_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CpB_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7eeb42d7-ad9f-4b24-9b5f-319319e9cb30_882x436.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h5>The calculation</h5><h5>Conversion Rate = (Completed Purchases &#247; Total Visitors) &#215; 100</h5><h5>= (4,000 &#247; 100,000) &#215; 100</h5><h5>= 4%</h5><div><hr></div><p>&#128161; <strong>Insight:</strong> This means out of every 100 visitors, 4 end up making a purchase. Beyond the math, interviewers want to see how you interpret the funnel and identify opportunities to improve each stage (visitor &#8594; cart &#8594; checkout &#8594; purchase).</p><div><hr></div><p><strong>What interviewers actually want to hear</strong></p><p>Getting the math right is just the entry ticket. The best candidates go a layer deeper and identify opportunities at each drop-off point:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1-11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1-11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1-11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1-11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1-11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1-11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg" width="835" height="306" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:306,&quot;width&quot;:835,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:44576,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/191501354?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1-11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1-11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1-11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1-11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc86f9f58-4f57-4c70-a64f-dad77ba98b1a_835x306.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is why conversion funnel analysis is one of the most impactful skills in e-commerce analytics. It&#8217;s not just about one number, it&#8217;s about knowing <em>where</em> you&#8217;re losing customers and <em>why</em>. Nail this framing in your interview, and you immediately stand out from candidates who stop at the formula.</p><p style="text-align: justify;"><em>&#128204;<strong>More is coming.</strong> </em>Subscribe to get access to <strong>similar analytical projects</strong> with 4&#8211;5 resume-ready lines and interview explanations you can directly add to your CV.</p>]]></content:encoded></item><item><title><![CDATA[5 SQL Questions That appear in 80% of interviews]]></title><description><![CDATA[Question #1: Find Duplicate Records]]></description><link>https://maliniroychoudhury.substack.com/p/5-sql-questions-that-appear-in-80</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/5-sql-questions-that-appear-in-80</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Fri, 20 Feb 2026 17:47:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Question #1: Find Duplicate Records </h3><p>The Question: "<strong>Given a users table, find all duplicate email addresses.</strong>"</p><p><strong>The Solution: </strong></p><p>&#10060; <em>Basic (gets you by): </em></p><h5><code>SELECT email, COUNT(*) </code></h5><h5><code>FROM users </code></h5><h5><code>GROUP BY email </code></h5><h5><code>HAVING COUNT(*) &gt; 1  </code></h5><p>&#9989; <em>Better (gets you hired):  </em></p><h5><code>SELECT email, COUNT(*) as duplicate_count, </code></h5><h5><code>STRING_AGG(user_id, ' , ') as user_ids  </code></h5><h5><code>FROM users </code></h5><h5><code>GROUP BY email </code></h5><h5><code>HAVING COUNT(*) &gt; 1 </code></h5><h5><code>ORDER BY duplicate_count DESC </code></h5><blockquote><p>Why it's better: &#8594;Shows which specific users affected </p><p>&#8594;Prioritizes by severity (most duplicates first) </p><p>&#8594;Actionable for data clean up team.</p></blockquote><h3>Question #2 : Second Highest Salary </h3><p>The Question: <strong>"Find the second highest salary from an employees table. "</strong></p><blockquote><p> Most people get this wrong&#8595; </p><p>What happens if two people have the highest salary?</p></blockquote><p><strong>The Solution: </strong></p><p>&#10060; <em>Basic (gets you by):</em> </p><h5><code>SELECT MAX(salary) </code></h5><h5><code>FROM employees </code></h5><h5><code>WHERE salary &lt; (SELECT MAX (salary) FROM employees) </code></h5><p>&#9989; <em>Better (gets you hired):</em> </p><h5><code>SELECT salary </code></h5><h5><code>FROM( SELECT salary, </code></h5><h5><code>DENSE_RANK() OVER </code></h5><h5><code>(ORDER BY salary DESC) as rank</code></h5><h5><code>FROM employees ) ranked </code></h5><h5><code>WHERE rank = 2 </code></h5><blockquote><p>Key difference: &#8594; DENSE_RANK handles ties properly </p><p>&#8594; If two people earn$100K (rank 1), next salary gets rank 2</p><p>&#8594; ROW_NUMBER would skip to rank 3</p></blockquote><h3>Question #3: Calculate Running Totals </h3><p>The Question: <strong>"Show cumulative sales by date." </strong></p><blockquote><p>What they're testing: Do you understand window functions? </p><p>This is where juniors struggle&#8595; They try to use self-joins instead of window functions</p></blockquote><p><strong>The Solution: </strong></p><p>&#10060; <em>Basic (gets you by):</em> </p><h5><code>SELECT o1.order_date,</code></h5><h5><code>SUM(o2.amount) AS running_total</code></h5><h5><code>FROM orders o1</code></h5><h5><code>JOIN orders o2</code></h5><h5><code>ON o2.order_date &lt;= o1.order_date</code></h5><h5><code>GROUP BY o1.order_date;</code></h5><p>&#9989; <em>Better (gets you hired):</em> </p><h5><code>SELECT order_date, daily_sales,</code></h5><h5><code>SUM(daily_sales) OVER (ORDER BY order_date) AS running_total</code></h5><h5><code>FROM ( SELECT order_date,</code></h5><h5><code>SUM(amount) AS daily_sales</code></h5><h5><code>FROM orders</code></h5><h5><code>GROUP BY order_date</code></h5><h5><code>) daily;</code></h5><blockquote><p>Why window functions? &#8594; Calculate aggregates without collapsing rows</p><p>&#8594;Perfect for trends over time (dashboards love this)</p><p>&#8594;10x more efficient thanself-joins </p><p>What to say: "<em>Window functions let me keep row-level detail while computing running calculations&#8212;essential for time-series analysis.</em>"</p></blockquote><h3>Question #4: Customers With No Orders</h3><p><strong>The Question:</strong> <em>&#8220;List all customers who haven&#8217;t placed any orders.&#8221;</em><br><strong>What they&#8217;re testing:</strong> Do you know when to use different joins and how to handle NULLs?</p><p>&#9989; <strong>Solution 1: LEFT JOIN</strong></p><h5><code>SELECT c.customer_id, c.name </code></h5><h5><code>FROM customers c </code></h5><h5><code>LEFT JOIN orders o ON c.customer_id = o.customer_id </code></h5><h5><code>WHERE o.order_id IS NULL;</code></h5><ul><li><p><strong>Why it works:</strong> The <code>LEFT JOIN</code> keeps all customers, and the <code>WHERE o.order_id IS NULL</code> filters those without matches in <code>orders</code>.</p></li><li><p><strong>Performance note:</strong> Often faster on large datasets compared to subqueries.</p></li></ul><p>&#9989; <strong>Solution 2: NOT IN</strong></p><h5><code>SELECT customer_id, name </code></h5><h5><code>FROM customers </code></h5><h5><code>WHERE customer_id </code></h5><h5><code>NOT IN ( SELECT customer_id FROM orders );</code></h5><ul><li><p><strong>Caution:</strong> If the subquery returns <code>NULL</code>, this can fail. Mentioning this shows real&#8209;world awareness.</p></li></ul><p>&#9989; <strong>Solution 3: NOT EXISTS</strong></p><h5><code>SELECT c.customer_id, c.name </code></h5><h5><code>FROM customers c </code></h5><h5><code>WHERE NOT EXISTS ( </code></h5><h5><code>SELECT 1 </code></h5><h5><code>FROM orders o </code></h5><h5><code>WHERE o.customer_id = c.customer_id );</code></h5><ul><li><p><strong>Why it&#8217;s solid:</strong> Handles NULLs safely and is often more reliable across SQL dialects.</p></li></ul><blockquote><p><strong>Interview sound bite:</strong><br><em>&#8220;I&#8217;d prefer </em><code>LEFT JOIN &#8230; IS NULL</code><em> or </em><code>NOT EXISTS</code><em> because they handle NULLs correctly and scale better. </em><code>NOT IN</code><em> can break if the subquery returns NULLs.&#8221;</em></p></blockquote><h3>Question #5: Month&#8209;Over&#8209;Month Growth</h3><p><strong>The Question:</strong> <em>&#8220;Show monthly revenue growth percentage.&#8221;</em><br><strong>What they&#8217;re testing:</strong> Can you compare time periods using window functions?</p><p>&#9989; Solution</p><h5><code>WITH monthly_revenue AS ( </code></h5><h5><code>SELECT DATE_TRUNC(&#8217;month&#8217;, order_date) AS month, </code></h5><h5><code>SUM(amount) AS revenue </code></h5><h5><code>FROM orders </code></h5><h5><code>GROUP BY month ) </code></h5><h5><code>SELECT month, revenue, </code></h5><h5><code>LAG(revenue) OVER (ORDER BY month) AS prev_month, </code></h5><h5><code>ROUND( ((revenue - LAG(revenue) </code></h5><h5><code>OVER (ORDER BY month)) / </code></h5><h5><code>LAG(revenue) OVER </code></h5><h5><code>(ORDER BY month) * 100), 2 ) </code></h5><h5><code>AS growth_pct </code></h5><h5><code>FROM monthly_revenue;</code></h5><blockquote><p>Why LAG function? &#8594;Access previous row values cleanly</p><p> &#8594;More readable than self-joins</p><p>&#8594;Essential for any time-based comparison</p></blockquote><p><strong>Business context:</strong><br><em>&#8220;This shows leadership exactly where growth is accelerating or slowing &#8212; a key metric for revenue dashboards and forecasting.&#8221;</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item><item><title><![CDATA[Practical Exam: Grocery Store Sales]]></title><description><![CDATA[MalinisaysLinkedIn]]></description><link>https://maliniroychoudhury.substack.com/p/practical-exam-grocery-store-sales</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/practical-exam-grocery-store-sales</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Thu, 19 Feb 2026 17:41:49 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/63b876ac-6d55-4abb-8062-548aa2799236_2400x1254.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HI0N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HI0N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HI0N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HI0N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HI0N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HI0N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg" width="1456" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109140,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/188523514?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HI0N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HI0N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HI0N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HI0N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7308a0c3-77b0-446a-a1d5-035fac728ecb_1752x688.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h5><em>Malinisays<a href="https://www.linkedin.com/in/malini-roy-choudhury/">LinkedIn</a></em></h5><p>FoodYum is a grocery store chain that is based in the United States.Food Yum sells items such as produce, meat, dairy, baked goods, snacks, and other household food staples.</p><p>As food costs rise, FoodYum wants to make sure it keeps stocking products in all categories that cover a range of prices to ensure they have stock for a broad range of customers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AwHd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AwHd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 424w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 848w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 1272w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AwHd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png" width="875" height="695" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a103fa41-2817-4a6d-be9a-0838377abf31_875x695.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:695,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!AwHd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 424w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 848w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 1272w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa103fa41-2817-4a6d-be9a-0838377abf31_875x695.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Task 1</strong></h2><p>Last year (2022) there was a bug in the product system. For some products that were added in that year, the <code>year_added</code> value was not set in the data. As the year the product was added may have an impact on the price of the product, this is important information to have.</p><p>Write a query to determine how many products have the <code>year_added</code> value missing. Your output should be a single column, <code>missing_year</code>, with a single row giving the number of missing values.</p><pre><code>-- Write your query for task 1 in this cell
SELECT COUNT(*) AS missing_year
FROM products
WHERE year_added IS NULL;</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l5ov!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l5ov!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 424w, https://substackcdn.com/image/fetch/$s_!l5ov!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 848w, https://substackcdn.com/image/fetch/$s_!l5ov!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 1272w, https://substackcdn.com/image/fetch/$s_!l5ov!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l5ov!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png" width="875" height="144" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:144,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!l5ov!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 424w, https://substackcdn.com/image/fetch/$s_!l5ov!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 848w, https://substackcdn.com/image/fetch/$s_!l5ov!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 1272w, https://substackcdn.com/image/fetch/$s_!l5ov!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1051cc27-52f6-475a-be77-4c3fa1880a24_875x144.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>                                                                      Output: Task 1</p><h2><strong>Task 2</strong></h2><p>Given what you know about the year added data, you need to make sure all of the data is clean before you start your analysis. The table below shows what the data should look like.</p><p>Write a query to ensure the product data matches the description provided. Do not update the original table.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QOnm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QOnm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 424w, https://substackcdn.com/image/fetch/$s_!QOnm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 848w, https://substackcdn.com/image/fetch/$s_!QOnm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 1272w, https://substackcdn.com/image/fetch/$s_!QOnm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QOnm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png" width="875" height="592" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:592,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!QOnm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 424w, https://substackcdn.com/image/fetch/$s_!QOnm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 848w, https://substackcdn.com/image/fetch/$s_!QOnm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 1272w, https://substackcdn.com/image/fetch/$s_!QOnm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7bba0cc-f7ee-42e1-ae84-6957ddff6f37_875x592.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><pre><code>-- Write your query for task 2 in this cell
SELECT
    product_id,
    COALESCE(product_type, &#8216;Unknown&#8217;) AS product_type,
    COALESCE(NULLIF(REPLACE(brand, &#8216;-&#8217;, &#8216;&#8217;), &#8216;&#8217;), &#8216;Unknown&#8217;) AS brand,
    COALESCE(ROUND(CAST(REGEXP_REPLACE(weight, &#8216;[^\d.]&#8217;, &#8216;&#8217;, &#8216;g&#8217;) AS DECIMAL(10, 2)), 2), ROUND((SELECT PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY CAST(REGEXP_REPLACE(weight, &#8216;[^\d.]&#8217;, &#8216;&#8217;, &#8216;g&#8217;) AS DECIMAL(10, 2))) FROM products), 2)) AS weight,

COALESCE(
    TO_CHAR(CAST(price AS DECIMAL(10, 2)), &#8216;9999999999.99&#8217;),
    TO_CHAR(CAST((SELECT PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY price) FROM products) AS DECIMAL(10, 2)), &#8216;9999999999.99&#8217;)
) AS price,

    COALESCE(average_units_sold, 0) AS average_units_sold,
    COALESCE(year_added, 2022) AS year_added,
    COALESCE(UPPER(stock_location), &#8216;Unknown&#8217;) AS stock_location
FROM products;</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8eX6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8eX6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 424w, https://substackcdn.com/image/fetch/$s_!8eX6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 848w, https://substackcdn.com/image/fetch/$s_!8eX6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 1272w, https://substackcdn.com/image/fetch/$s_!8eX6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8eX6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png" width="875" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8eX6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 424w, https://substackcdn.com/image/fetch/$s_!8eX6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 848w, https://substackcdn.com/image/fetch/$s_!8eX6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 1272w, https://substackcdn.com/image/fetch/$s_!8eX6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dd4a0c8-0a9d-473e-84be-1cbd85673b2e_875x560.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>                                                                  Output: Task 2</p><h2><strong>Task 3</strong></h2><p>To find out how the range varies for each product type, your manager has asked you to determine the minimum and maximum values for each product type.</p><p>Write a query to return the <code>product_type</code>, <code>min_price</code> and <code>max_price</code> columns.</p><pre><code>-- Write your query for task 3 in this cell
SELECT product_type,
    MIN(price) AS min_price,
    MAX(price) AS max_price
FROM products 
GROUP BY product_type;</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JI3I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JI3I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 424w, https://substackcdn.com/image/fetch/$s_!JI3I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 848w, https://substackcdn.com/image/fetch/$s_!JI3I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 1272w, https://substackcdn.com/image/fetch/$s_!JI3I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JI3I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png" width="875" height="187" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:187,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!JI3I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 424w, https://substackcdn.com/image/fetch/$s_!JI3I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 848w, https://substackcdn.com/image/fetch/$s_!JI3I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 1272w, https://substackcdn.com/image/fetch/$s_!JI3I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63c20142-8b93-43a5-86fc-b86f45ab6889_875x187.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>                                                                       Output: Task 3</p><h2><strong>Task 4</strong></h2><p>The team want to look in more detail at meat and dairy products where the average units sold was greater than ten.</p><p>Write a query to return the <code>product_id</code>, <code>price</code> and <code>average_units_sold</code> of the rows of interest to the team.</p><pre><code>-- Write your query for task 4 in this cell
SELECT product_id, price, average_units_sold
FROM products 
WHERE product_type IN (&#8217;Meat&#8217;, &#8216;Dairy&#8217;)
     AND average_units_sold &gt; 10;</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xHFF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xHFF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 424w, https://substackcdn.com/image/fetch/$s_!xHFF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 848w, https://substackcdn.com/image/fetch/$s_!xHFF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 1272w, https://substackcdn.com/image/fetch/$s_!xHFF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xHFF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png" width="875" height="472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/edfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:472,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!xHFF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 424w, https://substackcdn.com/image/fetch/$s_!xHFF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 848w, https://substackcdn.com/image/fetch/$s_!xHFF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 1272w, https://substackcdn.com/image/fetch/$s_!xHFF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedfba6ec-fce0-49d7-a115-f51c267e944e_875x472.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>                                                                    Output: Task 4</p>]]></content:encoded></item><item><title><![CDATA[7 Analytics Skills That Make You Interview‑Ready]]></title><description><![CDATA[1.]]></description><link>https://maliniroychoudhury.substack.com/p/7-analytics-skills-that-make-you</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/7-analytics-skills-that-make-you</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Mon, 16 Feb 2026 14:12:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oDwR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>1. <strong>DESCRIPTIVE STATISTICS</strong> &#8212; What happened?</p><p>Mean = average sales </p><p>Median = middle value (outliers ignored) </p><p>Mode = most frequent product </p><p>Range = min &#8594; max Standard deviation = how spread out</p><p>Excel: =AVERAGE(), =MEDIAN(), =STDEV() </p><p>SQL: AVG(), PERCENTILE_CONT() </p><p>Python: df.describe()</p><p>Pro move: Always report median + mean &#8594; shows skew. </p><p>2. <strong>CORRELATION vs CAUSATION</strong> &#8212; Don&#8217;t get this wrong</p><p>Ice cream sales + drownings correlate (r=0.95). But ice cream doesn&#8217;t cause drowning &#8212; summer does.</p><p>Business example: &#8220;Revenue + ad spend correlate 0.87&#8221; </p><p>Check: Did anything else change? Seasonality? Competitors?</p><p>Excel: =CORREL() Python: df.corr() + heatmap</p><p>Interview goal: &#8220;<em>Correlation doesn&#8217;t prove causation. I&#8217;d check confounding variables.</em>&#8221;</p><p>  3. <strong>4 TYPES OF ANALYTICS</strong> &#8212; Different questions, different tools</p><p><strong>Descriptive: </strong>What happened? (Excel/SQL) </p><p>Purpose &#8594; Summarizes what happened in the past event.</p><p>Eg. Monthly sales reports showing total sales made</p><p><strong>Diagnostic</strong>: Why did it happen? (Drill-down)</p><p>Purpose &#8594; To identify reasons/cause behind event</p><p>Eg. Fig. out why sales dropped in Q1</p><p><strong>Predictive</strong>: What will happen? (ML/trends) </p><p>Purpose &#8594; Forecast possible out comes based on past trends</p><p>Eg. Predict next quarter sales using past sales data.</p><p><strong>Prescriptive</strong>: What should we do? (Scenarios)</p><p>Purpose &#8594; Recommends actions to achieve goals.</p><p>Eg. Suggest discounts to boost future sales.</p><p>Daily use: 80% descriptive &#8594; 15% diagnostic &#8594; 5% predictive.</p><p> 4. <strong>DATA QUALITY FRAMEWORK</strong> &#8212; Garbage in = garbage out</p><p>Accuracy: 5000 vs 5000 (format correct?) </p><p>Completeness: 20% missing emails? Problem. </p><p>Consistency: &#8220;Delhi&#8221; vs &#8220;DL&#8221; vs &#8220;delhi&#8221; &#8212; pick one. </p><p>Timeliness: Data from 2024? Useless for 2026. </p><p>Uniqueness: Duplicate customer IDs? Fix it.</p><p>Daily check: df.isna().sum() + df.duplicated().sum()</p><p>Pro habit: Document issues &#8594; fix upstream. </p><p> 5. <strong>KPI &amp; OKR ALIGNMENT</strong> &#8212; Analytics without business goals = wasted</p><p>Wrong: &#8220;Here&#8217;s 20 metrics.&#8221; </p><p>Right: &#8220;CEO wants revenue growth &#8594; I track 3 revenue KPIs.&#8221;</p><p>OKR example: Objective: Grow revenue 20% </p><p>Key Results: Monthly revenue &#8377;52L &#8594; &#8377;62L </p><p>                       New customers 1K &#8594; 1.5K </p><p>                      Avg order value &#8377;2K &#8594; &#8377;2.4K</p><p> 6. <strong>COHORT ANALYSIS</strong> &#8212; Track groups over time</p><p>Jan joiners: Month1 = 1000 orders &#8594; Month3 = 600 (40% retention) </p><p>Feb joiners: Month1 = 1200 &#8594; Month3 = 780 (65% retention)</p><p>Insight: Feb onboarding worked better &#8594; scale it.</p><p>Business gold: Retention &gt; Acquisition.</p><p>Tools: Excel Pivot + date slicers, </p><p>            SQL WHERE join_month, </p><p>            Python groupby([&#8217;cohort&#8217;,&#8217;month&#8217;])</p><p> 7. <strong>HYPOTHESIS TESTING (A/B Testing)</strong> &#8212; Prove your recommendations</p><p>H&#8320; (null): New homepage = same conversion </p><p>H&#8321; (alt): New homepage &gt; old conversion</p><p>Test: 5% traffic gets new design </p><p>Result: p-value &lt; 0.05 &#8594; Reject H&#8320; &#8594; Rollout!</p><p>Business impact: &#8220;&#8377;15L/month uplift.&#8221;</p><p>Tools: Excel T.TEST(), </p><p>            Python scipy.stats.ttest_ind()</p><p>Interview answer: <em>&#8220;Run A/B test, check p&lt;0.05, calculate business impact.&#8221; </em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oDwR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oDwR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!oDwR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!oDwR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!oDwR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oDwR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png" width="724" height="724" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7089179-2658-4274-a901-debfa0fea797_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:724,&quot;bytes&quot;:1262917,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://maliniroychoudhury.substack.com/i/188138816?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oDwR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!oDwR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!oDwR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!oDwR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7089179-2658-4274-a901-debfa0fea797_1024x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>8. <strong>BUSINESS TRANSLATION</strong> &#8212; Speak CEO language</p><p>Technical: &#8220;R&#178;=0.87, p&lt;0.01&#8221; </p><p>CEO:<em> &#8220;Marketing predicts 87% of revenue &#8594; &#8377;5Cr opportunity.&#8221;</em></p><p>Technical: &#8220;Cohort retention 42%&#8221;</p><p>CEO: <em>&#8220;&#8377;12L/month leaking &#8594; Win-back campaign.&#8221;</em></p><p>Numbers mean nothing without context. Translate everything</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item><item><title><![CDATA[SQL Commands: DDL, DML, DCL, TCL, SCL ]]></title><description><![CDATA[Understanding these SQL command types helps you manage data and databases effectively.]]></description><link>https://maliniroychoudhury.substack.com/p/sql-commands-ddl-dml-dcl-tcl-scl</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/sql-commands-ddl-dml-dcl-tcl-scl</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Wed, 04 Feb 2026 14:53:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Understanding these SQL command types helps you manage data and databases effectively.</p><p>1&#65039;&#8419;<strong> DDL &#8211; Data Definition Language  </strong></p><p>Used to define and modify structure of database objects.  </p><p>* <strong>CREATE</strong> &#8211; Create table/schema  </p><p>* <strong>ALTER </strong>&#8211; Modify table structure  </p><p>* <strong>DROP </strong>&#8211; Delete table or database  </p><p>* <strong>TRUNCATE </strong>&#8211; Delete all records (faster, irreversible)  </p><p>* <strong>RENAME </strong>&#8211; Change table name  </p><p>2&#65039;&#8419; <strong>DML &#8211; Data Manipulation Language  </strong></p><p>Used to manipulate data inside tables.  </p><p>* <strong>SELECT </strong>&#8211; Retrieve data  </p><p>* <strong>INSERT </strong>&#8211; Add data  </p><p>* <strong>UPDATE </strong>&#8211; Modify existing data  </p><p>* <strong>DELETE </strong>&#8211; Remove specific rows  </p><p>3&#65039;&#8419; <strong>DCL &#8211; Data Control Language  </strong></p><p>Used to control access to data.  </p><p>* <strong>GRANT </strong>&#8211; Give user privileges  </p><p>* <strong>REVOKE </strong>&#8211; Remove user privileges  </p><p>4&#65039;&#8419; <strong>TCL &#8211; Transaction Control Language  </strong></p><p>Used to manage transactions in a database.  </p><p>* <strong>COMMIT </strong>&#8211; Save changes permanently  </p><p>* <strong>ROLLBACK </strong>&#8211; Undo changes  </p><p>* <strong>SAVEPOINT </strong>&#8211; Set a point to roll back to  </p><p>* <strong>SET TRANSACTION</strong> &#8211; Define properties of a transaction  </p><p>5&#65039;&#8419; <strong>SCL &#8211; Session Control Language  </strong></p><p>Used to manage user sessions.  </p><p>* <strong>ALTER SESSION  </strong></p><p>*<strong> SET ROLE</strong></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item><item><title><![CDATA[The Most Common SQL Bug with LEFT JOINs]]></title><description><![CDATA[The biggest risk after a LEFT JOIN?]]></description><link>https://maliniroychoudhury.substack.com/p/the-most-common-sql-bug-with-left</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/the-most-common-sql-bug-with-left</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Fri, 30 Jan 2026 16:14:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The biggest risk after a LEFT JOIN?<br><br><br>&#128073; Putting a WHERE condition on the right table.<br><br>This turns your LEFT JOIN into an INNER JOIN, and most people don't even notice.<br><br>Example:<br>SELECT *<br>FROM customers c<br>LEFT JOIN orders o<br> ON <strong><a href="http://c.id/">c.id</a></strong> = o.customer_id<br>WHERE o.order_date &gt; '2024-01-01';<br><br>&#129300; This looks like a LEFT JOIN&#8230;<br>but that WHERE o.order_date removes all customers with no orders, killing the purpose of the left join.<br><br>&#9989; Fix: Move the filter into the JOIN condition:<br>LEFT JOIN orders o<br> ON <strong><a href="http://c.id/">c.id</a></strong> = o.customer_id<br> AND o.order_date &gt; '2024-01-01';<br><br>This is one of the most common SQL bugs. Have you seen this happen in production? &#128516;</p>]]></content:encoded></item><item><title><![CDATA[Limit vs Offset in SQL interview]]></title><description><![CDATA[Discuss about what is Limit and Offset in SQL, difference between them and when to use, SQL Queries]]></description><link>https://maliniroychoudhury.substack.com/p/limit-vs-offset-in-sql-interview</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/limit-vs-offset-in-sql-interview</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Tue, 27 Jan 2026 18:10:43 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/185989523/88bb334f393658725bf08ad34ef8cd43.mp3" length="0" type="audio/mpeg"/><content:encoded><![CDATA[<p>Hey folks! If you&#8217;re prepping for SQL interviews, there&#8217;s one pair of keywords you must understand &#8212; LIMIT and OFFSET. They&#8217;re simple, but interviewers love to test your clarity on them. So in this video, I&#8217;ll show you what they mean, how to use them, and how to answer interview questions like a pro.&#8221;</p><p>Here are a few ways interviewers might ask about LIMIT and OFFSET:</p><p>- &#8216;What&#8217;s the difference between LIMIT and OFFSET?&#8217;</p><p>- &#8216;How do you fetch the 11th to 20th rows from a table?&#8217;</p>]]></content:encoded></item><item><title><![CDATA[30 Days of SQL: Day 1: Databases, DBMS, and SQL vs NoSQL Explained Simply]]></title><description><![CDATA[SQL is one of the most essential skills for data analysts, data scientists, and anyone working with data.]]></description><link>https://maliniroychoudhury.substack.com/p/30-days-of-sql-day-1-databases-dbms</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/30-days-of-sql-day-1-databases-dbms</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Sat, 03 Jan 2026 17:49:46 GMT</pubDate><enclosure url="https://api.substack.com/feed/podcast/183363702/b34509436182d75f4374e3f522c5f7b7.mp3" length="0" type="audio/mpeg"/><content:encoded><![CDATA[<p>SQL is one of the most essential skills for data analysts, data scientists, and anyone working with data.</p><p>In <strong>Day 1 of the 30 Days of SQL series</strong>, we cover the absolute foundations:</p><ul><li><p>What is data and what is a database?</p></li><li><p>What is a Database Management System (DBMS)?</p></li><li><p>Popular database tools you should know</p></li><li><p>SQL vs NoSQL &#8212; explained with real-world examples</p></li></ul><p>This series is designed for <strong>beginners to intermediate learners</strong> who want to build strong fundamentals and become job-ready using practical, real-world explanations.</p><p>Subscribe to follow the full <strong>30-day SQL roadmap</strong>, with daily lessons, queries, and projects.</p>]]></content:encoded></item><item><title><![CDATA[How SUM and SUMX behave differently when used in calculated columns vs measures]]></title><description><![CDATA[This is one of the most common interview topics in Power BI.]]></description><link>https://maliniroychoudhury.substack.com/p/sum-vs-sumx-in-power-bi-when-to-use</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/sum-vs-sumx-in-power-bi-when-to-use</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Thu, 01 Jan 2026 15:34:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is one of the most common interview topics in Power BI.</p><p><strong>SUM </strong>is a <strong>simple aggregation function</strong><em>.</em> It adds up all the values in a single numeric column.</p><ul><li><p><strong>Syntax: </strong>SUM(Table[Column])</p></li><li><p><strong>Use Case: </strong>when you already have a column with numeric values you want to total.</p></li><li><p><strong>Example </strong>: <code>Total_Sales = SUM(SalesData[Sales])</code></p></li><li><p>Adds all values in the <strong>Sales</strong> column directly</p></li><li><p><strong>Performance:</strong><br>Very fast and efficient because it works directly on the column.</p></li></ul><p><strong>SUMX </strong>is an <strong>iterator function</strong>. It goes row by row, evaluates an expression for each row, and then sums the results.</p><ul><li><p><strong>Syntax: </strong>SUMX(Table, Expression)</p></li><li><p><strong>Use Case:</strong> when you need to calculate something for each row before summing.</p></li><li><p><strong>Example</strong>: <code>Total_Sales2 = SUMX(SalesData, SalesData[Quantity] * SalesData[Unit Price])</code></p></li><li><p>Multiplies <strong>Quantity &#215; Unit Price</strong> for each row, then adds them up.</p></li><li><p><strong>Performance: </strong>Slower than <code>SUM</code> for large datasets because it iterates row by row, but essential when you don&#8217;t have a pre&#8209;calculated column.</p></li></ul><p>&#128073; Interview Tip: If asked, you can say:</p><ul><li><p><em>&#8220;SUM is for direct column totals, SUMX is for row&#8209;by&#8209;row calculations before summing. SUM is faster, SUMX is more flexible.&#8221;</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><p>Interviewers often test whether you understand <em><strong>how SUM and SUMX behave differently when used in calculated columns vs measures</strong></em>. </p><p></p><p><strong>Calculated Columns</strong></p><ul><li><p><strong>Definition:</strong> A calculated column is created at the row level. Each row gets a value when the data is loaded or refreshed, and it&#8217;s stored in the model.</p></li><li><p><strong>SUM in Calculated Column:</strong><br>You normally don&#8217;t use <code>SUM</code> directly in a calculated column, because <code>SUM</code> is an aggregation across rows. Calculated columns work in <strong>row context</strong>, so you&#8217;d typically use arithmetic like: </p><p><code>SalesData[LineTotal] = SalesData[Quantity] * SalesData[Unit Price]</code></p></li><li><p>&#128073; This creates a new column with row&#8209;by&#8209;row totals.</p></li><li><p><strong>SUMX in Calculated Column:</strong><br>Rarely used here, because <code>SUMX</code> is also an iterator across a table. In a calculated column, you already have row context, so you don&#8217;t need to iterate again.</p></li></ul><p><strong>Measures</strong></p><ul><li><p><strong>Definition:</strong> A measure is calculated dynamically at query time, based on filter context. It&#8217;s not stored in the model.</p></li><li><p><strong>SUM in Measure: </strong><code>Total_Sales = SUM(SalesData[Sales])</code></p></li><li><p>&#128073; Adds up all values in the <strong>Sales</strong> column, recalculated depending on filters (e.g., by region, by product).</p></li><li><p><strong>SUMX in Measure:</strong></p></li></ul><p><code>Total_Sales2 = SUMX(SalesData, SalesData[Quantity] * SalesData[Unit Price])</code></p><ul><li><p>&#128073; Evaluates row by row, then sums. Useful when you don&#8217;t have a pre&#8209;calculated &#8220;Sales&#8221; column, or when you need conditional logic.</p></li></ul><h4>Key Difference in Context</h4><ul><li><p><strong>Calculated Column:</strong></p><ul><li><p>Works at row level.</p></li><li><p>Good for creating new fields (e.g., <code>LineTotal = Quantity &#215; Price</code>).</p></li><li><p>Stored in the model, increases size.</p></li></ul></li><li><p><strong>Measure:</strong></p><ul><li><p>Works at report level.</p></li><li><p>Good for aggregations (<code>SUM</code>, <code>SUMX</code>) that change dynamically with filters.</p></li><li><p>Not stored, recalculated on the fly.</p></li></ul></li></ul><div><hr></div><p>Interview&#8209;Ready Answer</p><p>&#128073; <em>&#8220;Calculated columns are row&#8209;based and stored in the model, while measures are dynamic and context&#8209;based. SUM is used in measures when you want to total an existing column, while SUMX is used in measures when you need to calculate row&#8209;by&#8209;row expressions before summing. In calculated columns, you usually just use arithmetic, because row context is already present.&#8221;</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/p/sum-vs-sumx-in-power-bi-when-to-use/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/p/sum-vs-sumx-in-power-bi-when-to-use/comments"><span>Leave a comment</span></a></p><p><br></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Mastering SQL Query Structure: How to Ace SQL Interview Questions]]></title><description><![CDATA[The Logical Order of SQL Statements]]></description><link>https://maliniroychoudhury.substack.com/p/mastering-sql-query-structure-how</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/mastering-sql-query-structure-how</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Tue, 23 Dec 2025 19:05:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>The Logical Order of SQL Statements</h4><p>Even though we <em>write</em> SQL in a certain order, the database engine <em>executes</em> it differently. Here&#8217;s the logical flow you should always keep in mind:</p><ol><li><p><strong>FROM</strong> &#8594; Identify the table(s) you&#8217;re working with.</p></li><li><p><strong>WHERE</strong> &#8594; Filter raw rows before grouping.</p></li><li><p><strong>GROUP BY</strong> &#8594; Group rows with the same values for aggregation.</p></li><li><p><strong>HAVING</strong> &#8594; Filter groups after aggregation.</p></li><li><p><strong>SELECT</strong> &#8594; Choose the columns to display.</p></li><li><p><strong>ORDER BY</strong> &#8594; Sort results in ascending or descending order.</p></li><li><p><strong>LIMIT</strong> &#8594; Control how many rows are returned.</p></li></ol><p>&#128073; <strong>Tip for interviews:</strong> Always explain <em>why</em> you&#8217;re using <code>WHERE</code> vs. <code>HAVING</code>. For example:</p><ul><li><p>Use <code>WHERE</code> when filtering raw data (<code>customer_id &gt; 100</code>).</p></li><li><p>Use <code>HAVING</code> when filtering aggregated results (<code>COUNT(*) &gt; 1</code>)</p></li></ul><p><strong>Joins</strong>: A join is used to combine rows from two or more tables based on a related column.</p><p>Joins are a favorite interview topic because they test your ability to combine data across tables.</p><ul><li><p><strong>INNER JOIN</strong> &#8594; Returns rows with matching values in both tables</p></li><li><p><strong>LEFT JOIN</strong> &#8594; Returns all rows from the left table, plus matches from the right.</p></li><li><p><strong>RIGHT JOIN</strong> &#8594; Opposite of LEFT JOIN.</p></li><li><p><strong>FULL OUTER JOIN</strong> &#8594; returns all rows from one table and matched rows from the other.</p></li></ul><p><strong>CASE </strong>Statement: Conditional Logic in SQL</p><p>The <code>CASE</code> statement lets you create new columns based on existing ones. This is often used in reporting or categorization tasks.</p><p>Example: Categorize employees by salary range.</p><pre><code>SELECT Name, 
       CASE 
       WHEN Salary &gt; 100000 THEN &#8216;High&#8217; 
       WHEN Salary BETWEEN 50000 AND 100000 THEN &#8216;Medium&#8217; 
       ELSE &#8216;Low&#8217; 
   END AS SalaryCategory 
FROM Employees;</code></pre><p>&#128073; <strong>Tip for interviews:</strong> Use <code>CASE</code> to show you can transform raw data into business-friendly insights.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p><p><strong>Index </strong>: An <strong>index</strong> is a database object that acts like a <strong>lookup table</strong> for faster data retrieval. Think of it like the index in a book: instead of scanning every page, you jump directly to the right section.</p><p><strong>Types of Indexes</strong></p><ul><li><p><strong>Unique Index</strong> &#8594; Ensures all values in a column are distinct.</p></li><li><p><strong>Composite Index</strong> &#8594; Built on multiple columns, useful for queries filtering by more than one field.</p></li><li><p><strong>Full-Text Index</strong> &#8594; Optimized for searching text data (e.g., keywords in articles).</p></li><li><p><strong>Clustered Index</strong> &#8594; Determines the physical order of data in a table. Only one per table.</p></li><li><p><strong>Non-Clustered Index</strong> &#8594; Creates a separate structure pointing to the data. Multiple allowed per table.</p></li></ul><p> <strong>How Indexing Improves Performance</strong></p><ul><li><p>Indexes create <strong>quick access paths</strong> to data.</p></li><li><p>Instead of scanning the entire table (full table scan), the database engine uses the index to jump directly to relevant rows.</p></li><li><p>This reduces query execution time, especially for large datasets.</p></li></ul><p><strong>Pros and Cons of Indexing</strong></p><ul><li><p><strong>Pros:</strong></p><ul><li><p>Faster data retrieval.</p></li><li><p>Efficient filtering, sorting, and joins.</p></li><li><p>Essential for performance in large tables.</p></li></ul></li><li><p><strong>Cons:</strong></p></li></ul><ul><li><p>Slows down data modification (INSERT, UPDATE, DELETE) because indexes must be updated too.</p></li><li><p>Requires extra storage space.</p></li><li><p>Poorly chosen indexes can hurt performance instead of helping.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/p/mastering-sql-query-structure-how?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/p/mastering-sql-query-structure-how?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></li></ul><h3><strong>Most Common Interview Questions and its response :</strong></h3><p>What is SQL and it is use for ?</p><p><em>- SQL (Structured Query Language) is a standard programming language for managing and manipulating relational databases. </em></p><p><em>Main uses: </em></p><p><em>Store structure data; Retrieve exactly what you need like filter, sort, join tables; Update or delete data, generate reports, analytics, insights for business decision; Power web apps: backend systems</em></p><p>What is an index?</p><p>-<em> An index is a database object that improves the speed of data retrieval operations on a database table.</em></p><p>What are the different types of indexes?</p><p>- <em>Types of indexes include unique indexes, composite indexes, full-text indexes, and clustered and non-clustered indexes.</em></p><p>What is a clustered index?</p><p>- <em>A clustered index determines the physical order of data in a table; there can be only one clustered index per table</em>.</p><p>What is a non-clustered index?</p><p>- <em>A non-clustered index does not alter the physical order of the table and can have multiple instances in a table</em>.</p><p>What is indexing and how does it improve query performance? </p><p>- <em>Indexing creates a data structure that improves the speed of data retrieval operations by providing quick access paths.</em> </p><p>What are the pros and cons of indexing? </p><p>- <em>Pros: Faster data retrieval. Cons: Slower data modification (insert/update/delete) and increased storage requirements.</em></p><p>What is the difference between DELETE and TRUNCATE and DROP</p><p>- <em>DELETE removes specific rows one at a time based on condition and can be rolled back, also slower as it logs each deletion; TRUNCATE removes all rows in a table without logging individual row deletions and faster than DELETE  but usually cant be rolled back; DROP deletes an entire table, index or database object and it permanent , cant be rollback.</em></p><p>What is the difference between WHERE and HAVING clauses? </p><p>- <em>WHERE is used to filter records before aggregation, while HAVING is used to filter records after aggregation.</em></p><p>What is the difference between ROLLBACK and COMMIT?</p><p>- <em>ROLLBACK undoes changes made in the current transaction, while COMMIT saves all changes made during the transaction.</em></p><p>What is the difference between RANK() and DENSE_RANK()?</p><p>-<em> RANK() provides a rank number with gaps for ties, while DENSE_RANK() provides consecutive rank numbers without gaps.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/p/mastering-sql-query-structure-how/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/p/mastering-sql-query-structure-how/comments"><span>Leave a comment</span></a></p><h4>How to Respond in an Interview</h4><ol><li><p><strong>Start with logic order:</strong> Explain the steps (FROM &#8594; WHERE &#8594; GROUP BY &#8594; HAVING &#8594; SELECT &#8594; ORDER BY &#8594; LIMIT).</p></li><li><p><strong>Clarify intent:</strong> State whether you&#8217;re filtering raw rows or aggregated results.</p></li><li><p><strong>Write clean SQL:</strong> Use aliases, indentation, and comments.</p></li><li><p><strong>Connect to business impact:</strong> Show how the query solves a real-world problem (e.g., finding duplicates saves storage, identifying top salaries helps HR).</p></li><li><p><strong>Stay calm under pressure:</strong> Even if you don&#8217;t recall exact syntax, explain the logic clearly&#8212;that&#8217;s what interviewers value most.</p><div class="directMessage button" data-attrs="{&quot;userId&quot;:223762248,&quot;userName&quot;:&quot;Malini RoyChoudhury&quot;,&quot;canDm&quot;:null,&quot;dmUpgradeOptions&quot;:null,&quot;isEditorNode&quot;:true}" data-component-name="DirectMessageToDOM"></div><p></p></li></ol>]]></content:encoded></item><item><title><![CDATA[Coming soon]]></title><description><![CDATA[This is Malini&#39;s Substack.]]></description><link>https://maliniroychoudhury.substack.com/p/coming-soon</link><guid isPermaLink="false">https://maliniroychoudhury.substack.com/p/coming-soon</guid><dc:creator><![CDATA[Malini RoyChoudhury]]></dc:creator><pubDate>Thu, 20 Nov 2025 06:18:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ycnt!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7959c675-5ea3-4077-ac9c-7b04f94ff64a_96x96.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is Malini&#39;s Substack.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://maliniroychoudhury.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://maliniroychoudhury.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item></channel></rss>