<?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>Forem: James Njoroge</title>
    <description>The latest articles on Forem by James Njoroge (@jamesnjrg).</description>
    <link>https://forem.com/jamesnjrg</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%2F3818270%2F2b719696-fe1e-41ce-99c7-88dc382bc24b.png</url>
      <title>Forem: James Njoroge</title>
      <link>https://forem.com/jamesnjrg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jamesnjrg"/>
    <language>en</language>
    <item>
      <title>SQL for Beginners: Essential Concepts Made Simple</title>
      <dc:creator>James Njoroge</dc:creator>
      <pubDate>Sun, 19 Apr 2026 15:19:22 +0000</pubDate>
      <link>https://forem.com/jamesnjrg/sql-for-beginners-essential-concepts-made-simple-4bf4</link>
      <guid>https://forem.com/jamesnjrg/sql-for-beginners-essential-concepts-made-simple-4bf4</guid>
      <description>&lt;p&gt;SQL stands for Structured Query Language. It is the standard language used to communicate with databases. Think of SQL as the "English" you speak to a database when you want to get information, add new data, update records, or delete something. SQL allows you to do 4 main things (often remembered as CRUD) where C represents Create, R represents READ while U represents Update and D represents Delete. However the SQL keyword for Create is &lt;strong&gt;INSERT&lt;/strong&gt;, for Read is &lt;strong&gt;SELECT&lt;/strong&gt;, for Update is &lt;strong&gt;UPDATE&lt;/strong&gt; and for Delete is &lt;strong&gt;DELETE&lt;/strong&gt;. SQL also useful in filtering data(&lt;strong&gt;WHERE&lt;/strong&gt;), sorting data(&lt;strong&gt;ORDER BY&lt;/strong&gt;), grouping data(&lt;strong&gt;GROUP BY, AVG, COUNT&lt;/strong&gt;), Combining tables(&lt;strong&gt;JOIN&lt;/strong&gt;) and advanced analysis(&lt;strong&gt;NTILE&lt;/strong&gt;) &lt;/p&gt;

&lt;p&gt;Learning SQL can be made simple by breaking down learning into key concepts making it much easier to understand and grasp how it works. In this guide, we'll cover fundamental topics that every beginner should know  which include &lt;strong&gt;JOINS&lt;/strong&gt;, compare &lt;strong&gt;Window Functions&lt;/strong&gt; and &lt;strong&gt;GROUP BY&lt;/strong&gt; and cover SQL functions every beginner should know.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL JOINs
&lt;/h2&gt;

&lt;p&gt;A JOIN combines rows from two or more tables based on a related column. The tables in the join must have a column they share in common. There are different types of JOINS and each is unique based on the rows needed from the different tables. The joins include;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;INNER JOIN&lt;/strong&gt; - returns only the rows that have matching values in both tables and row without a match are excluded from the result. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LEFT JOIN&lt;/strong&gt; (or LEFT OUTER JOIN) - Returns all rows from the left table plus matching rows from the right table. If no match exists, it returns NULL for columns from the right table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RIGHT JOIN&lt;/strong&gt; (or RIGHT OUTER JOIN) - Returns all rows from the right table + matching rows from the left table.
Opposite of LEFT JOIN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FULL OUTER JOIN&lt;/strong&gt; (or FULL JOIN) - returns all rows from both tables. Matches where possible and puts NULL where there is no match.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Window Functions vs GROUP BY – What is the Difference?
&lt;/h2&gt;

&lt;p&gt;SQL window functions and GROUP BY both perform calculations across related rows, but they solve different problems. GROUP BY summarises data by collapsing rows into one result per group, while Window Functions calculate values across a set of rows without removing the original row details. GROUP BY is commonly used for aggregation and reporting while Window Functions are for analysis while keeping detail. They let you calculate things like rank, totals, averages and still show each original row.&lt;/p&gt;

&lt;p&gt;With GROUP BY, the output becomes smaller because rows are combined into groups. That means you usually cannot select non-grouped columns unless they are aggregated too. With window functions, the output keeps the same number of rows as the input, because the calculation is attached to each row using OVER(...). This makes it useful when you want both the row detail and the aggregated context in the same result.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Functions Every Beginner Should Know
&lt;/h2&gt;

