<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tinkerbell on Medium]]></title>
        <description><![CDATA[Stories by Tinkerbell on Medium]]></description>
        <link>https://medium.com/@tinkerrebell?source=rss-3f07d9bef95d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ge7lkpBaK0zwn-KtGE_bOQ.jpeg</url>
            <title>Stories by Tinkerbell on Medium</title>
            <link>https://medium.com/@tinkerrebell?source=rss-3f07d9bef95d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 18:46:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tinkerrebell/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mastering JavaScript: A Comprehensive Guide to Interview Questions (PART-1)]]></title>
            <link>https://medium.com/@tinkerrebell/mastering-javascript-a-comprehensive-guide-to-interview-questions-part-1-774b9025271f?source=rss-3f07d9bef95d------2</link>
            <guid isPermaLink="false">https://medium.com/p/774b9025271f</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[questions]]></category>
            <dc:creator><![CDATA[Tinkerbell]]></dc:creator>
            <pubDate>Sun, 17 Dec 2023 16:39:40 GMT</pubDate>
            <atom:updated>2023-12-17T16:39:40.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BiDT69DHW4RlEgSi.png" /></figure><p>Are you gearing up for a JavaScript interview and feeling a bit overwhelmed by the multitude of concepts you might be asked about? Fear not! In this blog post, we’ll cover a wide array of JavaScript interview questions, complete with explanations and examples to help you navigate the intricacies of the language.</p><blockquote><strong><em>💡 Hoisting:</em></strong><em><br>Hoisting is a JavaScript behavior where variable and function declarations are moved to the top of their containing scope during the compilation phase. It’s important to note that only declarations are hoisted, not initializations.</em></blockquote><pre>console.log(x); // Output: undefined<br>var x = 5;<br>console.log(x); // Output: 5<br><br>// The above code is interpreted as:<br>// var x;<br>// console.log(x); // undefined<br>// x = 5;<br>// console.log(x); // 5</pre><blockquote><strong><em>💡 Spread Operator:<br></em></strong><em>The spread operator (</em><em>...) is used for expanding elements. It can be employed in various scenarios, like copying an array or object, and combining arrays.</em></blockquote><pre>const array1 = [1, 2, 3];<br>const array2 = [...array1, 4, 5];<br>console.log(array2); // [1, 2, 3, 4, 5]</pre><blockquote><strong><em>💡 Callback Function:<br></em></strong><em>A callback function is a function passed as an argument to another function, to be executed later.</em></blockquote><pre>// Function that takes two numbers and a callback to perform an operation<br>function calculate(a, b, callback) {<br>  const result = callback(a, b);<br>  console.log(&quot;Result:&quot;, result);<br>}<br><br>// Callback function to add two numbers<br>function add(x, y) {<br>  return x + y;<br>}<br><br>// Using the calculate function with the add callback<br>calculate(3, 4, add); // Output: Result: 7</pre><blockquote><strong><em>💡 Promises:<br></em></strong><em>Promises are a way to handle asynchronous operations in a more structured and readable manner.</em></blockquote><pre>// Example: Simulating an asynchronous operation with a Promise<br><br>// Function that returns a Promise<br>function simulateAsyncOperation(success) {<br>  return new Promise((resolve, reject) =&gt; {<br>    // Simulating an asynchronous operation (e.g., fetching data)<br>    setTimeout(() =&gt; {<br>      if (success) {<br>        resolve(&quot;Operation completed successfully!&quot;);<br>      } else {<br>        reject(&quot;Operation failed!&quot;);<br>      }<br>    }, 1000); // Simulating a 1-second delay<br>  });<br>}<br><br>// Using the Promise<br>simulateAsyncOperation(true)<br>  .then((result) =&gt; {<br>    console.log(result);<br>  })<br>  .catch((error) =&gt; {<br>    console.error(error);<br>  });</pre><p>. The simulateAsyncOperation function returns a new Promise. The promise takes a function with two parameters: resolve and reject.</p><p>. Inside the Promise, we simulate an asynchronous operation with setTimeout. After the delay, if the operation is successful (success is true), we call resolve with a success message. Otherwise, we call reject with an error message.</p><p>. We use the Promise by calling simulateAsyncOperation(true). The then method is used to handle the successful completion of the Promise, and the catch method is used to handle errors.</p><blockquote><strong><em>💡 States of Promise:</em></strong></blockquote><blockquote><strong><em>1. Pending</em></strong></blockquote><blockquote><em>This is the initial state of a Promise. The Promise is in a pending state when it is created, and it remains in this state while the asynchronous operation is being carried out. The </em><em>then and </em><em>catch handlers can be attached to a pending Promise to execute code when the Promise is fulfilled or rejected.</em></blockquote><pre>const pendingPromise = new Promise((resolve, reject) =&gt; {<br>  // Asynchronous operation in progress<br>});</pre><blockquote><strong><em>2. Fulfilled:</em></strong></blockquote><blockquote><em>The Promise transitions to the fulfilled state when the asynchronous operation is completed successfully. If the operation is successful, the </em><em>resolve function is called, and the Promise becomes fulfilled. The </em><em>then handler is then executed, receiving the resolved value as its argument.</em></blockquote><pre>const fulfilledPromise = new Promise((resolve, reject) =&gt; {<br>  // Asynchronous operation completed successfully<br>  resolve(&quot;Operation completed successfully!&quot;);<br>});<br><br>fulfilledPromise.then((result) =&gt; {<br>  console.log(result); // Output: Operation completed successfully!<br>});</pre><blockquote><strong><em>3. Rejected:</em></strong></blockquote><blockquote><em>The Promise transitions to the rejected state if the asynchronous operation encounters an error or is unsuccessful. If the operation fails, the </em><em>reject function is called, and the Promise becomes rejected. The </em><em>catch handler is then executed, receiving the reason for the rejection as its argument.</em></blockquote><pre>const rejectedPromise = new Promise((resolve, reject) =&gt; {<br>  // Asynchronous operation encounters an error<br>  reject(&quot;Operation failed!&quot;);<br>});<br><br>rejectedPromise.catch((error) =&gt; {<br>  console.error(error); // Output: Operation failed!<br>});</pre><blockquote><strong><em>4. Settled:</em></strong></blockquote><blockquote><em>The term “settled” is not an official state but is often used to describe a Promise that is either fulfilled or rejected. Once a Promise transitions to either of these states, it is considered settled. The </em><em>finally handler can be attached to execute code after the Promise is settled, regardless of whether it is fulfilled or rejected.</em></blockquote><pre>const settledPromise = new Promise((resolve, reject) =&gt; {<br>  // Asynchronous operation either succeeds or fails<br>});<br><br>settledPromise<br>  .then((result) =&gt; {<br>    console.log(result);<br>  })<br>  .catch((error) =&gt; {<br>    console.error(error);<br>  })<br>  .finally(() =&gt; {<br>    console.log(&quot;Promise is settled!&quot;);<br>  });</pre><blockquote><strong><em>💡 Closures:</em></strong><em><br>A closure is a function that has access to variables from its outer (enclosing) function, even after the outer function has finished execution.</em></blockquote><pre>function outerFunction() {<br>  const outerVar = &quot;I&#39;m outer!&quot;;<br>  function innerFunction() {<br>    console.log(outerVar);<br>  }<br>  return innerFunction;<br>}<br><br>const closureExample = outerFunction();<br>closureExample(); // &quot;I&#39;m outer!&quot;</pre><blockquote><strong><em>💡 Promise.all &amp; Promise.race:</em></strong><em><br></em>Promise.all<em> is used when you want to wait for all promises to be fulfilled, while </em>Promise.race<em> is used when you only need the result of the first fulfilled promise.</em></blockquote><pre>const promise1 = new Promise(resolve =&gt; setTimeout(() =&gt; resolve(&#39;One&#39;), 1000));<br>const promise2 = new Promise(resolve =&gt; setTimeout(() =&gt; resolve(&#39;Two&#39;), 500));<br><br>Promise.all([promise1, promise2])<br>  .then(values =&gt; console.log(values)); // [&#39;One&#39;, &#39;Two&#39;]<br><br>Promise.race([promise1, promise2])<br>  .then(value =&gt; console.log(value)); // &#39;Two&#39;</pre><blockquote><strong><em>💡 Async/Await:</em></strong><em><br></em>async/await<em> is a syntax feature in JavaScript that simplifies working with Promises, making asynchronous code look and behave more like synchronous code. <br>The </em>async<em> keyword is used to define a function as asynchronous. An asynchronous function returns a Promise implicitly, allowing the use of </em>await<em> within the function. <br>The </em>await<em> keyword is used inside an asynchronous function to wait for a Promise to resolve. It can only be used inside an </em>async<em> function. The </em>await<em> expression pauses the execution of the function until the Promise is resolved, and then it returns the resolved value.</em></blockquote><pre>// Function that returns a Promise<br>function simulateAsyncOperation(success) {<br>  return new Promise((resolve, reject) =&gt; {<br>    setTimeout(() =&gt; {<br>      if (success) {<br>        resolve(&quot;Operation completed successfully!&quot;);<br>      } else {<br>        reject(&quot;Operation failed!&quot;);<br>      }<br>    }, 1000);<br>  });<br>}<br><br>// Asynchronous function using async/await<br>async function executeAsyncOperation() {<br>  try {<br>    console.log(&quot;Start of the operation.&quot;);<br><br>    // Using await to handle the Promise result<br>    const result = await simulateAsyncOperation(true);<br><br>    console.log(result);<br>    console.log(&quot;End of the operation.&quot;);<br>  } catch (error) {<br>    console.error(error);<br>  }<br>}<br><br>// Calling the async function<br>executeAsyncOperation();</pre><blockquote><strong><em>💡 Memoization</em></strong><em>:<br>Memoization is an optimization technique that involves caching the results of expensive function calls and returning the cached result when the same inputs occur again. This can significantly improve the performance of a function, especially if it is called with the same arguments multiple times.</em></blockquote><blockquote><strong><em>💡 Currying</em></strong><em>:<br>Currying is a technique in functional programming where a function is transformed into a sequence of functions, each taking a single argument. The result of each function is another function that takes the next argument in the sequence until all arguments have been supplied, and the final result is returned. In JavaScript, you can implement currying using closures.</em></blockquote><pre>// Non-curried function<br>function add(x, y, z) {<br>  return x + y + z;<br>}<br><br>console.log(add(2, 3, 4)); // Output: 9<br><br>// Curried version of the same function<br>function curryAdd(x) {<br>  return function(y) {<br>    return function(z) {<br>      return x + y + z;<br>    };<br>  };<br>}<br><br>// Usage of the curried function<br>const curriedAdd = curryAdd(2);<br>const result = curriedAdd(3)(4);<br><br>console.log(result); // Output: 9</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=774b9025271f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revitalizing Retail: Axon’s Success Unleashed by Power BI Insights ]]></title>
            <link>https://medium.com/@tinkerrebell/revitalizing-retail-axons-success-unleashed-by-power-bi-insights-6866b9cd54e1?source=rss-3f07d9bef95d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6866b9cd54e1</guid>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[power-bi-desktop]]></category>
            <category><![CDATA[sales-dashboard]]></category>
            <category><![CDATA[power-bi-tutorials]]></category>
            <dc:creator><![CDATA[Tinkerbell]]></dc:creator>
            <pubDate>Mon, 06 Nov 2023 12:23:13 GMT</pubDate>
            <atom:updated>2023-11-06T12:24:51.306Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fcueNxVJdjJP69NC.png" /></figure><p>In the realm of retail, data is the currency that fuels success. Small retailers, like Axon, specializing in classic car sales, are no exception. Understanding and harnessing the power of their sales data is crucial for informed decision-making and strategic growth. This blog post delves into the journey of creating a Business Intelligence (BI) solution for Axon using Microsoft Power BI and SQL, and uncovers the intriguing story behind their retail success.</p><p><strong>🔴 Challenge:</strong></p><p>Axon, a classic car retailer, faced several key challenges that are common in the retail industry:</p><ol><li><strong>Data Fragmentation:</strong> Sales data was scattered across multiple sources, making it challenging to consolidate and analyze effectively.</li><li><strong>Data Insights:</strong> The sales team grappled with deriving meaningful insights from the fragmented data, hindering their decision-making process.</li><li><strong>Real-time Data:</strong> The absence of real-time, accurate sales reports made it difficult for the management to make data-driven decisions.</li></ol><p><strong>💡 Solution:</strong></p><p>To overcome these hurdles, Axon decided to implement a robust BI solution that could:</p><p><strong>▶️ Import and Integrate Data:</strong> Data was extracted from their MySQL database and integrated into Power BI, creating a centralized data repository.</p><p><strong>▶️ Data Cleansing:</strong> The data underwent rigorous cleansing and transformation, addressing issues such as duplicates, missing values, and data consistency.</p><p><strong>▶️ Interactive Dashboards:</strong> With the help of Power BI, interactive dashboards and reports were crafted, providing the sales team and management with visualized data. DAX functions were used to analyze the data efficiently.</p><p><strong>▶️ Advanced Analytics:</strong> SQL queries were leveraged to extract advanced insights and improve sales strategies.</p><p><strong>▶️ Real-time Access: </strong>The BI solution offered real-time access to dashboards and reports, empowering data-driven decision-making.</p><p><strong>🌟 Implementation:</strong></p><p>The project followed a well-structured approach:</p><p>1. <strong>Database Setup:</strong> A MySQL database was created, and the provided data was loaded into it.</p><p>2.<strong> Data Transformation:</strong> The data was cleansed and transformed. Duplicates were eliminated, missing values were handled, and data consistency was ensured.</p><p>3. <strong>Power BI Integration:</strong> Power BI was utilized to import and integrate data from the MySQL database. This created a robust foundation for data analysis.</p><p>4. <strong>Dashboard Design:</strong> Interactive dashboards and reports were developed in Power BI. Charts, graphs, and tables were carefully designed to visualize data effectively. DAX functions were employed for in-depth analysis.</p><p>5. <strong>Advanced Analytics: </strong>SQL queries came into play to perform advanced analytics. This included identifying top-performing products and analyzing regional sales data.</p><p>6.<strong> Deployment: </strong>The final step involved deploying the BI solution, including the interactive dashboards and reports, to the sales team and management.</p><p>📊 <strong>Dashboard:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGZvsAVRbYhNubWDxHKZrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1FRkIv5NlhW73nidF99kQ.png" /></figure><p><strong>📈 Key Insights:</strong></p><p>The implemented BI solution provided a treasure trove of insights:</p><p><strong><em>▶️ Customer Base:</em></strong> A total of 98 customers shopped at Axon’s retail store.</p><p><strong><em>▶️ Order Volume:</em></strong> The retail store processed an impressive 3.23 million items in orders.</p><p><strong><em>▶️ Total Sales:</em></strong> The company achieved an outstanding total sales figure of $9.60 million.</p><p><strong><em>▶️ Average Transaction:</em></strong><em> </em>The average order value is $27.16k, with an average price per item of $2.58.</p><p><strong><em>▶️ Sales Peak:</em></strong> In November 2004, the retail store recorded the highest number of orders.</p><p><strong><em>▶️ Profitable Year:</em></strong> The year 2004 stood out as the most profitable year, surpassing both 2003 and 2005.</p><p><strong><em>▶️ Leading Market:</em></strong> The “USA” leads in both sales and profit, followed by “France” and “Spain.”</p><p><strong><em>▶️ Credit Limits:</em></strong> “USA” also boasts the highest credit limit, followed by “France” and “Spain.”</p><p><strong><em>▶️ Popular Product Lines:</em></strong> “Classic Cars” is the most frequently ordered product line, followed by “Vintage Cars” and “Motorcycles.”</p><p><strong><em>▶️ Top Vendors:</em></strong> “Unimax Art Galleries” is the top-performing vendor, followed by “Classic Metal Creations” and “Second Gear Diecast.”</p><p><strong><em>▶️ Best-Selling Product:</em></strong> “1992 Ferrari 360 Spider Red” is the top seller, followed by “2001 Ferrari Enzo.”</p><p><strong><em>▶️ Key Customers:</em></strong> “Euro Shipping Channel” has the highest number of orders, followed by “Mini Gifts Distributors Ltd” and “Australian Collections Co.”</p><p><strong>📌 Suggestions for Enhancing Sales:</strong></p><ul><li><strong><em>Market Expansion:</em></strong> Explore opportunities to expand into more European markets, taking inspiration from the success in Germany.</li><li><strong><em>Product Line Growth:</em></strong> Invest in the growth of “Classic Cars” and “Vintage Cars” product lines by introducing new models, variations, and accessories.</li><li><strong><em>Highlight Best-Sellers:</em></strong> Emphasize top-selling products like “1992 Ferrari 360 Spider Red” and “2001 Ferrari Enzo” to boost sales.</li><li><strong><em>Focus on the USA:</em></strong> Prioritize the USA market, which accounts for a significant 34.38% of total sales.</li><li><strong><em>Employee Recognition:</em></strong> Implement an employee recognition program to acknowledge outstanding performance.</li><li><strong><em>Customer Engagement:</em></strong> Enhance customer engagement, especially in the USA and European markets, to build loyalty and increase sales.</li><li><strong><em>Introduce New Products:</em></strong> Introduce new products aligned with customer preferences and market demands.</li><li><strong><em>Vendor Partnerships:</em></strong> Strengthen partnerships with key vendors like “Unimax Art Galleries,” “Classic Metal Creations,” and “Second Gear Diecast” to ensure a steady supply of top-quality products.</li></ul><p><strong>🕵️‍♀️ Conclusion:</strong></p><p>The implementation of the BI solution empowered Axon to efficiently manage and analyze their sales data, revealing invaluable insights. These insights have enhanced their decision-making process, enabling them to optimize inventory, focus on top-performing products, and identify growth opportunities. The journey of Axon serves as a compelling illustration of how BI solutions can provide a competitive edge, regardless of the business’s scale. 📈</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6866b9cd54e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Life-Changing Books for Motivation and Personal Growth]]></title>
            <link>https://medium.com/@tinkerrebell/5-life-changing-books-for-motivation-and-personal-growth-95e4d5459097?source=rss-3f07d9bef95d------2</link>
            <guid isPermaLink="false">https://medium.com/p/95e4d5459097</guid>
            <category><![CDATA[books]]></category>
            <category><![CDATA[motivational-books]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[personal-growth]]></category>
            <dc:creator><![CDATA[Tinkerbell]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 13:14:44 GMT</pubDate>
            <atom:updated>2023-10-29T13:14:44.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6t9OfQbvglMa6EfP55Og2Q.jpeg" /></figure><p>In the journey of life, there are moments when we all seek inspiration, motivation, and guidance to bring about positive changes. Books have been a timeless source of wisdom and motivation, and the following list compiles five exceptional titles that have the power to transform your life. From The Monk Who Sold His Ferrari by Robin Sharma to The Alchemist by Paulo Coelho, these books offer valuable insights and practical advice to help you on your path of personal growth and self-discovery.</p><p><strong>📚 The Monk Who Sold His Ferrari by Robin Sharma:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*jwAxX4ZoLxAo63OzoFcxIw.jpeg" /></figure><p>Robin Sharma’s “The Monk Who Sold His Ferrari” is a modern classic in the realm of self-help and motivation. This inspirational tale revolves around the transformation of a high-powered lawyer who abandons his lavish lifestyle in search of spiritual and emotional fulfillment. Sharma imparts timeless wisdom through the character’s journey, encouraging readers to seek purpose, balance, and inner peace in their own lives. This book serves as a guide to reevaluating your priorities and making the most of the time you have.</p><p><strong>📚 The Compound Effect by Darren Hardy:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*NHxeIxyVfgCP-sZIFwlAEQ.jpeg" /></figure><p>In “The Compound Effect,” Darren Hardy delves into the power of small, consistent actions and their ability to bring about significant life changes. By illustrating how even minor daily choices can lead to profound results over time, Hardy motivates readers to take responsibility for their actions and make positive choices that will shape their future. This book is a compelling reminder that success is not about big leaps but rather about the daily habits and decisions we make.</p><p><strong>📚 The 5 AM Club” by Robin Sharma:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*x5oc7MomWQ1doaloxFfB2Q.jpeg" /></figure><p>Another gem by Robin Sharma, “The 5 AM Club,” underscores the significance of starting your day with intention and purpose. The book introduces readers to a group of individuals who understand the value of the first hour of the day, and it provides a blueprint for developing a morning routine that can supercharge your productivity, creativity, and personal growth. Through the 5 AM method, Sharma imparts valuable insights into optimizing your life, unlocking your potential, and finding fulfillment.</p><p><strong>📚 Life’s Amazing Secrets by Gaur Gopal Das:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*vw9bTL6FxFgYL7R4fojPbw.jpeg" /></figure><p>Gaur Gopal Das, a former engineer turned monk, shares profound life lessons in “Life’s Amazing Secrets.” The book combines his personal experiences with spiritual wisdom to offer a unique perspective on modern-day challenges. Das encourages readers to lead more meaningful lives, fostering stronger relationships, and finding their life’s purpose. His teachings are relatable and accessible, making this book a valuable guide to personal development and well-being.</p><p><strong>📚 The Alchemist by Paulo Coelho:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*HbokJXEQFT3OyRLAZh7VNg.jpeg" /></figure><p>“The Alchemist” by Paulo Coelho is a timeless classic that has touched the hearts of readers worldwide. The novel follows Santiago, a shepherd, on a quest to discover his personal legend, or true purpose in life. Through his journey, readers are reminded of the importance of pursuing their dreams and trusting in the universe’s guidance. Coelho’s storytelling and metaphors inspire readers to listen to their hearts and follow their passions with unwavering determination.</p><p>These five books offer different approaches to motivation and personal growth, but they all share a common goal: to inspire you to make positive changes in your life. Whether it’s reevaluating your priorities, adopting productive habits, starting your day with intention, finding your life’s purpose, or pursuing your dreams, each book provides valuable insights and practical advice. Reading and applying the wisdom from these books can help you on your journey to a more motivated, fulfilling, and purposeful life. 🌟</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95e4d5459097" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unraveling SQL Mysteries: Identifying Non-Ordering Customers]]></title>
            <link>https://medium.com/@tinkerrebell/unraveling-sql-mysteries-identifying-non-ordering-customers-e86d29ba8a93?source=rss-3f07d9bef95d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e86d29ba8a93</guid>
            <category><![CDATA[querying]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Tinkerbell]]></dc:creator>
            <pubDate>Sun, 29 Oct 2023 10:43:44 GMT</pubDate>
            <atom:updated>2023-10-29T10:43:44.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*wzWFyhJAuU567d2h.jpg" /></figure><p>In the world of SQL, there are mysteries that boggle the mind, much like the curious case of customers who never seem to place an order. Today, we embark on a quest to solve the “Customers Who Never Order” LeetCode problem, where we’ll uncover the elusive customers who prefer to sip their coffee and watch the world go by.</p><p><strong>The Challenge: Identifying Non-Ordering Customers</strong></p><p><a href="https://leetcode.com/problems/customers-who-never-order/">Customers Who Never Order - LeetCode</a></p><p>Our mission is clear: write a SQL query to identify customers who’ve never placed an order. It’s akin to be a detective in the culinary world, seeking those who prefer to observe rather than partake.</p><p>Let’s start by examining the tables involved:</p><p><strong>Customers Table:</strong></p><pre>+----+-------+<br>| id | name  |<br>+----+-------+<br>| 1  | Joe   |<br>| 2  | Henry |<br>| 3  | Sam   |<br>| 4  | Max   |<br>+----+-------+</pre><p><strong>Orders Table:</strong></p><pre>+----+------------+<br>| id | customerId |<br>+----+------------+<br>| 1  | 3          |<br>| 2  | 1          |<br>+----+------------+</pre><p>The Customers table lists our cafe’s patrons, with ‘id’ as the primary key. In the Orders table, ‘customerId’ is a foreign key referencing the ‘id’ from the Customers table. Each row in the Orders table indicates the ID of an order and the ID of the customer who placed it.</p><p><strong>Solution 1: Using LEFT JOIN to Find Non-Ordering Customers</strong></p><p>In SQL, the LEFT JOIN operation is our go-to tool for solving this mystery. A LEFT JOIN returns all records from the left table (Customers) and the matched records from the right table (Orders). If there’s no match, it returns NULL for the right table’s columns.</p><p>Here’s the SQL query that achieves this:</p><pre>SELECT Name AS Customers<br>FROM CUSTOMERS<br>LEFT JOIN ORDERS<br>ON ORDERS.CustomerID = Customers.Id<br>WHERE Orders.CustomerID IS NULL</pre><p>This query selects customers from the Customers table and uses a LEFT JOIN to pair them with their orders. The WHERE clause narrows the results to those where ‘Orders.CustomerID IS NULL,’ indicating that the customer hasn’t placed an order.</p><p><strong>Solution 2: Using a Subquery</strong></p><p>Another method involves using a subquery. We find customers who are not in the list of those who have placed orders:</p><pre>SELECT Name AS Customers<br>FROM Customers<br>WHERE id NOT IN (SELECT DISTINCT customerId FROM Orders)</pre><p>The subquery (SELECT DISTINCT customerId FROM Orders) retrieves all unique customer IDs who have placed orders. The main query then selects customers whose IDs are not in this list, effectively identifying non-ordering customers.</p><p><strong>Solution 3: Using a NOT EXISTS Subquery</strong></p><p>Another approach employs a NOT EXISTS subquery:</p><pre>SELECT Name AS Customers<br>FROM Customers c<br>WHERE NOT EXISTS (SELECT 1 FROM Orders o WHERE o.customerId = c.id)</pre><p>In this query, we check for each customer in the Customers table whether there’s no record in the Orders table with a matching customer ID. If no such record exists, it means the customer hasn’t placed an order.</p><p><strong>Solution 4: Using a Self-Join</strong></p><pre>SELECT c1.Name AS Customers<br>FROM Customers c1<br>LEFT JOIN Orders o ON c1.id = o.customerId<br>WHERE o.customerId IS NULL</pre><p>Here, a LEFT JOIN matches each customer in the Customers table with orders in the Orders table. If no matching order is found (i.e., o.customerId IS NULL), it means the customer hasn&#39;t placed an order.</p><p>By understanding these methods, you gain valuable skills for data analysis and database querying.</p><p><em>Happy querying and uncovering those enigmatic non-ordering customers! </em>🕵️‍♀️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e86d29ba8a93" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>