<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: EricMWaimiri</title>
    <description>The latest articles on DEV Community by EricMWaimiri (@ericmwaimiri).</description>
    <link>https://dev.to/ericmwaimiri</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3818862%2Fbe3f8deb-62cf-48ba-aa8c-f5fa79569d76.png</url>
      <title>DEV Community: EricMWaimiri</title>
      <link>https://dev.to/ericmwaimiri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ericmwaimiri"/>
    <language>en</language>
    <item>
      <title>Data Analytics with Python as a Beginner</title>
      <dc:creator>EricMWaimiri</dc:creator>
      <pubDate>Wed, 13 May 2026 18:55:39 +0000</pubDate>
      <link>https://dev.to/ericmwaimiri/data-analytics-with-python-as-a-beginner-1hp2</link>
      <guid>https://dev.to/ericmwaimiri/data-analytics-with-python-as-a-beginner-1hp2</guid>
      <description>&lt;p&gt;In today’s digital world, data is everywhere. Every time people shop online, scroll through social media, book a hotel, or use a banking app, they generate data. Companies collect this information to understand customer behavior, improve services, and make smarter business decisions. However, raw data alone is not useful unless it can be analyzed effectively. This is where &lt;strong&gt;Python&lt;/strong&gt; becomes important.&lt;/p&gt;

&lt;p&gt;Python is a high-level programming language created by Guido van Rossum in 1991. It is known for its simple syntax, readability, and flexibility. Unlike some programming languages that require complicated commands, Python reads almost like normal English. Because of this, beginners often find it easier to learn compared to languages such as Java or C++.&lt;/p&gt;

&lt;p&gt;Over the years, Python has become one of the most popular programming languages in the world. It is used in many fields, including web development, artificial intelligence, cybersecurity, automation, and especially &lt;strong&gt;data analytics&lt;/strong&gt;. Many organizations today depend on data analytics to make informed decisions, predict trends, and improve efficiency. Python provides the tools needed to collect, clean, analyze, and visualize data effectively.&lt;/p&gt;

&lt;p&gt;Python is often described as a “Swiss army knife” for data analytics because it can handle many different tasks in one environment. Analysts can use Python to organize messy datasets, calculate statistics, create visual charts, and even build machine learning models that predict future outcomes. Instead of switching between multiple tools, Python allows users to perform all these tasks in one programming language.&lt;/p&gt;

&lt;p&gt;Another reason for Python’s popularity is its large ecosystem of libraries. These libraries are collections of prewritten code that make complex tasks easier. For example, instead of writing hundreds of lines of code to analyze data, a user can simply import a library like Pandas or NumPy and perform advanced operations in just a few commands.&lt;/p&gt;

&lt;p&gt;Personally, one of the most interesting things about Python is how beginner-friendly it feels. When I first encountered Python code, it looked much simpler and cleaner than I expected programming to be. Even basic commands such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, Data Analytics!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;show how readable the language is. This simplicity is one reason why Python has become a gateway into the world of data science and analytics for many beginners.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Python is Popular in Data Analytics
&lt;/h2&gt;

&lt;p&gt;Python has become the preferred language for data analytics because it combines simplicity, power, and flexibility. Both beginners and professionals use it because it makes working with data easier and faster.&lt;/p&gt;

&lt;p&gt;One major reason for Python’s popularity is its beginner-friendly syntax. Many programming languages use complex structures that can confuse new learners. Python, however, focuses on readability. Commands are written in a clean and straightforward way, making it easier to understand what the code is doing. This allows beginners to focus more on solving problems instead of struggling with syntax errors.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even someone with little programming knowledge can understand what the code is doing. This simplicity makes Python ideal for students and people transitioning into analytics from non-technical backgrounds.&lt;/p&gt;

&lt;p&gt;Another reason for Python’s success is its huge ecosystem of libraries. Libraries are prebuilt collections of code designed to perform specific tasks. In data analytics, Python libraries save analysts a lot of time because they provide ready-made tools for calculations, visualization, and machine learning. Instead of building everything from scratch, users can rely on tested and optimized libraries.&lt;/p&gt;

