<?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: susan njeri</title>
    <description>The latest articles on Forem by susan njeri (@nj3r1).</description>
    <link>https://forem.com/nj3r1</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%2F3709621%2Fadb5d1d3-ea64-4143-a9a3-59aa9cbf54ca.png</url>
      <title>Forem: susan njeri</title>
      <link>https://forem.com/nj3r1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nj3r1"/>
    <language>en</language>
    <item>
      <title>Connecting Power BI to a SQL Database</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Fri, 27 Mar 2026 09:16:24 +0000</pubDate>
      <link>https://forem.com/nj3r1/connecting-power-bi-to-a-sql-database-287o</link>
      <guid>https://forem.com/nj3r1/connecting-power-bi-to-a-sql-database-287o</guid>
      <description>&lt;h3&gt;
  
  
  Introduction: Power BI and the Role of SQL Databases
&lt;/h3&gt;

&lt;p&gt;Power BI is used across industries retail companies use it to track product performance, healthcare organizations use it to monitor patient outcomes, financial firms use it for risk reporting, and logistics companies use it to optimize supply chains. It is one of the most widely deployed analytics tools in the world, and proficiency with it is one of the most sought after skills for data analysts and business intelligence professionals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting Power BI to a Local PostgreSQL Database
&lt;/h2&gt;

&lt;p&gt;Before working with cloud databases, it is valuable to understand how to connect Power BI to a local PostgreSQL instance running on your own machine. &lt;br&gt;
The process begins with opening Power BI Desktop. On the Home ribbon, you will see the Get Data button this is the entry point for connecting to any data source.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Open Power BI Desktop and Click Get Data
&lt;/h3&gt;

&lt;p&gt;When you launch Power BI Desktop, you are presented with the welcome screen. To begin connecting to your database, click the Get Data button in the Home ribbon at the op of the screen.&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%2Fykqapd9j8h0sjdau22oh.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%2Fykqapd9j8h0sjdau22oh.png" alt=" " width="766" height="743"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Select PostgreSQL Database from the Get Data Dialog
&lt;/h3&gt;

&lt;p&gt;After clicking Get Data, a dialog window appears listing all available data connectors. Power BI supports over 100 data sources from Excel files and CSVs to enterprise databases and cloud APIs. To connect to PostgreSQL, click on the Database category in the left panel, then scroll through the list and select PostgreSQL Database. Click Connect to proceed.&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%2F9xql0nze5381y0wp4v75.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%2F9xql0nze5381y0wp4v75.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Enter the Server Name and Database Details
&lt;/h3&gt;

&lt;p&gt;Once you select PostgreSQL Database and click Connect, a connection dialog appears. This dialog requires two key pieces of information: the server name and the database name&lt;/p&gt;

&lt;h4&gt;
  
  
  Install the PostgreSQL ODBC Driver (Required for Both)
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt; Go to: &lt;a href="https://www.postgresql.org/ftp/odbc/versions/msi/" rel="noopener noreferrer"&gt;https://www.postgresql.org/ftp/odbc/versions/msi/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Download psqlODBC — get the x64 (64-bit) version&lt;/li&gt;
&lt;li&gt; Install it like a normal Windows program
Without this driver, Power BI won't even show PostgreSQL as a data source option.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Connecting to Localhost PostgreSQL
&lt;/h2&gt;

&lt;p&gt;The database is connected and runs locally on my machine, the server is usually localhost.The database name will be postgres and you will see when the connection starts.The graphical tool, pg4Admin 4 is used in managing and development of the PostgreSQL databases.&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%2F299mm717x80vqjzxmdyq.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%2F299mm717x80vqjzxmdyq.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The server name host will be – localhost&lt;br&gt;
username – postgres&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting to Aiven PostgreSQL
&lt;/h3&gt;

&lt;p&gt;While a local database is ideal for development, real world analytics almost always involves cloud databases. Cloud hosted databases offer critical advantages: they are accessible from anywhere, they scale automatically as data grows, they include built in backup and recovery, and they support multiple simultaneous connections from different tools and team members.&lt;/p&gt;

&lt;p&gt;Connecting Power BI to Aiven PostgreSQL follows a similar process to a local connection, with one important addition: SSL certificate authentication.&lt;/p&gt;

&lt;p&gt;Step 1: Get Your Aiven Connection Details&lt;br&gt;
Log in to console.aiven.io, open your PostgreSQL service, and note:&lt;br&gt;
• Host — pg-3ae2ac09-susanjeri4717-1f9e.c.aivencloud.com&lt;br&gt;
• Port — 25837&lt;br&gt;
• Database —  defaultdb&lt;br&gt;
• Username — avnadmin&lt;br&gt;
• Password — from the Aiven console&lt;br&gt;
• SSL Certificate — download the ca.pem file from the service page&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%2F7a7a2p63jklakjd1m3yw.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%2F7a7a2p63jklakjd1m3yw.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: In Power BI Desktop&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Home → Get Data → More… → PostgreSQL → Connect&lt;/li&gt;
&lt;li&gt; Fill in the server field as:&lt;/li&gt;
&lt;li&gt; Enter your Database name&lt;/li&gt;
&lt;li&gt; Click OK&lt;/li&gt;
&lt;li&gt; Choose Database authentication → enter Aiven username &amp;amp; password&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%2Fy1522tej40ohlale3182.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%2Fy1522tej40ohlale3182.png" alt=" " width="702" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Handle SSL &lt;br&gt;
Power BI's PostgreSQL connector supports SSL but may not ask you for the certificate directly in the GUI. If the connection fails with an SSL error, you have two options: using an ODBC DSN connection or Setting SSL mode via connection. We will use option A which is;&lt;/p&gt;

&lt;p&gt;Use an ODBC DSN connection :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Open ODBC Data Source Administrator &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%2Fd8vldtsmmzsi2us2sqpz.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%2Fd8vldtsmmzsi2us2sqpz.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Add a new System DSN → choose PostgreSQL Unicode&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%2F9wg0nr7dcpzh6tlqcsl7.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%2F9wg0nr7dcpzh6tlqcsl7.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Fill in host, port, database, credentials — and point it to your ca.pem file under SSL settings&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%2F7gkadmdu3100fdbvaf5t.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%2F7gkadmdu3100fdbvaf5t.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Back in Power BI → Get Data → ODBC → select your DSN&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You will also see the Data Connectivity mode options: Import and DirectQuery. Import copies the data into Power BI's in memory storage, while DirectQuery sends live queries to the database every time a visual refreshes. For learning and development, Import mode is the best choice.&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%2Fp0i19p1jyqge25p04yvw.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%2Fp0i19p1jyqge25p04yvw.png" alt=" " width="702" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Enter Your Database Credentials
&lt;/h3&gt;

&lt;p&gt;After clicking OK, Power BI will prompt you to enter your credentials. Select the Database authentication tab, then enter your PostgreSQL username, commonly postgres,  and your password. Power BI will store these credentials securely so you do not need to re enter them each time you connect.&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%2Fivnwn7am88iai8ahria4.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%2Fivnwn7am88iai8ahria4.png" alt=" " width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Select Tables in the Navigator
&lt;/h3&gt;

