<?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: Raphael Njeri</title>
    <description>The latest articles on DEV Community by Raphael Njeri (@raphael_njeri_7f67f81f527).</description>
    <link>https://dev.to/raphael_njeri_7f67f81f527</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3972373%2F855e1e77-36e7-4e91-98e7-7abb8e0fac7d.jpg</url>
      <title>DEV Community: Raphael Njeri</title>
      <link>https://dev.to/raphael_njeri_7f67f81f527</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raphael_njeri_7f67f81f527"/>
    <language>en</language>
    <item>
      <title>Understanding SQL Window Functions</title>
      <dc:creator>Raphael Njeri</dc:creator>
      <pubDate>Mon, 21 Sep 2026 16:39:31 +0000</pubDate>
      <link>https://dev.to/raphael_njeri_7f67f81f527/understanding-sql-window-functions-359f</link>
      <guid>https://dev.to/raphael_njeri_7f67f81f527/understanding-sql-window-functions-359f</guid>
      <description>&lt;p&gt;When I first came across SQL window functions, I found them a bit confusing. I was already comfortable with basic queries, filtering data, using GROUP BY, and calculating things like totals and averages. Window functions looked different because they allowed me to perform calculations without losing the individual rows.&lt;/p&gt;

&lt;p&gt;As I practiced them, I started to understand that window functions are mainly useful when I want to analyse a row while also looking at other related rows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a window function?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A window function performs a calculation across a set of rows while keeping the original rows in the result.&lt;/p&gt;

&lt;p&gt;For example, I can calculate the average salary in each department:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    department,&lt;br&gt;
    salary,&lt;br&gt;
    AVG(salary) OVER (PARTITION BY department) AS department_average&lt;br&gt;
FROM employees;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The interesting part for me is that I still get every employee in the result. SQL adds the department average alongside each employee's information.&lt;/p&gt;

&lt;p&gt;This is different from using &lt;strong&gt;GROUP BY.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Window Functions vs GROUP BY&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before learning window functions, I would use &lt;em&gt;GROUP BY&lt;/em&gt; when I wanted a calculation for each group.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;em&gt;SELECT&lt;br&gt;
    department,&lt;br&gt;
    AVG(salary) AS average_salary&lt;br&gt;
FROM employees&lt;br&gt;
GROUP BY department;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This gives me the average salary for each department, but I no longer have the individual employee records in the result.&lt;/p&gt;

&lt;p&gt;With a window function:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    department,&lt;br&gt;
    salary,&lt;br&gt;
    AVG(salary) OVER (PARTITION BY department) AS average_salary&lt;br&gt;
FROM employees;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I get both the employee information and the department average.&lt;/p&gt;

&lt;p&gt;This was one of the things that helped me understand why window functions are useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does PARTITION BY do?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PARTITION BY was another part that I needed to understand properly.&lt;/p&gt;

&lt;p&gt;I understood it as dividing the data into groups before the calculation is performed.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    department,&lt;br&gt;
    salary,&lt;br&gt;
    AVG(salary) OVER (PARTITION BY department) AS department_average&lt;br&gt;
FROM employees;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here, the employees are separated according to their department, and the average is calculated within each department.&lt;/p&gt;

&lt;p&gt;So if I have Finance, Sales and IT departments, each department gets its own average.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ranking rows with ROW_NUMBER()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the practical examples I worked with was ranking records.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ROW_NUMBER()&lt;/code&gt; gives each row a number based on the order I specify.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    salary,&lt;br&gt;
    ROW_NUMBER() OVER (ORDER BY salary DESC) AS row_number&lt;br&gt;
FROM employees&lt;/em&gt;;&lt;/p&gt;

&lt;p&gt;Since I used &lt;code&gt;ORDER BY salary DESC&lt;/code&gt;, the employee with the highest salary gets number 1.&lt;/p&gt;

&lt;p&gt;I can also rank employees separately within each department:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    department,&lt;br&gt;
    salary,&lt;br&gt;
    ROW_NUMBER() OVER (&lt;br&gt;
        PARTITION BY department&lt;br&gt;
        ORDER BY salary DESC&lt;br&gt;
    ) AS department_rank&lt;br&gt;