&lt;p&gt;Python also has strong community support. Millions of developers around the world contribute tutorials, online forums, videos, and open-source projects. If a beginner encounters a problem, there is a high chance someone else has already solved it online. Websites like Stack Overflow and Kaggle provide useful resources for learners.&lt;/p&gt;

&lt;p&gt;Another advantage is integration. Python works well with databases, cloud platforms, Excel files, APIs, and visualization tools. This flexibility allows analysts to connect Python with real-world business systems. For example, a company can use Python to extract sales data from a database, clean it, visualize trends, and generate reports automatically.&lt;/p&gt;

&lt;p&gt;Python is also widely used in industries such as finance, healthcare, retail, and hospitality. This broad adoption means that learning Python opens many career opportunities. Companies are constantly looking for employees who can analyze data and turn it into useful insights.&lt;/p&gt;

&lt;p&gt;When I first explored Python for data analytics, I noticed how quickly tasks could be automated. Something that would take hours in Excel could often be completed in minutes using Python scripts. That efficiency is one of the reasons why Python continues to dominate the analytics field.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Python Libraries for Data Analytics
&lt;/h2&gt;

&lt;p&gt;Python’s true power in data analytics comes from its libraries. These libraries provide specialized tools that simplify data-related tasks. Without them, analysts would have to write complex code from scratch. Some libraries focus on calculations, others on visualization, and others on machine learning.&lt;/p&gt;

&lt;p&gt;One of the most important libraries is &lt;strong&gt;NumPy&lt;/strong&gt;. NumPy stands for Numerical Python and is mainly used for numerical computing. It provides support for arrays and matrices, allowing calculations to be performed efficiently. Arrays in NumPy are faster and more memory-efficient than standard Python lists.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code calculates the average of the numbers in the array.&lt;/p&gt;

&lt;p&gt;Another essential library is &lt;strong&gt;Pandas&lt;/strong&gt;. Pandas is widely used for data cleaning and manipulation. It introduces the concept of DataFrames, which are tables similar to Excel spreadsheets. Analysts use Pandas to load datasets, remove duplicates, handle missing values, and organize information.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sales.csv&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;head&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I first used Pandas, I realized how much easier it was to clean messy Excel sheets. Tasks that normally required many manual steps could be completed with a few lines of code.&lt;/p&gt;

&lt;p&gt;For visualization, analysts often use &lt;strong&gt;Matplotlib&lt;/strong&gt; and &lt;strong&gt;Seaborn&lt;/strong&gt;. These libraries help create graphs and charts that make data easier to understand. Visualization is important because people often understand trends better through visuals than raw numbers.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;seaborn&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;sns&lt;/span&gt;

&lt;span class="n"&gt;sns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;barplot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Department&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Revenue&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a bar chart showing revenue by department.&lt;/p&gt;

&lt;p&gt;Another popular library is &lt;strong&gt;Scikit-learn&lt;/strong&gt;. This library is mainly used for machine learning and predictive analytics. It provides tools for regression, classification, clustering, and model evaluation. Beginners often use Scikit-learn to build simple predictive models.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.linear_model&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;LinearRegression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, there is &lt;strong&gt;Statsmodels&lt;/strong&gt;, which focuses more on statistical analysis. It is useful for hypothesis testing, regression analysis, and advanced statistical modeling.&lt;/p&gt;

&lt;p&gt;Together, these libraries form a powerful toolkit for data analytics. They allow analysts to move from raw data to meaningful insights efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Python is Used in Data Analytics
&lt;/h2&gt;

&lt;p&gt;Python is used throughout the entire data analytics process. From cleaning raw data to building predictive models, it provides tools that make each stage easier and more efficient.&lt;/p&gt;

&lt;p&gt;The first stage is &lt;strong&gt;data cleaning&lt;/strong&gt;. Real-world data is often incomplete, inconsistent, or messy. Datasets may contain missing values, duplicates, or incorrect formatting. Before analysis can begin, the data must be cleaned.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sales.csv&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Remove missing values
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dropna&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inplace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Standardize date format
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code removes missing data and converts dates into a consistent format.&lt;/p&gt;