&lt;p&gt;After successful authentication, the Navigator window opens. This window displays a tree structure of your database, showing all available schemas and tables. Expand the assignment schema to see the four tables from your database: customers, products, sales, and inventory.&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%2Fu4zrlgdvtcjb5jtrfm78.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%2Fu4zrlgdvtcjb5jtrfm78.png" alt=" " width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the box next to each table you want to load into Power BI. The right panel shows a preview of the data in the selected table, allowing you to verify that you are connecting to the correct data before loading it. Once you have selected all four tables, click Load to import the data into Power BI.&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%2Fky9vumjxplb69jjoi652.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%2Fky9vumjxplb69jjoi652.png" alt=" " width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After clicking Load, Power BI imports all selected tables into its in memory data model. You will see the data loading progress in the status bar at the bottom of the screen. Once complete, the tables are available in the Fields panel on the right side of the report canvas.&lt;/p&gt;

&lt;h3&gt;
  
  
  Loading Tables and Creating Relationships in Power BI
&lt;/h3&gt;

&lt;p&gt;Once the four tables from the assignment schema are loaded customers, products, sales, and inventory they appear in Power BI's Fields panel. &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%2Fmpqcqo704up6zoog4ul1.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%2Fmpqcqo704up6zoog4ul1.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Four Tables
&lt;/h3&gt;

&lt;p&gt;Before creating relationships, it helps to understand what each table contains and how they are logically connected:&lt;br&gt;
• customers; Contains one row per customer, with details like customer id, first name, last name, email, and membership status. The customer id is the unique identifier (primary key).&lt;br&gt;
• products; Contains one row per product, with product id, product name, category, price, supplier, and stock quantity. The product id is the primary key.&lt;br&gt;
• sales; The central transactional table. Each row is a sale, with sale id as the primary key. Crucially, it also contains customer id and product id as foreign keys these are the columns that link each sale to a specific customer and product.&lt;br&gt;
• inventory; A supporting table that tracks stock levels per product, linked to the products table via product id.&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%2Frof66qzvjz14eqax66xk.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%2Frof66qzvjz14eqax66xk.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Relationships in the Model View
&lt;/h3&gt;

&lt;p&gt;To define relationships, switch to the Model View by clicking the relationship icon in the left sidebar . Power BI may automatically detect some relationships based on matching column names. &lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Power BI has become one of the most essential tools in a data analyst's toolkit, transforming raw database records into interactive dashboards and visual reports that drive business decisions. Its ability to connect directly to local databases like PostgreSQL is what makes it particularly powerful for analysts rather than exporting data manually to spreadsheets and risking outdated figures, a live local connection means your reports are always pulling from the actual source of truth. &lt;br&gt;
For developers and students especially, working against a localhost database allows you to build, test, and refine reports in a fast, controlled environment without incurring cloud costs or depending on internet connectivity. This direct line between your database and your visualisation layer is what bridges the gap between raw SQL data and the polished, decision-ready insights that stakeholders actually consume.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JOINS AND WINDOW FUNCTIONS IN SQL</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Mon, 02 Mar 2026 21:10:02 +0000</pubDate>
      <link>https://forem.com/nj3r1/joins-and-window-functions-in-sql-5aag</link>
      <guid>https://forem.com/nj3r1/joins-and-window-functions-in-sql-5aag</guid>
      <description>&lt;p&gt;The JOIN clause is used to combine rows from two or more tables, based on a related column between them.&lt;/p&gt;

&lt;p&gt;Here are the different types of JOINs in SQL:&lt;/p&gt;

&lt;p&gt;(INNER) JOIN: Returns only rows that have matching values in both tables&lt;br&gt;
LEFT (OUTER) JOIN: Returns all rows from the left table, and only the matched rows from the right table&lt;br&gt;
RIGHT (OUTER) JOIN: Returns all rows from the right table, and only the matched rows from the left table&lt;br&gt;
FULL (OUTER) JOIN: Returns all rows when there is a match in either the left or right table&lt;/p&gt;
&lt;h2&gt;
  
  
  SQL INNER JOIN
&lt;/h2&gt;

&lt;p&gt;INNER JOIN is used to retrieve rows where matching values exist in both tables. Combining records based on a related column. Returning only matching rows from both tables. Excluding non-matching data from the result set. Ensuring accurate data relationships between tables&lt;br&gt;
Only returns rows where there's a match in BOTH tables. If a customer has no orders, they don't show up. If an order has no customer, it doesn't show up either.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customers.name, orders.product
FROM customers
INNER JOIN orders ON customers.id = orders.customer_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result of this will be; only the customers who placed an order will appear&lt;/p&gt;

&lt;h2&gt;
  
  
  LEFT(OUTER) JOIN
&lt;/h2&gt;

&lt;p&gt;LEFT JOIN is used to retrieve all rows from the left table and matching rows from the right table. Returns ALL rows from the left table, plus any matching rows from the right table. If there's no match on the right side, you still get the left row just with NULL in the right columns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customers.name, orders.product
FROM customers
LEFT JOIN orders ON customers.id = orders.customer_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results of this is that the customers will appear and those that will have no order will have a NULL under 'product'.&lt;/p&gt;

&lt;h2&gt;
  
  
  RIGHT (OUTER) JOIN
&lt;/h2&gt;

&lt;p&gt;RIGHT JOIN is used to retrieve all rows from the right table and the matching rows from the left table. It helps in:&lt;/p&gt;

&lt;p&gt;Returns ALL rows from the right table, and matching rows from the left. In practice, most people rewrite this as a LEFT JOIN by swapping the table order it's easier to reason about.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customers.name, orders.product
FROM customers
RIGHT JOIN orders ON customers.id = orders.customer_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results; All orders will appear, even after deletion of customer from system.&lt;/p&gt;

&lt;h2&gt;
  
  
  FULL (OUTER) JOIN
&lt;/h2&gt;

&lt;p&gt;FULL JOIN is used to combine the results of both LEFT JOIN and RIGHT JOIN. Returns ALL rows from BOTH tables. Where there's no match, you get NULLs on the missing side. Use this when you need a complete picture of both datasets regardless of matches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customers.name, orders.product
FROM customers
FULL OUTER JOIN orders ON customers.id = orders.customer_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Window Functions in SQL
&lt;/h2&gt;

&lt;p&gt;A window function lets you perform calculations across a group of rows  while still keeping every individual row in your result. &lt;/p&gt;