FROM employees;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now the ranking starts again from 1 for every department.&lt;/p&gt;

&lt;p&gt;This showed me how &lt;strong&gt;PARTITION BY&lt;/strong&gt; and &lt;strong&gt;ORDER BY&lt;/strong&gt; can work together inside a window function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between RANK() and ROW_NUMBER()?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I also learned that &lt;code&gt;ROW_NUMBER()&lt;/code&gt; is not the same as &lt;code&gt;RANK()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, if two employees have the same salary, ROW_NUMBER() will still give them different numbers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    salary,&lt;br&gt;
    ROW_NUMBER() OVER (ORDER BY salary DESC) AS row_number&lt;br&gt;
FROM employees;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The result could look like:&lt;/p&gt;

&lt;p&gt;employee     salary     row_number&lt;br&gt;
John         80000      1&lt;br&gt;
Mary         80000      2&lt;br&gt;
Peter        70000      3&lt;/p&gt;

&lt;p&gt;With RANK():&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    employee_name,&lt;br&gt;
    salary,&lt;br&gt;
    RANK() OVER (ORDER BY salary DESC) AS salary_rank&lt;br&gt;
FROM employees;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The two employees with the same salary can receive the same rank:&lt;/p&gt;

&lt;p&gt;employee     salary     salary_rank&lt;br&gt;
John         80000      1&lt;br&gt;
Mary         80000      1&lt;br&gt;
Peter        70000      3&lt;/p&gt;

&lt;p&gt;The difference became clearer to me when I looked at actual examples instead of just reading the definitions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using LAG() to compare rows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another window function I learned was LAG().&lt;/p&gt;

&lt;p&gt;LAG() allows me to look at a value from a previous row.&lt;/p&gt;

&lt;p&gt;For example, if I have daily sales:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    sale_date,&lt;br&gt;
    amount,&lt;br&gt;
    LAG(amount) OVER (ORDER BY sale_date) AS previous_amount&lt;br&gt;
FROM sales;&lt;/em&gt;&lt;br&gt;
The result could be:&lt;/p&gt;

&lt;p&gt;sale_date    amount    previous_amount&lt;br&gt;
2026-01-01   500       NULL&lt;br&gt;
2026-01-02   700       500&lt;br&gt;
2026-01-03   450       700&lt;/p&gt;

&lt;p&gt;This means I can compare the current value with the previous value.&lt;/p&gt;

&lt;p&gt;I can even calculate the difference:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    sale_date,&lt;br&gt;
    amount,&lt;br&gt;
    LAG(amount) OVER (ORDER BY sale_date) AS previous_amount,&lt;br&gt;
    amount - LAG(amount) OVER (ORDER BY sale_date) AS difference&lt;br&gt;
FROM sales;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I found this useful because it showed me how SQL can be used to analyse changes between records instead of just producing totals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What about LEAD()?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LEAD() works in a similar way to LAG(), but instead of looking at the previous row, it looks at a following row.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    sale_date,&lt;br&gt;
    amount,&lt;br&gt;
    LEAD(amount) OVER (ORDER BY sale_date) AS next_amount&lt;br&gt;
FROM sales;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So if LAG() looks backwards, I can think of LEAD() as looking forward.&lt;/p&gt;

&lt;p&gt;This makes them useful when comparing values across different rows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calculating a running total&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I also learned that window functions can be used to calculate running totals.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;SELECT&lt;br&gt;
    sale_date,&lt;br&gt;
    amount,&lt;br&gt;
    SUM(amount) OVER (ORDER BY sale_date) AS running_total&lt;br&gt;
FROM sales&lt;/em&gt;;&lt;/p&gt;

&lt;p&gt;If my sales were:&lt;/p&gt;

&lt;p&gt;sale_date    amount&lt;br&gt;
Jan 1        500&lt;br&gt;
Jan 2        300&lt;br&gt;
Jan 3        700&lt;/p&gt;

&lt;p&gt;The running total would become:&lt;/p&gt;

&lt;p&gt;sale_date    amount    running_total&lt;br&gt;
Jan 1        500       500&lt;br&gt;
Jan 2        300       800&lt;br&gt;
Jan 3        700       1500&lt;/p&gt;