&lt;p&gt;Here are the five functions I recommend learning first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ROUND(number, decimals) - Rounds numbers cleanly.
ROUND(mark, 2) → 87.345 becomes 87.35&lt;/li&gt;
&lt;li&gt;CONCAT() or || (PostgreSQL string concatenation)Joins text together.first_name || ' ' || last_name → “John Smith”&lt;/li&gt;
&lt;li&gt;TO_CHAR(date, format) Formats dates beautifully.TO_CHAR(exam_date, 'Day, DDth Month YYYY') → “Friday, 15th March 2024”&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>sql</category>
      <category>analytics</category>
      <category>beginners</category>
    </item>
    <item>
      <title>SQL Fundamentals: DDL vs DML and Essential Commands</title>
      <dc:creator>James Njoroge</dc:creator>
      <pubDate>Sun, 12 Apr 2026 14:51:32 +0000</pubDate>
      <link>https://forem.com/jamesnjrg/sql-fundamentals-ddl-vs-dml-and-essential-commands-g48</link>
      <guid>https://forem.com/jamesnjrg/sql-fundamentals-ddl-vs-dml-and-essential-commands-g48</guid>
      <description>&lt;p&gt;SQL (Structured Query Language) is the standard language for managing and manipulating data in relational databases. Two of the most important categories in SQL are DDL (Data Definition Language) and DML (Data Manipulation Language). Understanding the difference between them is essential for anyone working with databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  DDL vs DML: What’s the Difference?
&lt;/h2&gt;

&lt;p&gt;DDL (Data Definition Language) defines the structure of the database. It deals with creating, modifying, and deleting database objects such as tables, indexes, views, and schemas. DDL commands are typically used during the design and setup phase of a database.&lt;br&gt;
Common DDL commands include:&lt;/p&gt;

&lt;p&gt;CREATE – Creates new database objects&lt;br&gt;
ALTER – Modifies existing database objects&lt;br&gt;
DROP – Deletes database objects&lt;br&gt;
TRUNCATE – Removes all data from a table but keeps the structure&lt;/p&gt;

&lt;p&gt;DML (Data Manipulation Language), on the other hand, is used to manage the actual data stored inside the database objects. DML commands allow you to add, modify, retrieve, and remove records.&lt;br&gt;
Common DML commands include:&lt;/p&gt;

&lt;p&gt;INSERT – Adds new records (rows) into a table&lt;br&gt;
UPDATE – Modifies existing records&lt;br&gt;
DELETE – Removes records&lt;br&gt;
SELECT – Retrieves data&lt;/p&gt;

&lt;p&gt;The major difference between DDL and DML is DDL changes the schema (how the data is organised), while DML works with the data itself. DDL commands usually involve more permanent changes and often require higher privileges. In many database systems, DDL statements implicitly commit the transaction, whereas DML statements can be rolled back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using DDL and DML
&lt;/h2&gt;

&lt;p&gt;Below are examples of how to practically use DDL and DML commands&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CREATE (DDL)
The CREATE statement is used to define the table structures.&lt;/li&gt;
&lt;/ol&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%2Fi9vaahl8q4nbvpnmbg5w.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%2Fi9vaahl8q4nbvpnmbg5w.png" alt="A Create Statement in SQL" width="800" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;INSERT (DML)
Once the table is created, it is possible to add data into it.
&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%2Fim1g7w59vt3qbau4sb5b.png" alt="An Insert Statement in SQL" width="800" height="137"&gt;
&lt;/li&gt;
&lt;li&gt;UPDATE (DML)
After data is added in the table it is then possible to correct or update the records.
&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%2Fvi3nn9w4lsz1thsdur2n.png" alt="An Update Statement in SQL" width="800" height="88"&gt;
&lt;/li&gt;
&lt;li&gt;DELETE (DML)
Used to clean up data which is no longer in use.&lt;/li&gt;
&lt;/ol&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%2Fcu0t4ojq7t9hyjnomcwm.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%2Fcu0t4ojq7t9hyjnomcwm.png" alt="A Delete Statement in SQL" width="800" height="39"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Filtering Data with the WHERE Clause
&lt;/h2&gt;

&lt;p&gt;One of the most powerful features in SQL is the ability to filter rows using the WHERE clause. It works with SELECT, UPDATE, and DELETE statements to specify which rows should be affected. Common comparison operators used with WHERE:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;= (equals) -  Exact match &lt;/li&gt;
&lt;li&gt; &amp;gt;,&amp;lt;=,&amp;lt;,&amp;gt;= (comparison operators)&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;BETWEEN&lt;/strong&gt; - Checks if a value falls within a range&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;IN&lt;/strong&gt; - Checks if a value matches any in a list&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;LIKE&lt;/strong&gt; - Pattern matching(usually with wildcards %)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Transforming Data with CASE WHEN
&lt;/h2&gt;