&lt;p&gt;The next stage is &lt;strong&gt;data analysis&lt;/strong&gt;. Analysts use Python to calculate statistics, identify patterns, and summarize datasets.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;corr&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;describe()&lt;/code&gt; function generates summary statistics, while &lt;code&gt;corr()&lt;/code&gt; shows relationships between variables.&lt;/p&gt;

&lt;p&gt;Another important area is &lt;strong&gt;data visualization&lt;/strong&gt;. Visualization transforms raw data into graphs and charts that are easier to interpret. Businesses use dashboards and reports to communicate insights clearly.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Revenue&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visualization helps decision-makers quickly identify trends and anomalies.&lt;/p&gt;

&lt;p&gt;Python is also heavily used in &lt;strong&gt;predictive analytics&lt;/strong&gt;. Predictive analytics involves using historical data to forecast future outcomes. Companies use predictive models to estimate sales, detect fraud, and predict customer behavior.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;sklearn.linear_model&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;LinearRegression&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LinearRegression&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Advertising&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]],&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sales&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a simple regression model that predicts sales based on advertising spending.&lt;/p&gt;

&lt;p&gt;One thing I appreciate about Python is how all these tasks can be done within one environment. Instead of switching between Excel, SQL, and visualization software, Python combines everything into one workflow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Examples
&lt;/h2&gt;

&lt;p&gt;Python is widely used in many industries because data analytics has become essential for decision-making.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Finance&lt;/em&gt;&lt;br&gt;
Python is used for fraud detection and risk modeling. Banks analyze transaction data to identify suspicious activities. Machine learning models can detect unusual spending patterns that may indicate fraud.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Healthcare&lt;/em&gt;&lt;br&gt;
Python helps analyze patient data and predict diseases. Hospitals use analytics to improve treatment plans and forecast patient admissions. During disease outbreaks, data analytics can help track infection trends and allocate resources effectively.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Retail&lt;/em&gt;&lt;br&gt;
Retail companies use Python for customer segmentation and sales forecasting. Businesses analyze shopping patterns to understand customer preferences and improve marketing strategies. Online stores also use recommendation systems powered by Python to suggest products.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Hospitality&lt;/em&gt;&lt;br&gt;
Python is used for occupancy forecasting and guest sentiment analysis. Hotels analyze booking trends and customer reviews to improve services and optimize pricing strategies.&lt;/p&gt;

&lt;p&gt;These examples show that Python is not limited to one industry. Its flexibility makes it valuable in almost every field that relies on data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Beginners Should Learn Python
&lt;/h2&gt;

&lt;p&gt;Python is one of the best programming languages for beginners. Its syntax is simple, readable, and less intimidating compared to many other languages.&lt;/p&gt;

&lt;p&gt;Another reason beginners should learn Python is career demand. Data analytics, data science, and artificial intelligence are among the fastest-growing fields globally. Companies are constantly searching for employees with Python skills.&lt;/p&gt;

&lt;p&gt;Python also teaches transferable skills. Someone who learns Python for analytics can later branch into web development, automation, cybersecurity, or AI. This flexibility makes Python a long-term investment.&lt;/p&gt;

&lt;p&gt;In addition, Python is free and open source. Anyone can download it and start learning without paying for expensive software licenses. The official Python website provides downloads, tutorials, and documentation for beginners.&lt;/p&gt;

&lt;p&gt;For beginners, practicing with small projects is important. Platforms like Kaggle provide free datasets and beginner-friendly projects that help learners apply their skills.&lt;/p&gt;

&lt;p&gt;Learning Python may feel challenging at first, but consistency makes a huge difference. Even small projects, such as analyzing sales data or creating charts, help build confidence over time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Python has transformed the field of data analytics by making it easier to collect, clean, analyze, and visualize data. Its simplicity, versatility, and powerful libraries have made it the preferred programming language for beginners and professionals alike.&lt;/p&gt;