&lt;p&gt;This is different from simply calculating the total sales because I can see how the total changes as I move through the records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding the OVER() clause&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing I had to get used to was the &lt;code&gt;OVER()&lt;/code&gt; clause.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;RANK() OVER (&lt;br&gt;
    PARTITION BY department&lt;br&gt;
    ORDER BY salary DESC&lt;br&gt;
)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At first, this looked like a lot of SQL in one place. Breaking it down made it easier:&lt;/p&gt;

&lt;p&gt;RANK() tells SQL what calculation I want.&lt;br&gt;
OVER() tells SQL that I am using a window.&lt;br&gt;
PARTITION BY department separates the records by department.&lt;br&gt;
ORDER BY salary DESC determines the order within each department.&lt;/p&gt;

&lt;p&gt;Once I understood what each part was doing, the queries became much easier to read.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where I can use window functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After practicing window functions, I can see how they can be useful in real data analysis.&lt;/p&gt;

&lt;p&gt;For example, I could use them to:&lt;/p&gt;

&lt;p&gt;-Rank customers according to their purchases.&lt;br&gt;
-Find the highest-paid employee in each department.&lt;br&gt;
-Compare current sales with previous sales.&lt;br&gt;
-Calculate running totals.&lt;br&gt;
-Calculate averages while keeping individual records.&lt;br&gt;
-Analyse changes in data over time.&lt;/p&gt;

&lt;p&gt;This makes window functions useful when I need more information than a simple &lt;code&gt;GROUP BY&lt;/code&gt; query can provide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I found challenging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The main challenge for me was understanding how the different parts of a window function work together.&lt;/p&gt;

&lt;p&gt;I initially focused on the function itself, such as RANK() or LAG(), without paying much attention to what was inside OVER().&lt;/p&gt;

&lt;p&gt;After practicing, I realised that the function and the window definition work together. The &lt;code&gt;PARTITION BY&lt;/code&gt; determines the group I am working within, while &lt;code&gt;ORDER BY&lt;/code&gt; determines how the rows are arranged for the calculation.&lt;/p&gt;

&lt;p&gt;That made a big difference in how I understood the topic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I understood from this session&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The biggest thing I learned is that window functions allow me to perform calculations across related rows without removing the individual records.&lt;/p&gt;

&lt;p&gt;I also learned that different functions are useful for different situations. ROW_NUMBER() and RANK() can be used for ranking, LAG() and LEAD() can help compare rows, while functions such as SUM() and AVG() can be used for calculations across a window.&lt;/p&gt;

&lt;p&gt;More importantly, I now understand why I would choose a window function instead of &lt;code&gt;GROUP BY&lt;/code&gt; in some situations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Window functions were one of the SQL topics that took me some time to understand, but working through practical examples made them clearer.&lt;/p&gt;

&lt;p&gt;I can now use functions such as ROW_NUMBER(), RANK(), LAG(), LEAD(), SUM() and AVG() with OVER() to analyse data while keeping the original records.&lt;/p&gt;

&lt;p&gt;I still have more to learn about window functions, but I now have a good understanding of the basic concept and how they can be applied when working with data.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>sql</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Python Basics: My First Steps into Python</title>
      <dc:creator>Raphael Njeri</dc:creator>
      <pubDate>Mon, 07 Sep 2026 15:48:36 +0000</pubDate>
      <link>https://dev.to/raphael_njeri_7f67f81f527/python-basics-my-first-steps-into-python-2pm9</link>
      <guid>https://dev.to/raphael_njeri_7f67f81f527/python-basics-my-first-steps-into-python-2pm9</guid>
      <description>&lt;p&gt;When I started learning Python, I initially thought programming was mostly about memorizing different commands and writing code that works. As I started practicing, I realized that it is more about understanding how information is stored, changed and used by a program.&lt;/p&gt;