&lt;p&gt;The Basic Syntax&lt;br&gt;
The window function follows this pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function_name()  OVER  (
    PARTITION BY  column - group rows (optional)
    ORDER BY      column -set row order  (optional)
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PARTITION BY is like GROUP BY it resets the calculation per group. ORDER BY defines the order rows are processed within that group.&lt;/p&gt;

&lt;p&gt;The 5 Most Useful Window Functions&lt;/p&gt;

&lt;h3&gt;
  
  
  ROW_NUMBER() Number Your Rows
&lt;/h3&gt;

&lt;p&gt;Assigns a unique sequential number to each row within a partition. Restarts at 1 for each new group.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name, department, salary,
  ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rank
FROM employees;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  RANK() Handle Ties Fairly
&lt;/h3&gt;

&lt;p&gt;Like ROW_NUMBER() but handles ties: two employees with equal salary both get rank 1, and the next gets rank 3 (skips 2). Use DENSE_RANK() if you don't want the gap.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name, score,
  RANK()        OVER (ORDER BY score DESC) AS rank_with_gap,
  DENSE_RANK()  OVER (ORDER BY score DESC) AS rank_no_gap
FROM students;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SUM() OVER Running Totals
&lt;/h3&gt;

&lt;p&gt;Calculates a cumulative sum as it moves down the rows. One of the most used window functions in business analytics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT sale_date, amount,
  SUM(amount) OVER (ORDER BY sale_date) AS running_total
FROM sales;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: each row shows the day's amount AND a growing total. By the last row it equals the grand total.&lt;/p&gt;

&lt;h3&gt;
  
  
  LAG() Look at the Previous Row
&lt;/h3&gt;

&lt;p&gt;Grabs a value from a previous row without needing a selfjoin. Perfect for month-over-month or day-over-day comparisons.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT month, revenue,
  LAG(revenue, 1) OVER (ORDER BY month)              AS prev_month,
  revenue LAG(revenue, 1) OVER (ORDER BY month)    AS change
FROM monthly_sales;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LEAD() does the opposite it looks at the next row. Useful for forecasting or "days until next event" calculations.&lt;/p&gt;

&lt;h3&gt;
  
  
  AVG() OVER Compare to Group Average
&lt;/h3&gt;

&lt;p&gt;Shows each row's value alongside the average for its group something impossible with plain GROUP BY.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name, department, salary,
  AVG(salary) OVER (PARTITION BY department)  AS dept_avg,
  salary AVG(salary) OVER (PARTITION BY department) AS vs_avg
FROM employees;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>sql</category>
      <category>database</category>
      <category>postgres</category>
    </item>
    <item>
      <title>How Analysts Translate Messy Data, DAX, and Dashboards into Action Using Power BI</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Mon, 09 Feb 2026 10:35:28 +0000</pubDate>
      <link>https://forem.com/nj3r1/how-analysts-translate-messy-data-dax-and-dashboards-into-action-using-power-bi-pdn</link>
      <guid>https://forem.com/nj3r1/how-analysts-translate-messy-data-dax-and-dashboards-into-action-using-power-bi-pdn</guid>
      <description>&lt;p&gt;Organizations collect massive amounts of information from various sources sales transactions, customer interactions, operational metrics, and more. However, raw data alone doesn't drive decisions. The real value emerges when this data is transformed into clear, actionable insights that guide strategic choices. Power BI has become an essential tool in this transformation process, enabling analysts to bridge the gap between numbers and meaningful business outcomes.&lt;/p&gt;

&lt;p&gt;The Data Preparation&lt;br&gt;
The first challenge in any analytics project is dealing with unstructured data. Raw datasets often contain duplicates, missing values, inconsistent formatting, and irrelevant columns. Power BI's Power Query editor addresses these issues, allowing analysts to clean and reshape data before it ever reaches a dashboard.&lt;/p&gt;

&lt;p&gt;Building a Solid Foundation with Data Modeling&lt;br&gt;
Once data is cleaned, the next step involves creating relationships between different data tables. Power BI's data modeling capabilities allow analysts to establish connections that reflect real world business relationships. For instance, linking sales transactions to customer information, products, and time dimensions creates a cohesive structure that supports flexible analysis.&lt;/p&gt;

&lt;p&gt;A well-designed data model using a star schema approach with fact tables containing transactional data and dimension tables providing context ensures optimal performance and makes complex calculations more manageable. This foundation enables users to slice and dice data from multiple perspectives without rebuilding queries from scratch.&lt;/p&gt;

&lt;p&gt;Adding Intelligence with DAX&lt;br&gt;
Data Analysis Expressions (DAX) is where Power BI truly shines. This formula language allows analysts to create custom calculations that go beyond simple sums and averages. DAX enables sophisticated metrics like year over year growth rates, running totals, market share calculations, and customer lifetime value.&lt;/p&gt;

&lt;p&gt;The power of DAX lies in its context awareness. Calculations automatically adjust based on how users interact with visuals whether they're viewing company wide performance or drilling down into a specific region or product category. This dynamic behavior transforms static numbers into interactive insights that respond to business questions in real time.&lt;/p&gt;

&lt;p&gt;Designing Dashboards&lt;br&gt;
Effective visualization is about more than choosing attractive charts. The best Power BI dashboards guide users through a narrative, starting with high-level KPIs that answer "how are we doing" before enabling deeper exploration into "why" and "what should we do about it"&lt;/p&gt;

&lt;p&gt;Strategic use of visual elements KPI cards for quick status checks, trend lines for pattern recognition, and interactive filters for focused analysis helps stakeholders grasp complex information quickly. The goal is clarity, not complexity. Each visual should serve a purpose and contribute to understanding the bigger picture.&lt;/p&gt;

</description>
      <category>database</category>
      <category>datascience</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Transforming Raw Data into Actionable Insights with Power BI</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Mon, 09 Feb 2026 10:32:47 +0000</pubDate>
      <link>https://forem.com/nj3r1/transforming-raw-data-into-actionable-insights-with-power-bi-3g4c</link>
      <guid>https://forem.com/nj3r1/transforming-raw-data-into-actionable-insights-with-power-bi-3g4c</guid>
      <description>&lt;p&gt;Organizations collect massive amounts of information from various sources sales transactions, customer interactions, operational metrics, and more. However, raw data alone doesn't drive decisions. The real value emerges when this data is transformed into clear, actionable insights that guide strategic choices. Power BI has become an essential tool in this transformation process, enabling analysts to bridge the gap between numbers and meaningful business outcomes.&lt;/p&gt;

&lt;p&gt;The Data Preparation&lt;br&gt;
The first challenge in any analytics project is dealing with unstructured data. Raw datasets often contain duplicates, missing values, inconsistent formatting, and irrelevant columns. Power BI's Power Query editor addresses these issues, allowing analysts to clean and reshape data before it ever reaches a dashboard.&lt;/p&gt;

&lt;p&gt;Building a Solid Foundation with Data Modeling&lt;br&gt;
Once data is cleaned, the next step involves creating relationships between different data tables. Power BI's data modeling capabilities allow analysts to establish connections that reflect real world business relationships. For instance, linking sales transactions to customer information, products, and time dimensions creates a cohesive structure that supports flexible analysis.&lt;/p&gt;

&lt;p&gt;A well-designed data model using a star schema approach with fact tables containing transactional data and dimension tables providing context ensures optimal performance and makes complex calculations more manageable. This foundation enables users to slice and dice data from multiple perspectives without rebuilding queries from scratch.&lt;/p&gt;

&lt;p&gt;Adding Intelligence with DAX&lt;br&gt;
Data Analysis Expressions (DAX) is where Power BI truly shines. This formula language allows analysts to create custom calculations that go beyond simple sums and averages. DAX enables sophisticated metrics like year over year growth rates, running totals, market share calculations, and customer lifetime value.&lt;/p&gt;

&lt;p&gt;The power of DAX lies in its context awareness. Calculations automatically adjust based on how users interact with visuals whether they're viewing company wide performance or drilling down into a specific region or product category. This dynamic behavior transforms static numbers into interactive insights that respond to business questions in real time.&lt;/p&gt;

&lt;p&gt;Designing Dashboards&lt;br&gt;
Effective visualization is about more than choosing attractive charts. The best Power BI dashboards guide users through a narrative, starting with high-level KPIs that answer "how are we doing" before enabling deeper exploration into "why" and "what should we do about it"&lt;/p&gt;

&lt;p&gt;Strategic use of visual elements KPI cards for quick status checks, trend lines for pattern recognition, and interactive filters for focused analysis helps stakeholders grasp complex information quickly. The goal is clarity, not complexity. Each visual should serve a purpose and contribute to understanding the bigger picture.&lt;/p&gt;

</description>
      <category>database</category>
      <category>datascience</category>
      <category>ai</category>
      <category>data</category>
    </item>
    <item>
      <title>How Analysts Translate Messy Data, DAX, and Dashboards into Action Using Power BI</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Mon, 09 Feb 2026 10:26:46 +0000</pubDate>
      <link>https://forem.com/nj3r1/transforming-raw-data-into-actionable-insights-with-power-bi-1m70</link>
      <guid>https://forem.com/nj3r1/transforming-raw-data-into-actionable-insights-with-power-bi-1m70</guid>
      <description>&lt;p&gt;Organizations collect massive amounts of information from various sources sales transactions, customer interactions, operational metrics, and more. However, raw data alone doesn't drive decisions. The real value emerges when this data is transformed into clear, actionable insights that guide strategic choices. Power BI has become an essential tool in this transformation process, enabling analysts to bridge the gap between numbers and meaningful business outcomes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Data Preparation
&lt;/h2&gt;

&lt;p&gt;The first challenge in any analytics project is dealing with  unstructured data. Raw datasets often contain duplicates, missing values, inconsistent formatting, and irrelevant columns. Power BI's Power Query editor addresses these issues, allowing analysts to clean and reshape data before it ever reaches a dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Solid Foundation with Data Modeling
&lt;/h2&gt;

&lt;p&gt;Once data is cleaned, the next step involves creating relationships between different data tables. Power BI's data modeling capabilities allow analysts to establish connections that reflect real world business relationships. For instance, linking sales transactions to customer information, products, and time dimensions creates a cohesive structure that supports flexible analysis.&lt;/p&gt;

&lt;p&gt;A well-designed data model using a star schema approach with fact tables containing transactional data and dimension tables providing context ensures optimal performance and makes complex calculations more manageable. This foundation enables users to slice and dice data from multiple perspectives without rebuilding queries from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Intelligence with DAX
&lt;/h2&gt;

&lt;p&gt;Data Analysis Expressions (DAX) is where Power BI truly shines. This formula language allows analysts to create custom calculations that go beyond simple sums and averages. DAX enables sophisticated metrics like year over year growth rates, running totals, market share calculations, and customer lifetime value.&lt;/p&gt;

&lt;p&gt;The power of DAX lies in its context awareness. Calculations automatically adjust based on how users interact with visuals whether they're viewing company wide performance or drilling down into a specific region or product category. This dynamic behavior transforms static numbers into interactive insights that respond to business questions in real time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing Dashboards
&lt;/h2&gt;

&lt;p&gt;Effective visualization is about more than choosing attractive charts. The best Power BI dashboards guide users through a narrative, starting with high-level KPIs that answer "how are we doing" before enabling deeper exploration into "why" and "what should we do about it"&lt;/p&gt;

&lt;p&gt;Strategic use of visual elements KPI cards for quick status checks, trend lines for pattern recognition, and interactive filters for focused analysis helps stakeholders grasp complex information quickly. The goal is clarity, not complexity. Each visual should serve a purpose and contribute to understanding the bigger picture.&lt;/p&gt;

</description>
      <category>database</category>
      <category>datascience</category>
      <category>data</category>
    </item>
    <item>
      <title>Understanding Schemas and Data Modelling in Power BI: Building the Foundation for Performance and Accuracy</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Mon, 02 Feb 2026 13:19:44 +0000</pubDate>
      <link>https://forem.com/nj3r1/understanding-schemas-and-data-modelling-in-power-bi-building-the-foundation-for-performance-and-3peo</link>
      <guid>https://forem.com/nj3r1/understanding-schemas-and-data-modelling-in-power-bi-building-the-foundation-for-performance-and-3peo</guid>
      <description>&lt;p&gt;Power BI has revolutionized how organizations connect to data, transform it, and create interactive visualizations. However, the true power of Power BI lies not just in its stunning visuals, but in what happens behind the scenes the data model. A well-designed data model is the backbone of every successful Power BI solution, directly impacting performance, accuracy, and user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Schema vs. Data Model: Understanding the Distinction
&lt;/h2&gt;

&lt;p&gt;Before diving into the technical details, it's important to understand the relationship between schemas and data models. A &lt;strong&gt;schema&lt;/strong&gt; is the blueprint or conceptual design that defines how your data will be structured for analysis. Think of it as the architectural plan for your data warehouse. A &lt;strong&gt;data model&lt;/strong&gt;, on the other hand, is the actual implementation of that schema within Power BI the tables, relationships, and calculations you create.&lt;/p&gt;

&lt;p&gt;In simple terms, the schema is your plan, and the data model is what you build based on that plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Essential Terminology: Building Your Data Modeling Vocabulary
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Fact Tables
&lt;/h3&gt;

&lt;p&gt;Fact tables are the heart of your data model, storing quantitative, measurable business data that changes frequently. These tables contain metrics like sales revenue, quantities sold, transaction amounts, or order counts. They typically hold the largest volume of data in your model and represent the "business events" you want to analyze.&lt;/p&gt;

&lt;p&gt;Key characteristics of fact tables include numeric measure columns for calculations and foreign key columns that link to dimension tables. For example, a Sales fact table might contain OrderID, CustomerID, ProductID, DateID, Quantity, and Revenue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dimension Tables
&lt;/h3&gt;

&lt;p&gt;Dimension tables store descriptive, contextual information that helps you slice, filter, and group your fact data. These tables are relatively static and contain attributes used for filtering and organizing your analysis. Common examples include Customer, Product, Date, and Geography tables.&lt;/p&gt;

&lt;p&gt;Dimension tables contain a primary key column that uniquely identifies each record, along with descriptive attributes. A Customer dimension might include CustomerID, CustomerName, Email, City, and Country.&lt;/p&gt;

&lt;h3&gt;
  
  
  Normalized vs. Denormalized Data
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Normalized data&lt;/strong&gt; is structured to minimize redundancy by splitting information across multiple related tables. Each piece of information is stored only once, reducing duplication. &lt;strong&gt;Denormalized data&lt;/strong&gt; combines related information into fewer tables, even if it means repeating data across rows. While this creates redundancy, it can improve query performance by reducing the number of joins required.&lt;/p&gt;

&lt;p&gt;Power BI's data modeling approach strategically balances these concepts to optimize for both storage efficiency and query performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Star Schema: The Gold Standard for Power BI
&lt;/h2&gt;

&lt;p&gt;The star schema is the most widely recommended approach for Power BI data modeling, and for good reason. In this design, a central fact table is surrounded by multiple dimension tables, creating a visual structure that resembles a star.&lt;/p&gt;

&lt;h3&gt;
  
  
  Structure of a Star Schema
&lt;/h3&gt;

&lt;p&gt;In a star schema, the fact table sits at the center containing all your measurable data and foreign keys. Surrounding it are dimension tables that are denormalized meaning all attributes for a dimension are contained in a single table, even if it creates some redundancy. Each dimension table connects directly to the fact table through a one-to-many relationship.&lt;/p&gt;

&lt;p&gt;For example, imagine a retail sales model where the central FactSales table connects directly to DimCustomer, DimProduct, DimDate, and DimStore tables. Each dimension contains all relevant attributes: the Product dimension includes ProductID, ProductName, Category, Subcategory, and Brand all in one table.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Star Schema Excels in Power BI
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Performance Optimization&lt;/strong&gt;: Power BI's VertiPaq engine is specifically optimized for star schema designs. The engine uses columnar storage and advanced compression techniques that work best with flat dimension tables. Fewer relationships mean faster filter propagation, and the reduced number of joins significantly improves query performance. Organizations typically see queries run 5-10 times faster with properly implemented star schemas compared to poorly structured models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplicity and Usability&lt;/strong&gt;: Star schemas are intuitive for business users and report developers. The straightforward structure makes it easy to understand how data relates, reducing the learning curve for new team members. When creating reports, users can easily drag and drop fields without worrying about complex join paths.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAX Efficiency&lt;/strong&gt;: Data Analysis Expressions (DAX) formulas work more efficiently in star schema models. Measures and calculated columns perform better because filter context flows predictably from dimensions to facts. This predictability also makes DAX code easier to write and debug.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microsoft's Recommendation&lt;/strong&gt;: Microsoft explicitly recommends star schemas for Power BI semantic models as a best practice. The entire Power BI ecosystem from the VertiPaq engine to DAX calculations is designed with star schema principles in mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snowflake Schema: When Normalization Extends Further
&lt;/h2&gt;

&lt;p&gt;A snowflake schema extends the star schema concept by normalizing dimension tables into multiple related sub tables. Instead of keeping all dimension attributes in a single table, dimensions are broken down into smaller, more granular tables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Structure of a Snowflake Schema
&lt;/h3&gt;

&lt;p&gt;In a snowflake schema, the fact table remains at the center, but dimension tables are further divided. For instance, a Product dimension might be split into Product, ProductSubcategory, and ProductCategory tables, each connected through relationships. This creates "branches" that extend from the central fact table, resembling a snowflake.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to Consider Snowflake Schema
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Highly Normalized Source Data&lt;/strong&gt;: If your source data warehouse already uses a snowflake design, it might be easier to import it as-is rather than denormalizing during the ETL process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complex Hierarchies&lt;/strong&gt;: When you have intricate hierarchical relationships across dimensions that genuinely benefit from separation into multiple tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Integrity and Storage&lt;/strong&gt;: In scenarios where maintaining normalized structures is critical for data governance, or when you need to minimize storage in very large dimensions ,though Power BI's compression often makes this less relevant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Detailed, Enterprise-Scale Models&lt;/strong&gt;: Large organizations with complex data warehouses might use snowflake schemas where normalization is required upstream.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance Considerations
&lt;/h3&gt;

&lt;p&gt;While snowflake schemas can work in Power BI, they come with performance trade-offs. Power BI must navigate longer relationship chains with more joins, potentially slowing query performance. The model becomes more complex with additional tables and relationships, which can confuse users and make maintenance harder. The VertiPaq engine's compression benefits are reduced because normalization limits the effectiveness of columnar compression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;: Even when working with snowflaked source data, many Power BI developers flatten the structure during data transformation in Power Query to create a star schema in the final model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relationships in Power BI: Connecting Your Data
&lt;/h2&gt;

&lt;p&gt;Relationships are the connections between tables based on common columns. They enable data from multiple sources to flow together seamlessly, ensuring that filters, slicers, and visuals interact correctly across your entire model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Relationships
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;One-to-Many (1:M)&lt;/strong&gt;: This is the most common and recommended relationship type. One record in the dimension table relates to many records in the fact table. For example, one Customer can have many Orders. In a well-designed star schema, all relationships from dimensions to facts should be one-to-many.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-One (1:1)&lt;/strong&gt;: Each record in one table matches exactly one record in another table. This is rare and often suggests that the tables should be merged. One-to-one relationships might be used for splitting very wide tables or for security purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Many-to-Many (M:M)&lt;/strong&gt;: Multiple records in one table relate to multiple records in another. While Power BI supports this, it should be used cautiously as it can create ambiguous filter paths and performance issues. Many-to-many relationships often require bridge tables and careful model design.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Relationships
&lt;/h3&gt;

&lt;p&gt;Power BI offers two methods for establishing relationships:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Auto-detect&lt;/strong&gt;: When loading multiple tables, Power BI automatically attempts to find and create relationships based on matching column names and data types. While convenient, always verify these auto-detected relationships to ensure accuracy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Manual Creation&lt;/strong&gt;: For precise control, create relationships manually by going to Model View, selecting Manage Relationships &amp;gt; New, choosing the tables and columns, and setting the appropriate cardinality and cross-filter direction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Cardinality
&lt;/h3&gt;

&lt;p&gt;Cardinality defines the nature of the relationship between tables how many rows in one table relate to rows in another. Setting the wrong cardinality can lead to duplicated data, incorrect aggregations, and misleading reports. Power BI usually auto detects cardinality correctly, but it's crucial to verify it matches your data structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-Filter Direction: Controlling Filter Flow
&lt;/h3&gt;

&lt;p&gt;Cross-filter direction determines how filters propagate between related tables. This is one of the most important yet often misunderstood aspects of Power BI relationships.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single Direction (Default and Recommended)&lt;/strong&gt;: Filters flow in one direction only, typically from the "one" side of a one to many relationship to the "many" side. For example, selecting a customer filters their orders, but selecting an order doesn't filter the customer table. This is the default behavior and what Power BI's engine is optimized for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Both (Bi-directional)&lt;/strong&gt;: Filters can flow in both directions between tables. While this seems flexible, bi-directional filtering should be used sparingly. It can create ambiguous filter paths, introduce circular dependencies, negatively impact performance, and make the model harder to understand and debug.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to Use Bi-directional Filtering&lt;/strong&gt;: Bi-directional relationships are appropriate in specific scenarios like many to many relationships using bridge tables, certain Row-Level Security (RLS) implementations, or when you need to filter one fact table by another through a shared dimension. Even in these cases, consider using the CROSSFILTER DAX function to enable bi-directional filtering only for specific calculations rather than permanently on the relationship.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practice&lt;/strong&gt;: Start with single-direction filtering and only introduce bi-directional filtering when there's a clear, well-understood requirement that cannot be met any other way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Active vs. Inactive Relationships
&lt;/h3&gt;

&lt;p&gt;Power BI allows only one active relationship between any two tables for automatic filter propagation. However, you can create multiple inactive relationships that can be activated in specific DAX calculations using the USERELATIONSHIP function. This is particularly useful for role-playing dimensions like Date tables that might relate to a fact table multiple times (OrderDate, ShipDate, DeliveryDate).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Good Data Modeling Is Critical
&lt;/h2&gt;

&lt;p&gt;The quality of your data model directly determines the success of your Power BI solution. Here's why investing time in proper data modeling is essential:&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance Optimization
&lt;/h3&gt;

&lt;p&gt;A well-designed data model particularly using a star schema dramatically improves query performance. Fewer joins reduce the computational work required for each query. The VertiPaq engine can compress and cache data more efficiently in star schemas. Filter propagation happens faster through simple, single-direction relationships. Dashboards and reports load in seconds instead of minutes, transforming the user experience.&lt;/p&gt;

&lt;p&gt;Real-world results show that organizations moving from poorly structured models to optimized star schemas often see 5-10x performance improvements. When reports load in under 2 seconds instead of 15-30 seconds, it fundamentally changes how users interact with data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accurate and Reliable Reporting
&lt;/h3&gt;

&lt;p&gt;Proper relationships between fact and dimension tables ensure that calculations aggregate correctly. Filters and slicers work as expected across all visuals, and data integrity is maintained throughout the model. Incorrect relationships or poorly designed models lead to double counting, missing data, or misleading totals errors that can result in costly business decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalability and Maintainability
&lt;/h3&gt;

&lt;p&gt;Structured models built on solid design principles are far easier to extend as business needs grow. When you need to add new fact tables, dimensions, or measures, a well designed star schema makes this straightforward. Clean models support reusable DAX measures and consistent calculation logic across reports. They're also easier to troubleshoot when issues arise and simpler for new team members to understand and work with.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enhanced User Experience
&lt;/h3&gt;

&lt;p&gt;A clear, intuitive data model makes it easier for report authors and business users to work with the data. Users can confidently create their own reports without constantly seeking help or making errors. The Data pane shows a logical, understandable structure rather than a confusing web of tables. This increases adoption and empowers self-service analytics across the organization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Efficient Resource Utilization
&lt;/h3&gt;

&lt;p&gt;Good modeling practices reduce memory consumption through appropriate data types, eliminating unnecessary columns, and using measures instead of calculated columns where appropriate. Optimized models refresh faster, consume less capacity, and cost less to run in Power BI Premium or Fabric.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alignment with Best Practices
&lt;/h3&gt;

&lt;p&gt;Following Microsoft's recommended practices ensures you're working with the platform as intended rather than against it. Your models will be more compatible with future Power BI features and updates. You'll be able to leverage the full power of DAX and the VertiPaq engine, and your skills will be transferable across different Power BI projects and organizations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Tips for Building Better Models
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Start with Star Schema&lt;/strong&gt;: Make the star schema your default approach. Only deviate when you have specific, well understood requirements that truly demand a different structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Power Query for Transformation&lt;/strong&gt;: Leverage Power Query to transform your source data into the desired schema before loading it into the model. Denormalize snowflaked sources, clean and filter data, and create proper key columns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Establish a Date Table&lt;/strong&gt;: Always create a dedicated Date dimension table with all date related attributes. Mark it as a date table in Power BI and use it for all time-intelligence calculations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose Appropriate Data Types&lt;/strong&gt;: Select the most efficient data type for each column. Use integers instead of text for ID columns, use Date instead of DateTime when time isn't needed, and avoid unnecessary precision in decimal columns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hide Unnecessary Fields&lt;/strong&gt;: Hide foreign key columns and other technical fields from the report view to simplify the user experience and prevent confusion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Measures, Not Calculated Columns&lt;/strong&gt;: Prefer measures for calculations as they're computed at query time, reducing model size and improving flexibility. Only use calculated columns when the result needs to be used for slicing, filtering, or in relationships.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Document Your Model&lt;/strong&gt;: Add descriptions to tables, columns, and measures to help others (and your future self) understand the model's structure and logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test and Monitor Performance&lt;/strong&gt;: Use Performance Analyzer in Power BI Desktop to identify bottlenecks. Regularly review query performance, refresh times, and model size as your solution evolves.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Introduction to MS Excel for Data Analytics - A Beginner's Guide</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Sun, 25 Jan 2026 12:22:22 +0000</pubDate>
      <link>https://forem.com/nj3r1/introduction-to-ms-excel-for-data-analytics-a-beginners-guide-254p</link>
      <guid>https://forem.com/nj3r1/introduction-to-ms-excel-for-data-analytics-a-beginners-guide-254p</guid>
      <description>&lt;p&gt;So I recently started learning data analytics, and everyone kept telling me that i needed to learn excel first. I'll be honest, at first I thought Excel was just for making boring spreadsheets.&lt;/p&gt;

&lt;p&gt;Excel is actually super powerful for analyzing data, and the best partis that you don't need to know programming to use it. In this guide, I'm going to walk you through everything I learned about using Excel for basic data analysis.&lt;/p&gt;

&lt;p&gt;Before we dive into Excel, let me explain what I mean by "data analytics" in simple terms.&lt;/p&gt;

&lt;p&gt;Data analytics is basically looking at a bunch of information (data) and trying to find patterns, answers, or insights. For example:&lt;/p&gt;

&lt;p&gt;Which product sells the most?&lt;br&gt;
What's the average score of students in a class?&lt;br&gt;
How do sales change month by month?&lt;br&gt;
Excel helps us answer these questions without doing everything manually!&lt;/p&gt;
&lt;h2&gt;
  
  
  Part 1: Getting Started with My Data
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Opening the Dataset
&lt;/h3&gt;

&lt;p&gt;First thing I did was open Excel and load my HR dataset file.&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%2Fxjskqqgutxybr9cz77r8.jpg" 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%2Fxjskqqgutxybr9cz77r8.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I saw columns with data about employees: Employee ID, Age, Department, Gender, Job Role, Monthly Income, Years at Company, and more. Honestly, it was a bit overwhelming at first!&lt;/p&gt;
&lt;h3&gt;
  
  
  Basic Navigation
&lt;/h3&gt;

&lt;p&gt;I learned that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rows&lt;/strong&gt; go horizontally (each row = one employee)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Columns&lt;/strong&gt; go vertically (each column = one type of information)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cells&lt;/strong&gt; are the individual boxes where rows and columns meet&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%2Fbgsndyihkacznhlap5vi.jpg" 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%2Fbgsndyihkacznhlap5vi.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Freezing Headers
&lt;/h3&gt;

&lt;p&gt;One thing that annoyed me was scrolling down and forgetting which column was which! So I froze the top row:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clicked on any row&lt;/li&gt;
&lt;li&gt;View tab → Freeze Panes → Freeze Top Row&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%2Fnbnbupdidrjo3hh7pjbn.jpg" 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%2Fnbnbupdidrjo3hh7pjbn.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now when I scroll, the headers stay visible!&lt;/p&gt;
&lt;h2&gt;
  
  
  Part 2: Sorting and Filtering Data
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Sorting by Salary
&lt;/h3&gt;

&lt;p&gt;I wanted to see who had the highest salary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clicked anywhere in my data&lt;/li&gt;
&lt;li&gt;Data tab → Sort&lt;/li&gt;
&lt;li&gt;Sort by: MonthlyIncome, Order: Largest to Smallest&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%2Fk2rcsht48wso0a76qsn3.jpg" 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%2Fk2rcsht48wso0a76qsn3.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Using Filters
&lt;/h3&gt;

&lt;p&gt;To see only specific data, I turned on filters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data tab → Filter&lt;/li&gt;
&lt;li&gt;Clicked the dropdown arrow in Department column&lt;/li&gt;
&lt;li&gt;Selected only "Sales"&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%2F2xfayme38to45g6lqzky.jpg" 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%2F2xfayme38to45g6lqzky.jpg" alt=" " width="800" height="449"&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%2Fhua4drij3fchlz2xq0un.jpg" 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%2Fhua4drij3fchlz2xq0un.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Part 3: Basic Formulas
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Calculating Average Salary
&lt;/h3&gt;

&lt;p&gt;I clicked on an empty cell and typed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=AVERAGE(E2:E877)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fw9vj2e7ey9sxax67nn3u.jpg" 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%2Fw9vj2e7ey9sxax67nn3u.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This calculated the average salary instantly - around Ksh. 74066.533&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%2Fml2jlvrel79xp52gkd3i.jpg" 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%2Fml2jlvrel79xp52gkd3i.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Useful Formulas
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Counting employees:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=COUNT(A2:A877)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fbbbmlzjo7u0oh8w1j8oe.jpg" 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%2Fbbbmlzjo7u0oh8w1j8oe.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conditional Counting
&lt;/h3&gt;

&lt;p&gt;To count how many employees left the company:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=COUNTIF(J2:J1001,"Yes")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fuxonmek4zbl5kta8t4db.jpg" 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%2Fuxonmek4zbl5kta8t4db.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To sum salaries for just the Sales department:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=SUMIF(D2:D1001,"Sales",I2:I1001)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F92fdkf5krxo581qh9f8b.jpg" 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%2F92fdkf5krxo581qh9f8b.jpg" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>data</category>
      <category>datascience</category>
      <category>analytics</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Fri, 23 Jan 2026 13:50:10 +0000</pubDate>
      <link>https://forem.com/nj3r1/-5gaj</link>
      <guid>https://forem.com/nj3r1/-5gaj</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/nj3r1" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F3709621%2Fadb5d1d3-ea64-4143-a9a3-59aa9cbf54ca.png" alt="nj3r1"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nj3r1/my-first-time-using-git-and-github-a-complete-beginners-guide-2b14" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;My First Time Using Git and GitHub - A Complete Beginner's Guide&lt;/h2&gt;
      &lt;h3&gt;susan njeri ・ Jan 17&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#github&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#git&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#datascience&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#data&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>github</category>
      <category>git</category>
      <category>datascience</category>
      <category>data</category>
    </item>
    <item>
      <title>My First Time Using Git and GitHub - A Complete Beginner's Guide</title>
      <dc:creator>susan njeri</dc:creator>
      <pubDate>Sat, 17 Jan 2026 18:36:25 +0000</pubDate>
      <link>https://forem.com/nj3r1/my-first-time-using-git-and-github-a-complete-beginners-guide-2b14</link>
      <guid>https://forem.com/nj3r1/my-first-time-using-git-and-github-a-complete-beginners-guide-2b14</guid>
      <description>&lt;p&gt;So I just finished learning how to use Git and GitHub, and wow, it was a journey! A few weeks ago, I had no idea what version control even meant. Now I'm pushing code to GitHub like it's no big deal (okay, I still get a little excited every time it works ).&lt;/p&gt;

&lt;p&gt;I wanted to write this guide while everything is still fresh in my mind because I remember how confusing it all seemed at first. If you're just starting out like I was, hopefully this helps!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick explanation of what these things are:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git&lt;/strong&gt; = a tool that tracks all the changes you make to your code. It's like having unlimited undo buttons!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt; = a website where you can store your code online and share it with others&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's literally all I knew when I started. Let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Need
&lt;/h2&gt;

&lt;p&gt;Just make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A computer (I'm on Windows but I'll try to cover Mac and Linux too)&lt;/li&gt;
&lt;li&gt;A GitHub account - go to &lt;a href="https://github.com" rel="noopener noreferrer"&gt;github.com&lt;/a&gt; and sign up, it's free&lt;/li&gt;
&lt;li&gt;Don't worry if you're not super comfortable with the command line, I wasn't either&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Installing Git Bash
&lt;/h2&gt;

&lt;p&gt;Okay, so first thing - I needed to install Git on my computer.&lt;/p&gt;

&lt;h3&gt;
  
  
  If You're on Windows (like me)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;I went to &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;git-scm.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Clicked the big "Download for Windows" button&lt;/li&gt;
&lt;li&gt;Ran the installer (it's like installing any other program)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Here's the thing - there are a LOT of options during installation. I honestly just kept clicking "Next" with the default settings and everything worked fine &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One thing I made sure to check: "Git Bash Here" - this lets you right-click in any folder and open Git Bash there, super convenient!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clicked through the rest and finished&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  If You're on Mac
&lt;/h3&gt;

&lt;p&gt;I asked my friend who uses Mac and apparently Git might already be installed! Open Terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it's not there, Mac will ask if you want to install it. Pretty straightforward from what I understand.&lt;/p&gt;

&lt;h3&gt;
  
  
  If You're on Linux
&lt;/h3&gt;

&lt;p&gt;My friend who uses Ubuntu told me to run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For other Linux versions, you might need different commands but I think the idea is the same.&lt;/p&gt;

&lt;h3&gt;
  
  
  Did It Work?
&lt;/h3&gt;

&lt;p&gt;Open Git Bash (on Windows I just searched for "Git Bash" in the start menu) and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see something like &lt;code&gt;git version 2.40.0&lt;/code&gt;, you're good! If not... uh... maybe try installing again? &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Connecting Git to GitHub
&lt;/h2&gt;

&lt;p&gt;This part confused me at first but it's actually not too bad.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tell Git Who You Are
&lt;/h3&gt;

&lt;p&gt;Git needs to know your name and email so it can tag your work. I opened Git Bash and typed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your.email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Obviously use YOUR actual name and email . And make sure the email matches whatever you used for GitHub!&lt;/p&gt;

&lt;p&gt;To check if it worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setting Up SSH Keys (This Part Seemed Scary But Wasn't)
&lt;/h3&gt;

&lt;p&gt;So apparently you need something called an SSH key to connect securely to GitHub. I watched a YouTube video to understand this better, but here's what I did:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generate the key:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your.email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It asked me where to save it - I just hit Enter to use the default location.&lt;/p&gt;

&lt;p&gt;Then it asked for a passphrase. I added one for security but you can just hit Enter twice to skip if you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start something called the SSH agent:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;ssh-agent &lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I don't fully understand what this does but it needs to be running &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add the key:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-add ~/.ssh/id_ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Copy the key:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This spits out a bunch of random characters starting with &lt;code&gt;ssh-ed25519&lt;/code&gt;. I copied THE WHOLE THING.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Put it on GitHub:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Went to GitHub&lt;/li&gt;
&lt;li&gt;Clicked my profile picture in the top right → Settings&lt;/li&gt;
&lt;li&gt;Found "SSH and GPG keys" on the left side&lt;/li&gt;
&lt;li&gt;Clicked "New SSH key"&lt;/li&gt;
&lt;li&gt;Gave it a name (I called mine "My Laptop")&lt;/li&gt;
&lt;li&gt;Pasted that long string of characters&lt;/li&gt;
&lt;li&gt;Clicked "Add SSH key"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Test if it worked:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I got a message saying "Hi [my username]! You've successfully authenticated" and I literally did a little celebration 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Understanding What Git Actually Does
&lt;/h2&gt;

&lt;p&gt;Before I started using commands, I tried to understand WHY I needed this.&lt;/p&gt;

&lt;p&gt;You know how you save files like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;my_code.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;my_code_v2.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;my_code_final.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;my_code_final_FINAL.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;my_code_final_FINAL_I_SWEAR.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yeah... Git makes this unnecessary. Instead, you keep one file and Git remembers every version you save. You can go back to ANY previous version whenever you want. &lt;/p&gt;

&lt;h3&gt;
  
  
  Words I Had to Learn
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repository (or repo):&lt;/strong&gt; Basically just a folder that Git is watching&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commit:&lt;/strong&gt; Saving a snapshot of your project at a moment in time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch:&lt;/strong&gt; Like a copy of your project where you can try stuff without breaking the original (I haven't really used this yet though)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote:&lt;/strong&gt; Your project stored online on GitHub&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4: Making My First Repository
&lt;/h2&gt;

&lt;p&gt;Okay here's where it got real. Time to actually USE Git!&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Project
&lt;/h3&gt;

&lt;p&gt;I made a new folder for my project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;my-first-project
&lt;span class="nb"&gt;cd &lt;/span&gt;my-first-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I initialized Git (basically telling Git to start watching this folder):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! Git is now tracking this folder. There's a hidden &lt;code&gt;.git&lt;/code&gt; folder created but you don't really need to touch it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Checking the Status
&lt;/h3&gt;

&lt;p&gt;I learned this command is super important:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use this ALL THE TIME. It tells you what's going on with your files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Making a File
&lt;/h3&gt;

&lt;p&gt;I created a simple README file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"# My First Project"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then checked status again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git saw the file but said it was "untracked" - meaning Git noticed it but isn't saving its history yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Files (Staging)
&lt;/h3&gt;

&lt;p&gt;To tell Git to track the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if you want to add everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.&lt;/code&gt; means "everything in this folder". &lt;/p&gt;

&lt;p&gt;Checked status again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it said the file was "staged" and ready to commit.&lt;/p&gt;

&lt;h3&gt;
  
  
  My First Commit!
&lt;/h3&gt;

&lt;p&gt;This is like taking a snapshot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add README file"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-m&lt;/code&gt; part is for adding a message. ALWAYS add a message explaining what you did! Future you will thank you.&lt;/p&gt;

&lt;p&gt;Good messages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Add login feature"&lt;/li&gt;
&lt;li&gt;"Fix typo in homepage"&lt;/li&gt;
&lt;li&gt;"Update installation steps"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bad messages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"update"&lt;/li&gt;
&lt;li&gt;"fixed stuff"&lt;/li&gt;
&lt;li&gt;"asdfjkl"&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Viewing History
&lt;/h3&gt;

&lt;p&gt;To see all your commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or for a cleaner version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty cool seeing your project history like this!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Putting My Code on GitHub!
&lt;/h2&gt;

&lt;p&gt;This was the part I was most excited about - making my code visible online!&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a GitHub Repository
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Went to GitHub&lt;/li&gt;
&lt;li&gt;Clicked the "+" button in the top right&lt;/li&gt;
&lt;li&gt;Clicked "New repository"&lt;/li&gt;
&lt;li&gt;Named it &lt;code&gt;my-first-project&lt;/code&gt; (same as my local folder)&lt;/li&gt;
&lt;li&gt;Did NOT check "Initialize with README" because I already have one&lt;/li&gt;
&lt;li&gt;Clicked "Create repository"&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Connecting Everything
&lt;/h3&gt;

&lt;p&gt;GitHub showed me some commands. I copied the SSH URL (the one starting with &lt;code&gt;git@github.com&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Then I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin git@github.com:YOUR_USERNAME/my-first-project.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The word "origin" is just a nickname for this GitHub repository.&lt;/p&gt;

&lt;p&gt;Double-checked it worked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pushing My Code Online
&lt;/h3&gt;

&lt;p&gt;This was the moment of truth:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-M&lt;/span&gt; main
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What these commands do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git branch -M main&lt;/code&gt; - names your main branch "main"&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git push -u origin main&lt;/code&gt; - sends your code to GitHub and remembers this as the default place to push&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I refreshed GitHub and SAW MY CODE ONLINE. I'm not gonna lie, I genuinely did a dance because of how excited I was.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: The Daily Workflow
&lt;/h2&gt;

&lt;p&gt;Now that everything was set up, here's what I do when I'm actually coding:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Make some changes to my files&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Learning Git is easier than I thought!"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Check what changed&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or see the actual differences:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows you exactly what lines changed. Super useful!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Add and commit&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add my thoughts to README"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Push to GitHub&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since I set up the default earlier, I can just type &lt;code&gt;git push&lt;/code&gt; now. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Getting Changes FROM GitHub
&lt;/h2&gt;

&lt;p&gt;This is important if you're working on multiple computers or with other people.&lt;/p&gt;

&lt;h3&gt;
  
  
  I Tested This By Editing on GitHub
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Went to my repository on GitHub&lt;/li&gt;
&lt;li&gt;Clicked on README.md&lt;/li&gt;
&lt;li&gt;Clicked the pencil icon to edit&lt;/li&gt;
&lt;li&gt;Added a line: "This was edited directly on GitHub!"&lt;/li&gt;
&lt;li&gt;Scrolled down and clicked "Commit changes"&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Pulling Those Changes
&lt;/h3&gt;

&lt;p&gt;Back in Git Bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Checked my file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And there was the line I added on GitHub! Magic!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 8: Commands I Use All The Time
&lt;/h2&gt;

&lt;p&gt;I literally keep this list open in a notepad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Starting stuff&lt;/span&gt;
git init                    &lt;span class="c"&gt;# Start tracking a folder&lt;/span&gt;
git clone &amp;lt;url&amp;gt;             &lt;span class="c"&gt;# Download someone else's repository&lt;/span&gt;

&lt;span class="c"&gt;# Daily workflow&lt;/span&gt;
git status                  &lt;span class="c"&gt;# What's changed?&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;                   &lt;span class="c"&gt;# Stage everything&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"message"&lt;/span&gt;     &lt;span class="c"&gt;# Save a snapshot&lt;/span&gt;
git push                    &lt;span class="c"&gt;# Send to GitHub&lt;/span&gt;
git pull                    &lt;span class="c"&gt;# Get changes from GitHub&lt;/span&gt;

&lt;span class="c"&gt;# Checking things&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt;           &lt;span class="c"&gt;# See commit history&lt;/span&gt;
git diff                    &lt;span class="c"&gt;# What changed?&lt;/span&gt;

&lt;span class="c"&gt;# When I mess up&lt;/span&gt;
git restore &amp;lt;file&amp;gt;          &lt;span class="c"&gt;# Undo changes to a file&lt;/span&gt;
git restore &lt;span class="nt"&gt;--staged&lt;/span&gt; &amp;lt;file&amp;gt; &lt;span class="c"&gt;# Unstage a file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 9: Mistakes I Made (So You Don't Have To)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mistake #1: Forgot to pull before pushing&lt;/strong&gt;&lt;br&gt;
I got an error saying my push was rejected. Turns out someone else had pushed changes. Solution: Always &lt;code&gt;git pull&lt;/code&gt; before &lt;code&gt;git push&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake #2: Terrible commit messages&lt;/strong&gt;&lt;br&gt;
My first few commits were like "updated file" and "changes". Now I can't remember what I did! Write clear messages!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake #3: Added sensitive files&lt;/strong&gt;&lt;br&gt;
I almost committed a file with my API key in it . Use &lt;code&gt;.gitignore&lt;/code&gt; files to tell Git to ignore certain files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mistake #4: Panicked when I saw a merge conflict&lt;/strong&gt;&lt;br&gt;
These happen when Git can't automatically combine changes. It's scary at first but not the end of the world. Git marks the conflicts in your files and you just need to choose which version to keep.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'm Learning Next
&lt;/h2&gt;

&lt;p&gt;Now that I've got the basics down, I want to learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to use branches properly (I keep hearing about them)&lt;/li&gt;
&lt;li&gt;What pull requests are and how to do code reviews&lt;/li&gt;
&lt;li&gt;More advanced Git commands&lt;/li&gt;
&lt;li&gt;How to contribute to open source projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Git was intimidating at first. The commands felt weird, and I didn't understand why I needed all this complexity just to save my code.&lt;br&gt;
Start small. Make a repository. Practice the basic commands: add, commit, push, pull. Don't worry about advanced stuff yet. I've been using Git for a few weeks and I still only use like 5 commands regularly!&lt;/p&gt;

&lt;p&gt;You've got this! And hey, if I figured it out, anyone can &lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>datascience</category>
      <category>data</category>
    </item>
  </channel>
</rss>