&lt;p&gt;From finance and healthcare to retail and hospitality, Python is used across industries to uncover insights and support decision-making. Libraries such as Pandas, NumPy, Seaborn, and Scikit-learn provide tools that simplify complex tasks and improve efficiency.&lt;/p&gt;

&lt;p&gt;For beginners, Python offers an excellent starting point because it is easy to learn and supported by a massive global community. Beyond analytics, Python also opens pathways into artificial intelligence, automation, and software development.&lt;/p&gt;

&lt;p&gt;The best way to learn Python is to start small. Working with simple datasets, experimenting with visualizations, and completing beginner projects on platforms like Kaggle can gradually build confidence and skills. Over time, these small steps can lead to deeper knowledge in data science and analytics.&lt;/p&gt;

&lt;p&gt;In a world increasingly driven by data, Python is more than just a programming language — it is a gateway to understanding and solving real-world problems.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>beginners</category>
      <category>datascience</category>
      <category>python</category>
    </item>
    <item>
      <title>Subqueries vs. CTEs and When to Use Each</title>
      <dc:creator>EricMWaimiri</dc:creator>
      <pubDate>Mon, 20 Apr 2026 08:00:01 +0000</pubDate>
      <link>https://dev.to/ericmwaimiri/a-practical-guide-to-subqueries-and-ctes-in-sql-3574</link>
      <guid>https://dev.to/ericmwaimiri/a-practical-guide-to-subqueries-and-ctes-in-sql-3574</guid>
      <description>&lt;p&gt;SQL offers multiple ways to break down complex problems into manageable steps. Two of the most powerful tools for this are subqueries and Common Table Expressions (CTEs). While they often overlap in functionality, understanding their differences is key to writing efficient, maintainable queries.&lt;/p&gt;