&lt;p&gt;In this session, I focused on the basics of Python. The main areas I covered were variables, data types, input and output, comments, and basic Python syntax. These may look like simple concepts, but they form the foundation for everything I will be doing with Python later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Python?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the things that interested me about Python is how readable the code is. Compared with some programming languages, Python does not require a lot of complicated syntax to perform simple tasks.&lt;br&gt;
Python is also widely used in data analysis and data science, which is one of the reasons I am interested in learning it. Since my goal is to work with data, understanding Python gives me another tool for analyzing and solving problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where do I start with Python?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first thing I needed to understand was how to write a simple Python statement.&lt;/p&gt;

&lt;p&gt;One of the easiest examples is:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print("Hello, World!")&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The print() function displays information in the output.&lt;/p&gt;

&lt;p&gt;I can also use it to display a calculation:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print(10 + 5)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This helped me understand that Python can do more than simply display text. It can also perform operations and return a result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a variable?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A variable is a name that I give to a piece of information so that I can use it later in my program.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;name = "Raphael"&lt;br&gt;
age = 28&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here, name contains "Raphael" while age contains 28.&lt;/p&gt;

&lt;p&gt;I can then use the variables instead of repeatedly writing the actual values:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print(name)&lt;br&gt;
print(age)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Raphael&lt;br&gt;
28&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The = sign in this case is used to assign a value to a variable.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;course = "Data Science"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I understood this as Python taking the value "Data Science" and assigning it to the variable course.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are data types?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not all information stored in Python is the same. Python has different data types depending on the kind of value I am working with.&lt;/p&gt;

&lt;p&gt;Some of the basic ones I learned are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Integer (int)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An integer is a whole number.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;age = 28&lt;br&gt;
units = 19&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;2. Float (float)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A float is a number that contains a decimal.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;price = 500.50&lt;br&gt;
height = 1.74&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;3. String (str)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A string is text.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;name = "Raphael"&lt;br&gt;
course = "Python"&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;4. Boolean (bool)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Boolean has only two possible values:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;is_active = True&lt;br&gt;
is_complete = False&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I can check the type of a value using type().&lt;/p&gt;

&lt;p&gt;age = 28&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print(type(age))&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The output is:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(class 'int')&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Another example:&lt;/p&gt;

&lt;p&gt;name = "Raphael"&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print(type(name))&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;em&gt;(class 'str')&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This was important for me because I learned that Python needs to know what kind of data it is working with.&lt;/p&gt;

&lt;p&gt;What is the difference between a string and a number?&lt;/p&gt;

&lt;p&gt;This was one of the areas I had to pay attention to.&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;age = 28&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here, age is an integer.&lt;/p&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;age = "28"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here, age is a string because 28 is inside quotation marks.&lt;/p&gt;

&lt;p&gt;Although both appear to contain 28, Python treats them differently.&lt;/p&gt;

&lt;p&gt;I can confirm this using:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print(type(age))&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This made me understand why data types matter when writing programs, especially when calculations are involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can a Python program receive information?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python provides the input() function for receiving information from a user.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;_name = input("What is your name? ")&lt;/p&gt;

&lt;p&gt;print(name)&lt;/p&gt;

&lt;p&gt;If I enter:&lt;/p&gt;

&lt;p&gt;Raphael&lt;/p&gt;

&lt;p&gt;Python stores the response in the name variable.&lt;/p&gt;

&lt;p&gt;I can then use it somewhere else in the program.&lt;/p&gt;

&lt;p&gt;_name = input("What is your name? ")&lt;/p&gt;

&lt;p&gt;print("Welcome", name)_&lt;/p&gt;

&lt;p&gt;The important thing I learned here is that input() normally gives me a string.&lt;br&gt;
Therefore, if I ask someone to enter their age:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;age = input("Enter your age: ")&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;the value is treated as text.&lt;/p&gt;

&lt;p&gt;If I need it as a number, I can convert it:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;age = int(input("Enter your age: "))&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The int() converts the input into an integer.&lt;/p&gt;

&lt;p&gt;Putting the concepts together&lt;/p&gt;

&lt;p&gt;After learning variables, data types, input and output, I tried combining them into a small program.&lt;/p&gt;

&lt;p&gt;_name = input("Enter your name: ")&lt;br&gt;
age = int(input("Enter your age: "))&lt;br&gt;
course = input("Enter the course you are studying: ")&lt;/p&gt;

