<?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 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>