&lt;p&gt;The CASE WHEN expression is SQL’s way of doing if-then-else logic inside your queries. It’s very useful when you want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create new columns based on conditions&lt;/li&gt;
&lt;li&gt;Categorise your data (e.g., “Good”, “Average”, “Poor”)&lt;/li&gt;
&lt;li&gt;Clean or transform data without modifying the original table&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is an example of using CASE WHEN &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%2Fe700plr8k61mb35kvavz.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%2Fe700plr8k61mb35kvavz.png" alt="CASE WHEN SQL" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Mastering DDL and DML, along with filtering techniques (WHERE) and conditional logic (CASE WHEN), provides a strong foundation for working with relational databases. DDL lets you build the house, DML lets you furnish and maintain it, WHERE helps you find exactly what you need, and CASE WHEN allows you to reshape the data intelligently.&lt;/p&gt;

&lt;p&gt;Whether you're a student, aspiring data analyst, or backend developer, becoming comfortable with these SQL fundamentals will significantly boost your productivity and understanding of how data is managed behind the scenes.&lt;/p&gt;

&lt;p&gt;I have found the use of CASE WHEN the most interesting part of this week's learning as it not only filters through large tables but it also creates new columns with the stated new categories.  &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>sql</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Excel is Used in Real-World Data Analysis</title>
      <dc:creator>James Njoroge</dc:creator>
      <pubDate>Wed, 25 Mar 2026 12:31:53 +0000</pubDate>
      <link>https://forem.com/jamesnjrg/how-excel-is-used-in-real-world-data-analysis-18j1</link>
      <guid>https://forem.com/jamesnjrg/how-excel-is-used-in-real-world-data-analysis-18j1</guid>
      <description>&lt;p&gt;Excel is a grid-based spreadsheet application developed by Microsoft for organizing, analyzing and storing data. Excel is very dynamic and provides users with a variety of functions allowing them to perform calculations using formulas, visualise data through charts and pivot tables and manage large datasets. It is used widely for business, finance and personal use alike.&lt;/p&gt;

&lt;p&gt;One of the main uses of excel is data entry and data storage where users can store raw data over a period of time and from which they can be able to automate complex calculations, visualise trends and analyze data to get insights. An example of use of excel is a restaurant keeping a record of their daily sales from which they can be able to get insights of their revenue, profit margins, best selling meals, weekly and monthly sales. The analysis can then be used by management to make crucial decisions based on trends. Below is a an example of an excel worksheet which shows a record of sales in a few restaurant chains.&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%2F1khjj9sjdli4qkgvtwec.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%2F1khjj9sjdli4qkgvtwec.png" alt=" " width="652" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Excel uses arithmetic expressions which are formulas that calculate numerical values using basic operators like + (add), - (Subtract), * (Multiply), / (Divide). Every formula must begin with an equal sign (=) which enables you to use both raw numbers and cell references. Cell reference refers to the column number followed by the row number with no space in between (A1) which would refer to the first column and the first row and it is Order ID according to the spreadsheet above. To get more insights from large datasets it is possible to use Math functions like MIN, MAX, SUM, AVERAGE.&lt;/p&gt;

&lt;p&gt;Excel Math functions have syntax which always starts with an equals sign and includes a range of cells which can be easily highlighted e.g =AVERAGE(D1:D28) which returns the mean of column D. =MAX(E1:E28) would bring back the highest number in the Quantity column which indicates the largest value and it the product the most sales.&lt;/p&gt;

&lt;p&gt;Apart from arithmetic functions one can also create pivot tables and pivot charts from the worksheet which are useful in visualising trends that are clear to all stakeholders. Below is an example of a line chart derived from the dataset above and it visualises how increase in price items leading to a sharp decline in items sold as the price increases past 20€.&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%2F4j3xytv73ef8n7rvkqmk.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%2F4j3xytv73ef8n7rvkqmk.png" alt=" " width="462" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Learning excel thus far, has been eye opening after seeing how an easily accessible tool can be so useful and powerful in various ways depending on the end-users needs which can range from personal use to small business and even financial institutions. &lt;/p&gt;

</description>
      <category>data</category>
      <category>datascience</category>
      <category>microsoft</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