&lt;p&gt;print("Name:", name)&lt;br&gt;
print("Age:", age)&lt;br&gt;
print("Course:", course)_&lt;/p&gt;

&lt;p&gt;If I enter:&lt;/p&gt;

&lt;p&gt;Enter your name: Raphael&lt;br&gt;
Enter your age: 28&lt;br&gt;
Enter the course you are studying: Data Science&lt;/p&gt;

&lt;p&gt;The program displays:&lt;/p&gt;

&lt;p&gt;Name: Raphael&lt;br&gt;
Age: 28&lt;br&gt;
Course: Data Science&lt;/p&gt;

&lt;p&gt;This simple example helped me see how the different concepts connect.&lt;/p&gt;

&lt;p&gt;The program receives information, stores it in variables, converts the age to an integer, and finally displays the information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are comments used for?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I also learned that I can add notes to my code without affecting the way the program runs.&lt;/p&gt;

&lt;p&gt;A comment starts with #.&lt;/p&gt;

&lt;h1&gt;
  
  
  Store the student's name
&lt;/h1&gt;

&lt;p&gt;name = "Raphael"&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print(name)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Python ignores the comment when running the program.&lt;/p&gt;

&lt;p&gt;I found comments useful because when code becomes longer, they can help me remember what a particular section is meant to do.&lt;/p&gt;

&lt;p&gt;A small example from my learning&lt;/p&gt;

&lt;p&gt;I can use what I have learned to create a simple personal information program:&lt;/p&gt;

&lt;p&gt;name = "Raphael"&lt;br&gt;
age = 28&lt;br&gt;
course = "Data Science"&lt;br&gt;
completed_excel = True&lt;/p&gt;