&lt;p&gt;A &lt;em&gt;subquery&lt;/em&gt; is a query nested inside another query. It executes first, and its result feeds into the outer query. Subqueries can appear in &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;FROM&lt;/code&gt;, or &lt;code&gt;WHERE&lt;/code&gt; clauses.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;first_name&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;employee_id&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;employee_id&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;salaries&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the inner query finds employees with salaries above 50,000, and the outer query retrieves their names.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Subqueries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalar subquery&lt;/strong&gt; → returns a single value.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;salary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;salaries&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Row subquery&lt;/strong&gt; → returns one row with multiple columns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table subquery&lt;/strong&gt; → returns multiple rows/columns, used in &lt;code&gt;FROM&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correlated subquery&lt;/strong&gt; → references columns from the outer query and runs repeatedly.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;salary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;salaries&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
    &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;department_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;department_id&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to Use Subqueries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Filtering with complex conditions (&lt;code&gt;WHERE IN&lt;/code&gt;, &lt;code&gt;EXISTS&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;Returning computed values inline.
&lt;/li&gt;
&lt;li&gt;Quick one‑off queries where readability isn’t critical.
&lt;/li&gt;
&lt;li&gt;Situations where you don’t want to define intermediate steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Is a CTE?
&lt;/h2&gt;

&lt;p&gt;A CTE is a temporary named result set defined with &lt;code&gt;WITH&lt;/code&gt;. It improves readability by breaking queries into logical blocks.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;high_salary&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;employee_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;salaries&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;salary&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;high_salary&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;employee_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;employee_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Types and Use Cases of CTEs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Non‑recursive CTEs&lt;/strong&gt; → simplify complex queries, improve readability.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recursive CTEs&lt;/strong&gt; → handle hierarchical data (e.g., org charts, tree structures).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple CTEs&lt;/strong&gt; → chain transformations step by step.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reporting pipelines.
&lt;/li&gt;
&lt;li&gt;Breaking down multi‑stage logic.
&lt;/li&gt;
&lt;li&gt;Recursive problems like traversing parent‑child relationships.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Subqueries vs CTEs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Subqueries&lt;/th&gt;
&lt;th&gt;CTEs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Often optimized well, but correlated subqueries can be slow.&lt;/td&gt;
&lt;td&gt;Similar performance; recursive CTEs can be powerful but heavy.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Readability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Harder to read if deeply nested.&lt;/td&gt;
&lt;td&gt;Much clearer — logic broken into named blocks.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Quick filters, inline calculations.&lt;/td&gt;
&lt;td&gt;Complex queries, multi‑step transformations, recursive problems.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Portability&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Supported everywhere.&lt;/td&gt;
&lt;td&gt;Supported in most modern RDBMS (PostgreSQL, SQL Server, Oracle, MySQL 8+).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For better and more readable queries;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use subqueries for simple, inline logic.
&lt;/li&gt;
&lt;li&gt;Use CTEs when queries get complex, recursive, or need to be broken into readable steps.
&lt;/li&gt;
&lt;li&gt;Performance is usually similar, but CTEs win on readability and maintainability. &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sql</category>
      <category>beginners</category>
    </item>
    <item>
      <title>First Week Reflections on SQL</title>
      <dc:creator>EricMWaimiri</dc:creator>
      <pubDate>Mon, 13 Apr 2026 14:06:35 +0000</pubDate>
      <link>https://dev.to/ericmwaimiri/first-week-reflections-on-sql-1kdn</link>
      <guid>https://dev.to/ericmwaimiri/first-week-reflections-on-sql-1kdn</guid>
      <description>&lt;p&gt;&lt;strong&gt;DDL vs DML&lt;/strong&gt;&lt;br&gt;
In SQL, two families of commands shape how we interact with data: &lt;em&gt;Data Definition Language (DDL)&lt;/em&gt; and &lt;em&gt;Data Manipulation Language (DML)&lt;/em&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DDL commands (&lt;code&gt;CREATE&lt;/code&gt;, &lt;code&gt;ALTER&lt;/code&gt;, &lt;code&gt;DROP&lt;/code&gt;) are like the architect’s blueprint, they define the structure of the database.
&lt;/li&gt;
&lt;li&gt;DML commands (&lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;, &lt;code&gt;SELECT&lt;/code&gt;) are the everyday tools. They let us add, change, or remove the actual records inside those structures. 
Here is how I tackled the first assignment:&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;code&gt;CREATE&lt;/code&gt;&lt;/em&gt; built the schema &lt;code&gt;nairobi_academy&lt;/code&gt; and three tables (&lt;code&gt;students&lt;/code&gt;, &lt;code&gt;subjects&lt;/code&gt;, &lt;code&gt;exam_results&lt;/code&gt;).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5obuw5aky4iunwzhx987.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5obuw5aky4iunwzhx987.png" alt=" " width="517" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;code&gt;INSERT&lt;/code&gt;&lt;/em&gt; populated each table with 10 rows of realistic data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhp5d66fuqso6z8aesv0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhp5d66fuqso6z8aesv0f.png" alt=" " width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;code&gt;UPDATE&lt;/code&gt;&lt;/em&gt; corrected mistakes: Esther Akinyi’s city changed from Nakuru to Nairobi, and marks for result_id 5 were fixed from 49 to 59.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfk5o64n483yqi1r5e1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfk5o64n483yqi1r5e1a.png" alt=" " width="712" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;code&gt;DELETE&lt;/code&gt;&lt;/em&gt; removed the cancelled exam result with result_id 9.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fst9jqqynh26mwoi231lb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fst9jqqynh26mwoi231lb.png" alt=" " width="586" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filtering with WHERE&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;WHERE&lt;/code&gt; clause is the gatekeeper of SQL. Without it, every row would be affected — a dangerous mistake!&lt;br&gt;&lt;br&gt;
I used it to:&lt;br&gt;
_- Find students in Form 4 (&lt;code&gt;WHERE class = 'Form 4'&lt;/code&gt;).  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieve exam results with marks &amp;gt;= 70.
&lt;/li&gt;
&lt;li&gt;Combine conditions (&lt;code&gt;WHERE class = 'Form 3' AND city = 'Nairobi'&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;Explore operators like:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;BETWEEN&lt;/code&gt; for ranges (marks between 50 and 80).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IN&lt;/code&gt; for multiple matches (cities in Nairobi, Mombasa, Kisumu).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LIKE&lt;/code&gt; for patterns (names starting with A or E). _ &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;It’s the precision tool that makes queries powerful and safe.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9kkid8uf514q7bqfukj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9kkid8uf514q7bqfukj.png" alt=" " width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CASE WHEN: Transforming Data&lt;/strong&gt;&lt;br&gt;
Raw numbers are useful, but categories tell stories. With &lt;code&gt;CASE WHEN&lt;/code&gt;, I transformed exam marks into performance labels: Distinction, Merit, Pass, or Fail.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqamvh38x0fr0kjabqob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqamvh38x0fr0kjabqob.png" alt=" " width="703" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also classified students as Senior (Form 3 or 4) or Junior (Form 1 or 2).  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgdrrigeibkjrdu7i4ir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgdrrigeibkjrdu7i4ir.png" alt=" " width="800" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most challenging part was remembering to always pair &lt;code&gt;UPDATE&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; with &lt;code&gt;WHERE&lt;/code&gt;. Forgetting it could wipe out entire tables in seconds. The most interesting part was experimenting with &lt;code&gt;CASE WHEN&lt;/code&gt;. It was like giving the database a voice: instead of just numbers, it could tell me who excelled, who struggled, and who was senior or junior.  This week, I realized that the beauty of SQL lies in precision and creativity.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>postgres</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Publish a Power BI Report and Embed It into a Website.</title>
      <dc:creator>EricMWaimiri</dc:creator>
      <pubDate>Tue, 07 Apr 2026 09:20:49 +0000</pubDate>
      <link>https://dev.to/ericmwaimiri/publish-a-power-bi-report-and-embed-it-into-a-website-20pm</link>
      <guid>https://dev.to/ericmwaimiri/publish-a-power-bi-report-and-embed-it-into-a-website-20pm</guid>
      <description>&lt;p&gt;Power BI transforms raw numbers into interactive dashboards that are full of insights. The real magic, however, happens when you share those dashboards with the world. Publishing and embedding a Power BI report lets your audience explore the data directly on your website, turning a static page into a dynamic story.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Create a Workspace&lt;/strong&gt;&lt;br&gt;
Workspaces organize your reports and control who can access them.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Go to Power BI Service; Workspaces; Create Workspace&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Log in to the Power BI Service&lt;/em&gt; &lt;a href="https://app.powerbi.com/user/user-settings/general?experience=power-bi" rel="noopener noreferrer"&gt;app.powerbi.com&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Click Workspaces in the left navigation&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Select Create a Workspace and give it a name&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1gz9qodhi6qemcia2lb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1gz9qodhi6qemcia2lb.png" alt=" " width="594" height="907"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Upload and Publish Your Report&lt;/strong&gt;&lt;br&gt;
Publishing moves your report from Power BI Desktop to the cloud.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In Power BI Desktop; Home; Publish&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Open your report in Power BI Desktop&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Click Publish on the ribbon&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v6279izkjgiztjkezb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2v6279izkjgiztjkezb6.png" alt=" " width="406" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Choose the workspace you created&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2qxibj8j4pqnahxa678.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2qxibj8j4pqnahxa678.png" alt=" " width="800" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Confirm upload&lt;/em&gt;; the report will appear in the Power BI Service&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fydskx0v7k8cvwfly69hh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fydskx0v7k8cvwfly69hh.png" alt=" " width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Generate the Embed Code&lt;/strong&gt;&lt;br&gt;
The embed code allows you to integrate the report into a website.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Go to Power BI Service; Report (In Workspace); File; Embed Report&lt;/em&gt;&lt;br&gt;
Open your report in the Power BI Service Click File → Embed Report → Website or Portal&lt;br&gt;
&lt;em&gt;Copy the iframe embed code provided&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sw7qxdp8dl34h7j13j4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7sw7qxdp8dl34h7j13j4.png" alt=" " width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljdjai76m999tm6fi6dp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fljdjai76m999tm6fi6dp.png" alt=" " width="800" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Embed the Report on Your Website&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Open a text editor&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Write or generate a code&lt;/em&gt; to embed a power BI report on your website&lt;br&gt;
&lt;em&gt;Paste the iframe embed code&lt;/em&gt; where you want the report to appear&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdiyeqgjv3seh1k7mp4tj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdiyeqgjv3seh1k7mp4tj.png" alt=" " width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Save and publish your website&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Open the embedded report on your browser&lt;/em&gt; to ensure it loads and is interactive&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj056672mwlamut4dduoq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj056672mwlamut4dduoq.png" alt=" " width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To understand all the technicality, think of it like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Workspaces are the foundation for organizing and securing reports.&lt;/li&gt;
&lt;li&gt;Publishing moves reports from desktop to the cloud.&lt;/li&gt;
&lt;li&gt;Embed codes are the bridge between Power BI and your website.&lt;/li&gt;
&lt;li&gt;Embedded reports remain fully interactive, giving your audience a dynamic data experience.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>powerbi</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Power BI and Data Modeling</title>
      <dc:creator>EricMWaimiri</dc:creator>
      <pubDate>Sun, 29 Mar 2026 22:51:25 +0000</pubDate>
      <link>https://dev.to/ericmwaimiri/power-bi-and-data-modeling-4iol</link>
      <guid>https://dev.to/ericmwaimiri/power-bi-and-data-modeling-4iol</guid>
      <description>&lt;p&gt;Data modeling in Power BI is basically about organizing your data properly so you can analyze it easily. Instead of just loading random tables, you structure them in a way that makes sense.&lt;br&gt;
This involves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating and defining tables&lt;/li&gt;
&lt;li&gt;Connecting them using relationships&lt;/li&gt;
&lt;li&gt;Choosing the right structure (schema)&lt;/li&gt;
&lt;li&gt;Combining data using joins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Joins (When Combining Data):&lt;/em&gt;&lt;br&gt;
When working in Power Query or SQL, joins help you decide how two tables should be combined:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;INNER JOIN: Only returns matching data in both tables&lt;/li&gt;
&lt;li&gt;LEFT JOIN: All data from the left table + matches from the right&lt;/li&gt;
&lt;li&gt;RIGHT JOIN: All data from the right table + matches from the left&lt;/li&gt;
&lt;li&gt;FULL OUTER JOIN: Everything from both tables, matched where possible&lt;/li&gt;
&lt;li&gt;LEFT ANTI JOIN: Data in left table with no match in right&lt;/li&gt;
&lt;li&gt;RIGHT ANTI JOIN: Data in right table with no match in left&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Power BI, you do this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Going to Power Query: Home: Merge Queries&lt;/li&gt;
&lt;li&gt;Selecting your tables and the type of join&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Relationships (How Tables Connect):&lt;/em&gt;&lt;br&gt;
After loading data, you connect tables using relationships:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;One-to-One which is rare like, Employee : Employee Details&lt;/li&gt;
&lt;li&gt;One-to-Many which is very common like, Customer : Orders&lt;/li&gt;
&lt;li&gt;Many-to-Many which is more complex like, Students : Courses&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Important Relationship Properties:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Active vs Inactive: Only one active relationship at a time&lt;/li&gt;
&lt;li&gt;Cardinality: Defines the type&lt;/li&gt;
&lt;li&gt;Cross-filter direction; Single (default) which filters in one direction or Both whose filters move both ways&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;In Power BI:&lt;/em&gt;&lt;br&gt;
Go to Model View; Manage Relationships&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Joins vs Relationships&lt;/em&gt;&lt;br&gt;
Joins Combine tables into one while relationships keep tables separate but connected&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fact vs Dimension Tables:&lt;/em&gt;&lt;br&gt;
Fact Tables are the numbers you want to analyze like sales or revenue while Dimension Tables is the descriptive info like customer name, product category etc. Remember to always keep facts numeric and dimensions descriptive if you want to have clean reports.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Schemas (How You Structure Data):&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;Star Schema (The recommended option):&lt;/em&gt;
One central fact table connected to dimension tables. It is rather simple and efficient.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Snowflake Schema&lt;/em&gt; - More complex (dimensions split into smaller tables) and is more popularly used for large datasets.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Flat Table (DLAT):&lt;/em&gt;
Everything in one table and is easy to build but not efficient for big data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Role-Playing Dimensions:&lt;/em&gt;&lt;br&gt;
This is when one table is used in multiple ways.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Some Common Mistakes:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ambiguous relationships&lt;/li&gt;
&lt;li&gt;Many-to-many confusion&lt;/li&gt;
&lt;li&gt;Poor table structure&lt;/li&gt;
&lt;li&gt;Forgetting to activate relationships&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So a simple Workflow would go like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load data; Power Query&lt;/li&gt;
&lt;li&gt;Combine data; Merge Queries (joins)&lt;/li&gt;
&lt;li&gt;Connect tables; Model View&lt;/li&gt;
&lt;li&gt;Choose structure; Star/Snowflake schema&lt;/li&gt;
&lt;li&gt;Add role-playing dimensions if needed&lt;/li&gt;
&lt;li&gt;Check everything; relationships, filters, and structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good data modeling makes your reports faster, cleaner, and easier to understand. Without it, even simple analysis becomes confusing.&lt;/p&gt;

</description>
      <category>powerfuldevs</category>
      <category>beginners</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Real World Data Analysis with Excel</title>
      <dc:creator>EricMWaimiri</dc:creator>
      <pubDate>Sun, 29 Mar 2026 15:02:31 +0000</pubDate>
      <link>https://dev.to/ericmwaimiri/real-world-data-analysis-with-excel-1ea2</link>
      <guid>https://dev.to/ericmwaimiri/real-world-data-analysis-with-excel-1ea2</guid>
      <description>&lt;p&gt;Microsoft Excel looks like just any other spreadsheet; however, it’s an absolute powerhouse for turning raw data into insights. It's core function - organizing information into rows and columns - makes it easier to perform complex calculations, look over patterns, and bring data to life through various visualizations.&lt;/p&gt;

&lt;p&gt;Excel is a critical asset across various industries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Business Reporting&lt;/em&gt;: Excel helps organizations and businesses track performance and make smarter decisions.&lt;br&gt;
Financial Analysis: While forecasting revenue, calculating margins, and evaluating investment opportunities analysts use excel to work with precision.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Project Management&lt;/em&gt;: Teams rely on Excel to map timelines, allocate resources, and keep projects running smoothly to the end.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Research&lt;/em&gt;: Raw survey data is turned into clear insights using statistical analysis and visual storytelling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Excel's formulas and functions keep us from doing redundant work and reduces human error, allowing us to focus on insight and strategy. Some of the most popular and important functions include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;SUM()&lt;/em&gt; - instantly totals values e.g. calculating weekly sales.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;IF()&lt;/em&gt; - a logical function that checks whether something is true or false, and then returns one result if it’s true, and another result if it’s false.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;VLOOKUP() / XLOOKUP()&lt;/em&gt; - Vertical Lookup or VLOOKUP searches for a value in the first column of a table and returns a corresponding value from another column in the same row. XLOOKUP is a modern replacement for VLOOKUP. Unlike VLOOKUP it can search in any direction and is easier to use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;PivotTables&lt;/em&gt; - Visual tools that summarize and analyze large amounts of data quickly. Instead of manually calculating totals or averages, a PivotTable lets you organize your data to see it from different angles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Conditional Formatting&lt;/em&gt; - makes it easier to see trends and outliers with nothing important going unnoticed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Excel for me feels like a lifesaver when it comes to transformation and calculation of data. I will continue to dive into the excitement as I discover new functionalities while exploring different datasets.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>beginners</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