&lt;p&gt;&lt;em&gt;print("Name:", name)&lt;br&gt;
print("Age:", age)&lt;br&gt;
print("Course:", course)&lt;br&gt;
print("Completed Excel:", completed_excel&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;Here I am using different data types in the same program:&lt;/p&gt;

&lt;p&gt;name → string&lt;br&gt;
age → integer&lt;br&gt;
course → string&lt;br&gt;
completed_excel → Boolean&lt;/p&gt;

&lt;p&gt;This was a simple exercise, but it helped me understand that a Python program can work with different types of information at the same time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I understood from this session&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before this session, I could look at Python code and understand some of the words, but I did not fully understand how the different pieces fitted together.&lt;/p&gt;

&lt;p&gt;After practicing, I now understand that a basic Python program can start with information being stored in variables. Each value has a data type, and I can use functions such as input() and print() to interact with the user.&lt;/p&gt;

&lt;p&gt;I also learned that small details matter. For example, "28" and 28 may look similar to me, but Python treats them as different types of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges I encountered&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My biggest challenge was getting comfortable with the syntax and understanding why Python sometimes treats values differently.&lt;br&gt;
I also had to understand that simply writing code is not enough. I need to understand what each line is doing.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;age = int(input("Enter your age: "))&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At first, this can look like one complicated line. After breaking it down, I understood that:&lt;/p&gt;

&lt;p&gt;input() asks the user for information.&lt;br&gt;
The information received is initially text.&lt;br&gt;
int() converts that text into an integer.&lt;br&gt;
The result is stored in the age variable.&lt;/p&gt;

&lt;p&gt;Breaking code into smaller parts made it much easier for me to understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why these basics matter to me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The concepts from this session are important because they will be used throughout my Python learning.&lt;br&gt;
When I start working with datasets, I will need to understand what type of information I am dealing with. For example, a customer's name will be text, an age will normally be an integer, and a price may be a float.&lt;br&gt;
I therefore see Python basics as the foundation for the more advanced topics I will learn later, including conditionals, loops, functions and data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This session gave me my starting point in Python. I learned how to create variables, identify basic data types, receive information using input(), display results using print(), and add comments to my code.&lt;br&gt;
The most important lesson for me was not just learning the commands, but understanding what is happening when the code runs.&lt;br&gt;
I now have a better foundation to continue with Python and gradually move from writing simple programs to using Python to solve real data-related problems.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Relationship Schemas and Joins in Data Modeling</title>
      <dc:creator>Raphael Njeri</dc:creator>
      <pubDate>Sun, 05 Jul 2026 17:32:37 +0000</pubDate>
      <link>https://dev.to/raphael_njeri_7f67f81f527/relationship-schemas-and-joins-in-data-modeling-55pe</link>
      <guid>https://dev.to/raphael_njeri_7f67f81f527/relationship-schemas-and-joins-in-data-modeling-55pe</guid>
      <description>&lt;p&gt;This week I learned about relationship schemas and joins, and I now understand why they are important when working with databases. Before this topic, I thought all the data could just be stored in one table, but I have realized that this is not the best approach because it creates a lot of repeated information and makes the database harder to manage.&lt;/p&gt;

&lt;p&gt;From what I have understood, a relationship schema is simply the way different tables in a database are connected. Instead of putting everything in one table, the data is separated into different tables depending on what it represents. For example, students, teachers, and payments can each have their own table, and then they are linked using IDs. This makes the data more organized and easier to update.&lt;/p&gt;

&lt;p&gt;I also learned that there are different types of relationships. A one-to-one relationship is where one record is connected to only one other record. A one-to-many relationship is the one I found easiest to understand because one teacher can teach many students, but each student is assigned to only one teacher. There is also a many-to-many relationship where one student can take several courses and one course can have many students. In such a case, another table is needed to connect the two.&lt;/p&gt;

&lt;p&gt;Another concept I learned is joins. Joins are used when information is stored in different tables but we want to see it together. The INNER JOIN only shows records that match in both tables. The LEFT JOIN returns everything from the first table even if there is no matching record in the second table. The RIGHT JOIN does the opposite, while the FULL OUTER JOIN returns all records from both tables whether they match or not.&lt;/p&gt;

&lt;p&gt;As I continue practicing data modeling and using Power BI, I can now see why relationship schemas and joins are necessary. They help in creating a proper data model instead of using one flat table. This makes reports more accurate, reduces duplicated data, and makes it easier to analyze information. Although I still need more practice, I now have a much better understanding of how tables relate to each other and how joins help retrieve data from those related tables.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>learning</category>
      <category>sql</category>
    </item>
    <item>
      <title>How excel is used in real world Data analysis.</title>
      <dc:creator>Raphael Njeri</dc:creator>
      <pubDate>Sun, 07 Jun 2026 10:54:16 +0000</pubDate>
      <link>https://dev.to/raphael_njeri_7f67f81f527/how-excel-is-used-in-real-world-data-analysis-lk5</link>
      <guid>https://dev.to/raphael_njeri_7f67f81f527/how-excel-is-used-in-real-world-data-analysis-lk5</guid>
      <description>&lt;p&gt;Microsoft Excel is a spreadsheet software used to organize, calculate, analyze and visualize data. As I begin my journey in Data Science and Analytics, I have discovered that Excel is much more than just a spreadsheet application. It is a powerful tool that helps transform raw data into meaningful information.&lt;/p&gt;

&lt;p&gt;One of the first things I learned is how Excel helps with data entry and organization. Data can be arranged neatly in rows and columns making it easier to manage records, track information, and maintain accuracy. Proper organization is important because it makes data easier to understand and work with.&lt;/p&gt;

&lt;p&gt;I also learned the importance of data cleaning. In many cases raw data contains errors, duplicates, or missing information. Excel provides useful tools such as Find and Replace, Remove Duplicates, Text to Columns and Filters that make it easier to clean and prepare data for analysis.&lt;/p&gt;

&lt;p&gt;Another key lesson has been data analysis. Excel offers a variety of formulas and functions including SUM, AVERAGE, COUNT, MAX, MIN and IF, which help perform calculations and uncover insights from data. These tools make it possible to identify trends, measure performance, and support decision-making.&lt;/p&gt;

&lt;p&gt;From my experience so far, Excel has shown me that no matter how data is collected, it becomes much easier to clean, organize and analyze when using the right Excel tools. It is an essential skill for anyone starting a career in Data Science and Analytics.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
