<?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: Gabriel Mbuva</title>
    <description>The latest articles on DEV Community by Gabriel Mbuva (@mueti).</description>
    <link>https://dev.to/mueti</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%2F3969150%2F71d4c9e9-fd4b-4e76-882e-80ab4725436e.png</url>
      <title>DEV Community: Gabriel Mbuva</title>
      <link>https://dev.to/mueti</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mueti"/>
    <language>en</language>
    <item>
      <title>From Zero to Querying Data: Building My First PostgreSQL Database</title>
      <dc:creator>Gabriel Mbuva</dc:creator>
      <pubDate>Sun, 19 Jul 2026 11:12:51 +0000</pubDate>
      <link>https://dev.to/mueti/from-zero-to-querying-data-building-my-first-postgresql-database-47jo</link>
      <guid>https://dev.to/mueti/from-zero-to-querying-data-building-my-first-postgresql-database-47jo</guid>
      <description>&lt;p&gt;&lt;em&gt;If you're just getting started with SQL, this project is a great way to learn the fundamentals. In this article, I'll walk you through how I created a simple school database using PostgreSQL, inserted data, and wrote queries to retrieve meaningful information.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When learning SQL, one of the best ways to improve is by building a real database instead of just reading about commands. Recently, I completed an assignment where I had to create a database for a fictional secondary school called &lt;strong&gt;Greenwood Academy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The goal wasn't just to write SQL queries; it was to understand how databases are created, how data is stored, and how SQL is used to retrieve and manipulate that data.&lt;/p&gt;

&lt;p&gt;By the end of the project, I had learned how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create databases and tables&lt;/li&gt;
&lt;li&gt;Insert, update and delete records&lt;/li&gt;
&lt;li&gt;Filter data using different SQL operators&lt;/li&gt;
&lt;li&gt;Count records using aggregate functions&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;CASE WHEN&lt;/code&gt; to categorize data&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Step 1: Creating the Database
&lt;/h1&gt;

&lt;p&gt;The first thing I did was create a schema called &lt;strong&gt;greenwood_academy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Schemas help organize database objects such as tables. Then I switched into the schema before creating my tables.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2w1ddl8vywpp5y0cgm0a.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2w1ddl8vywpp5y0cgm0a.png" alt=" " width="351" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 2: Creating the Tables
&lt;/h1&gt;

&lt;p&gt;Next, I created three tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Students Table
&lt;/h2&gt;

&lt;p&gt;This table stores information about students.&lt;/p&gt;

&lt;p&gt;Some of the columns include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student ID&lt;/li&gt;
&lt;li&gt;First name&lt;/li&gt;
&lt;li&gt;Last name&lt;/li&gt;
&lt;li&gt;Gender&lt;/li&gt;
&lt;li&gt;Date of Birth&lt;/li&gt;
&lt;li&gt;Class&lt;/li&gt;
&lt;li&gt;City&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Subjects Table
&lt;/h2&gt;

&lt;p&gt;This table stores the subjects taught in the school together with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subject name&lt;/li&gt;
&lt;li&gt;Department&lt;/li&gt;
&lt;li&gt;Teacher&lt;/li&gt;
&lt;li&gt;Credit hours&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Exam Results Table
&lt;/h2&gt;

&lt;p&gt;Finally, I created a table that stores each student's exam performance.&lt;/p&gt;

&lt;p&gt;It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student ID&lt;/li&gt;
&lt;li&gt;Subject ID&lt;/li&gt;
&lt;li&gt;Marks&lt;/li&gt;
&lt;li&gt;Grade&lt;/li&gt;
&lt;li&gt;Exam date&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This table connects students with the subjects they took.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc644dgnkfff03pfu9d14.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc644dgnkfff03pfu9d14.png" alt=" " width="799" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Modifying the Database
&lt;/h1&gt;

&lt;p&gt;Databases often change as requirements change.&lt;/p&gt;

&lt;p&gt;In this assignment, I practiced modifying tables using &lt;code&gt;ALTER TABLE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;First, I added a phone number column, then later, I removed the same column because it was no longer needed.&lt;br&gt;
I also renamed the &lt;code&gt;credits&lt;/code&gt; column to &lt;code&gt;credit_hours&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These exercises helped me understand that databases can evolve over time without starting from scratch.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faqx4oxbfbpg9dkyr7dz1.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faqx4oxbfbpg9dkyr7dz1.png" alt=" " width="561" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: Inserting Data
&lt;/h1&gt;

&lt;p&gt;Once the tables were ready, I populated them with data.&lt;/p&gt;

&lt;p&gt;The assignment provided:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10 students&lt;/li&gt;
&lt;li&gt;10 subjects&lt;/li&gt;
&lt;li&gt;10 exam results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using &lt;code&gt;INSERT INTO&lt;/code&gt;, I added each record into its respective table.&lt;/p&gt;

&lt;p&gt;After inserting the data, I confirmed everything had been inserted correctly using:&lt;/p&gt;

&lt;p&gt;SELECT * FROM students;&lt;br&gt;
I repeated this for the other two tables.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F55e72sjtbj5wfqsh95cb.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F55e72sjtbj5wfqsh95cb.png" alt=" " width="642" height="685"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Updating and Deleting Data
&lt;/h1&gt;

&lt;p&gt;One thing I learned is that data isn't always permanent.&lt;/p&gt;

&lt;p&gt;Sometimes information changes.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;A student moved from Nakuru to Nairobi.&lt;/li&gt;
&lt;li&gt;An exam mark was entered incorrectly.&lt;/li&gt;
&lt;li&gt;One exam record had to be deleted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Commands such as delete and update allow us to maintain accurate data without recreating the database.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F11rny6qpylaeuixh2pm8.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F11rny6qpylaeuixh2pm8.png" alt=" " width="637" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 6: Querying Data
&lt;/h1&gt;

&lt;p&gt;This was probably the most interesting part of the assignment. Using &lt;code&gt;SELECT&lt;/code&gt; and &lt;code&gt;WHERE&lt;/code&gt;, I could answer questions about the stored data.Simple queries like these are the foundation of SQL.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7qy8izsrttvr7itazqqp.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7qy8izsrttvr7itazqqp.png" alt=" " width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Using SQL Operators
&lt;/h1&gt;

&lt;p&gt;After learning basic filtering, I explored more powerful operators.&lt;/p&gt;

&lt;h2&gt;
  
  
  BETWEEN
&lt;/h2&gt;

&lt;p&gt;Used to find values within a range.&lt;/p&gt;

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

&lt;p&gt;Find students who scored between 50 and 80.&lt;/p&gt;

&lt;h2&gt;
  
  
  IN
&lt;/h2&gt;

&lt;p&gt;Instead of writing multiple OR conditions, &lt;code&gt;IN&lt;/code&gt; makes queries cleaner.&lt;/p&gt;

&lt;h2&gt;
  
  
  NOT IN
&lt;/h2&gt;

&lt;p&gt;Returns values that don't belong to a specified list.&lt;/p&gt;

&lt;h2&gt;
  
  
  LIKE
&lt;/h2&gt;

&lt;p&gt;Used for pattern matching.&lt;/p&gt;

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

&lt;p&gt;sql&lt;br&gt;
WHERE first_name LIKE 'A%'&lt;/p&gt;

&lt;p&gt;This returns students whose names begin with the letter A.&lt;/p&gt;

&lt;p&gt;Learning these operators made my queries much shorter and easier to read.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fchu6gqwt0xsrm3sj2t29.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fchu6gqwt0xsrm3sj2t29.png" alt=" " width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 8: Counting Records
&lt;/h1&gt;

&lt;p&gt;Sometimes you don't need the actual records—you only need the total number.&lt;/p&gt;

&lt;p&gt;SQL provides aggregate functions for this.&lt;/p&gt;

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

&lt;p&gt;sql&lt;br&gt;
SELECT COUNT(*)&lt;br&gt;
FROM students&lt;br&gt;
WHERE class='Form 3';&lt;/p&gt;

&lt;p&gt;This tells us how many students are currently in Form 3.&lt;/p&gt;

&lt;p&gt;Aggregate functions become very useful when working with larger datasets.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1br7r5kztxwoaeksu6n2.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1br7r5kztxwoaeksu6n2.png" alt=" " width="642" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 9: Categorizing Data with CASE WHEN
&lt;/h1&gt;

&lt;p&gt;One of my favorite parts of the assignment was learning about &lt;code&gt;CASE WHEN&lt;/code&gt;. It works similarly to an &lt;strong&gt;if-else statement&lt;/strong&gt; in programming. Instead of just displaying marks, I could classify students into different performance levels.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Distinction&lt;/li&gt;
&lt;li&gt;Merit&lt;/li&gt;
&lt;li&gt;Pass&lt;/li&gt;
&lt;li&gt;Fail&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes query results much easier to understand.&lt;/p&gt;

&lt;p&gt;I also used &lt;code&gt;CASE WHEN&lt;/code&gt; to classify students as either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Junior&lt;/li&gt;
&lt;li&gt;Senior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;based on their class.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj6e02wall2h3inlvys0s.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj6e02wall2h3inlvys0s.png" alt=" " width="615" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What I Learned
&lt;/h1&gt;

&lt;p&gt;This assignment helped me understand the basic workflow of working with relational databases.&lt;/p&gt;

&lt;p&gt;I learned how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design tables&lt;/li&gt;
&lt;li&gt;Store data efficiently&lt;/li&gt;
&lt;li&gt;Modify existing tables&lt;/li&gt;
&lt;li&gt;Retrieve information using SQL queries&lt;/li&gt;
&lt;li&gt;Filter records using different operators&lt;/li&gt;
&lt;li&gt;Count records using aggregate functions&lt;/li&gt;
&lt;li&gt;Use conditional logic with &lt;code&gt;CASE WHEN&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although the database was small, the concepts are the same ones used in much larger real-world systems such as banking applications, hospital management systems, school management systems, and e-commerce platforms.&lt;/p&gt;

&lt;p&gt;If you're new to SQL, I highly recommend building small projects like this instead of only watching tutorials. Writing queries yourself helps reinforce the concepts much faster.&lt;/p&gt;

&lt;p&gt;This Greenwood Academy project gave me hands-on experience with the core SQL skills every beginner should know. I'm looking forward to building more complex databases involving joins, grouping, subqueries, and database normalization as I continue learning.&lt;/p&gt;

&lt;p&gt;If you've just started learning SQL, keep practicing. Every query you write brings you one step closer to becoming confident with databases.&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>community</category>
    </item>
    <item>
      <title>Connecting Power BI to Databases: A Quick Start Guide</title>
      <dc:creator>Gabriel Mbuva</dc:creator>
      <pubDate>Sun, 05 Jul 2026 09:39:23 +0000</pubDate>
      <link>https://dev.to/mueti/connecting-power-bi-to-databases-a-quick-start-guide-23ig</link>
      <guid>https://dev.to/mueti/connecting-power-bi-to-databases-a-quick-start-guide-23ig</guid>
      <description>&lt;p&gt;Power BI is a data visualization software that helps users connect to a wide variety of data sources without undergoing tedious manual extraction processes. Databases are one of the most used forms of data storage. Connecting them directly to Power BI helps organizations ensure accuracy across reports, establish a secure data stream, and deliver real-time insights.&lt;/p&gt;

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

&lt;p&gt;Before making a connection, it is important to understand the two main types of databases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Database&lt;/strong&gt;- It stores data directly on a user's device, allowing applications to work offline without needing an active internet connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloud-based Database&lt;/strong&gt;- It stores data on remote internet servers, allowing multiple users to securely access, sync, and update the exact same data from anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to connect Power BI to a database
&lt;/h2&gt;

&lt;p&gt;Before connecting Power BI to any database, ensure that the database server is running, you have the required connection details, and Power BI Desktop is installed on your computer. The connection process differs slightly depending on whether you're using a local database or a cloud-hosted database, but the overall workflow remains similar.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Connect Power BI to a Local SQL Database
&lt;/h2&gt;

&lt;p&gt;Connecting Power BI to a local SQL database enables you to analyze data stored on your computer or within your organization's network. Instead of exporting data into Excel every time you need to create a report, Power BI can connect directly to the database, making reporting more efficient and reducing the risk of using outdated data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Open Power BI Desktop
&lt;/h3&gt;

&lt;p&gt;Launch &lt;strong&gt;Power BI Desktop&lt;/strong&gt; and click &lt;strong&gt;Get Data&lt;/strong&gt; on the Home ribbon.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvf4w0bjvtl0pei1plpg0.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvf4w0bjvtl0pei1plpg0.png" alt=" " width="799" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Select SQL Server Database
&lt;/h3&gt;

&lt;p&gt;From the list of available data sources, search for &lt;strong&gt;SQL Server Database&lt;/strong&gt;, select it, and click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This connector allows Power BI to communicate directly &lt;br&gt;
with Microsoft SQL Server 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgh0e1oofkr7hmll6ahuu.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgh0e1oofkr7hmll6ahuu.png" alt=" " width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;In the connection window, provide your SQL Server details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; The name or IP address of your SQL Server instance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; Specify the database you want to connect to. If left blank, Power BI will display all databases you have permission to access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, choose the connectivity mode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Import&lt;/strong&gt; – Imports the data into Power BI, providing better performance for most reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DirectQuery&lt;/strong&gt; – Retrieves data directly from the database whenever a report is refreshed, making it suitable for frequently updated datasets.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;OK&lt;/strong&gt; once you've entered the required information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Authenticate
&lt;/h3&gt;

&lt;p&gt;Choose the appropriate authentication method for your SQL Server.&lt;/p&gt;

&lt;p&gt;Most users will use either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Windows Authentication&lt;/strong&gt;, which uses your Windows credentials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Authentication&lt;/strong&gt;, which requires a database username and password.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After entering the necessary credentials, click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Load the Data
&lt;/h3&gt;

&lt;p&gt;Once the connection is successful, the &lt;strong&gt;Navigator&lt;/strong&gt; window displays all available tables and views.&lt;/p&gt;

&lt;p&gt;Select the tables you want to analyze and choose one of the following options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Load&lt;/strong&gt; to import the data directly into Power BI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transform Data&lt;/strong&gt; to clean, filter, or reshape the data in Power Query before loading it into your report.
Your local SQL database is now connected to Power BI and ready for analysis.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  How to Connect Power BI to a Cloud-Based SQL Database
&lt;/h1&gt;

&lt;p&gt;Cloud-hosted databases work similarly to local databases but require an internet connection and, in many cases, additional security measures such as SSL encryption. The following steps demonstrate how to connect Power BI to a cloud-hosted PostgreSQL database securely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Import the Dataset into Your Cloud Database
&lt;/h3&gt;

&lt;p&gt;Before connecting Power BI, ensure your dataset has already been imported into your cloud-hosted PostgreSQL database.&lt;/p&gt;

&lt;p&gt;Using a database management tool such as DBeaver, connect to your database, create the required tables if necessary, and import your dataset.&lt;/p&gt;

&lt;p&gt;Once the import is complete, verify that the data appears correctly in the database.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe5yu9o6srik1ja7ofonv.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe5yu9o6srik1ja7ofonv.png" alt=" " width="800" height="544"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Download the SSL Certificate
&lt;/h3&gt;

&lt;p&gt;Many cloud database providers secure connections using SSL encryption.&lt;/p&gt;

&lt;p&gt;To obtain the required certificate:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your cloud database provider's dashboard.&lt;/li&gt;
&lt;li&gt;Navigate to your PostgreSQL database service.&lt;/li&gt;
&lt;li&gt;Download the &lt;strong&gt;SSL (CA) certificate&lt;/strong&gt; provided for your database.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This certificate enables Power BI to verify the identity of the database server and establish a secure encrypted connection.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fylnn5s78wb06y0slt60a.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fylnn5s78wb06y0slt60a.png" alt=" " width="799" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Connect Power BI to PostgreSQL
&lt;/h3&gt;

&lt;p&gt;Open &lt;strong&gt;Power BI Desktop&lt;/strong&gt; and click &lt;strong&gt;Get Data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Search for &lt;strong&gt;PostgreSQL Database&lt;/strong&gt;, select it, and click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Enter your:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hostname&lt;/li&gt;
&lt;li&gt;Port&lt;/li&gt;
&lt;li&gt;Database name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These connection details can be found in your cloud database provider's dashboard.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Folve0grrl74iq8oij65n.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Folve0grrl74iq8oij65n.png" alt=" " width="799" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Configure SSL
&lt;/h3&gt;

&lt;p&gt;When prompted, configure the SSL settings by selecting the downloaded SSL (CA) certificate.&lt;/p&gt;

&lt;p&gt;Using SSL encrypts all communication between Power BI and your PostgreSQL database, helping protect sensitive business data during transmission.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Authenticate
&lt;/h3&gt;

&lt;p&gt;Choose &lt;strong&gt;Database Authentication&lt;/strong&gt; and enter the PostgreSQL username and password for your database.&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Select and Load Your Tables
&lt;/h3&gt;

&lt;p&gt;After Power BI successfully establishes a secure connection, the &lt;strong&gt;Navigator&lt;/strong&gt; window will display all available tables.&lt;/p&gt;

&lt;p&gt;Select the required tables and click &lt;strong&gt;Load&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If your data needs cleaning or transformation, choose &lt;strong&gt;Transform Data&lt;/strong&gt; instead.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbl3q8riu8smxt199nej6.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbl3q8riu8smxt199nej6.png" alt=" " width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your cloud-hosted PostgreSQL database is now connected to Power BI, allowing you to build reports using centralized data that can be updated without repeatedly importing files.&lt;/p&gt;

&lt;h1&gt;
  
  
  Benefits of Connecting Power BI Directly to SQL Databases
&lt;/h1&gt;

&lt;p&gt;Connecting Power BI directly to a SQL database offers several advantages over manually importing spreadsheets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It minimizes manual data handling and reduces human error.&lt;/li&gt;
&lt;li&gt;Reports can be refreshed whenever the underlying database changes.&lt;/li&gt;
&lt;li&gt;Data remains centralized, ensuring consistency across multiple reports.&lt;/li&gt;
&lt;li&gt;Secure authentication and SSL encryption help protect sensitive information.&lt;/li&gt;
&lt;li&gt;Organizations can build scalable reporting solutions that grow alongside their data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Whether your data is stored locally or in the cloud, Power BI makes it easy to connect directly to SQL databases and transform raw data into meaningful insights. Local databases are ideal for offline or internal environments, while cloud-hosted databases provide secure, centralized storage that supports collaboration, remote access, and real-time reporting across multiple users.&lt;/p&gt;

&lt;p&gt;By connecting Power BI directly to your database instead of relying on exported files, you create a more reliable reporting workflow, improve data accuracy, and make it easier to generate real-time dashboards that support better business decisions.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Power BI: Modelling, Schemas, Joins and Relationships</title>
      <dc:creator>Gabriel Mbuva</dc:creator>
      <pubDate>Mon, 29 Jun 2026 06:03:40 +0000</pubDate>
      <link>https://dev.to/mueti/power-bi-modelling-schemas-joins-and-relationships-3ak7</link>
      <guid>https://dev.to/mueti/power-bi-modelling-schemas-joins-and-relationships-3ak7</guid>
      <description>&lt;p&gt;Power BI is a data visualization and business intelligence tool designed for business professionals with varying levels of data knowledge. Power BI's dashboard can be used to report and visualize data in a wide range of styles, including charts, graphs and more. It allows everyone from beginners to experts to easily see what is happening in their business and make faster, smarter decisions.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Data Modelling
&lt;/h2&gt;

&lt;p&gt;Data modelling is the process of organising, structuring, and defining relationships between your data table. It uses diagrams, symbols, and textual definitions to visually represent how data is captured, stored and used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reasons for data modelling&lt;/strong&gt;&lt;br&gt;
Seamless Data Exploration: Builds clear hierarchies and drill-down paths. This lets report consumers quickly navigate tables to uncover hidden trends.&lt;/p&gt;

&lt;p&gt;Maximum Query Performance: Directly dictates how fast your reports load. Clean modeling prevents redundant data and messy relationships from delaying visual renders.&lt;/p&gt;

&lt;p&gt;Guaranteed Report Accuracy: Secures the consistency, dependability, and integrity of your source records. This ensures decision-makers are always working with precise insights.&lt;/p&gt;

&lt;p&gt;Simplified DAX Writing: Keeps your Data Analysis Expressions short and clean. Well-structured tables eliminate the need for complex, unmaintainable override formulas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Schemas
&lt;/h2&gt;

&lt;p&gt;Schemas refer to the logical structure and organization of your data model. In Power BI we have two types of schemas; Star and snowflake schema.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Star Schema&lt;/strong&gt;: Is the most widely recommended and optimal design in Power BI. The center of the star is a Fact Tables which contains measurable, quantitative data, for example, sales revenue, quantity sold,  or transaction amounts. The fact tables contain foreign keys that link to dimension tables. Dimension tables form points of the star. They provide descriptive context for the facts. Dimension tables contain primary keys and are used to filter and group data in your reports. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snowflake Schema&lt;/strong&gt;: Is an extension of the star schema. In a snowflake schema, dimension tables are normalized, which means they are broken down into further sub-dimension tables. It reduces data redundancy but requires more complex relationships between tables, which can decrease query performance in Power BI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Joins
&lt;/h2&gt;

&lt;p&gt;A join is  a method used to merge tables together to combine information based on a shared column.&lt;br&gt;
Different types of joins in Power BI include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Left Outer&lt;/strong&gt;: Returns all rows from the left table and matching rows from the right table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Right Outer&lt;/strong&gt;: Returns all rows from the right table and matching rows from the left table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Outer&lt;/strong&gt;: Returns all rows from both tables, regardless of whether there is a match.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inner&lt;/strong&gt;: Returns only the matching rows present in both tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Left Anti&lt;/strong&gt;: Returns only rows from the left table that have no match in the right table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Right Anti&lt;/strong&gt;: Returns only rows from the right table that have no match in the left table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relationships
&lt;/h2&gt;

&lt;p&gt;Relationships are logical connections between tables based on shared columns. They are the foundation for a data model, enabling visuals to slice, filter, amd aggregate data seamlessly across multiple data sets. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of  Relationship Cardinality&lt;/strong&gt;&lt;br&gt;
Cardinality defines the nature of the relationship between two tables: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-Many&lt;/strong&gt;: The most common and recommended relationship. One row on the "one" side relates to multiple rows on the "many" side . Filters flow strictly from the "one" side to the "many" side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Many-to-Many&lt;/strong&gt;: Occurs when both tables have multiple rows matching the shared key. These are generally not recommended because they create unpredictable filter paths, unreliable totals, and performance bottlenecks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-to-One&lt;/strong&gt;: Both tables contain only one unique row for the related key. Used infrequently; usually suggests the data should have been merged into a single table initially.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>database</category>
      <category>microsoft</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Excel is Used in Real-World Data Analysis</title>
      <dc:creator>Gabriel Mbuva</dc:creator>
      <pubDate>Fri, 05 Jun 2026 06:42:53 +0000</pubDate>
      <link>https://dev.to/mueti/how-excel-is-used-in-real-world-data-analysis-3cbp</link>
      <guid>https://dev.to/mueti/how-excel-is-used-in-real-world-data-analysis-3cbp</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Excel is one of the most used tools for data analysis. It allows beginners like myself to easily clean, organize, analyze and visualize data.Excel enables users to work with large datasets and extract meaningful insights without requiring advanced technical skills.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Excel
&lt;/h2&gt;

&lt;p&gt;Excel is a spreadsheet that allows you to collect, organize, analyze, calculate, and visualize data efficiently.Despite the emergence of other data analysis tools like SQL and Power BI, Excel remains one of the most widely used tools for both personal and professional data management.This can be credited to its ease of access, learning, and use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ways Excel is used in real-world data analysis
&lt;/h2&gt;

&lt;p&gt;This week, I had the opportunity to explore how Excel is used in real-world data analysis.I discovered that Excel is not just a basic spreadsheet tool, but a powerful application that helps make sense of data and support decision-making.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data organization and cleaning&lt;/strong&gt;&lt;br&gt;
Excel is used to structure raw data, remove duplicates, and fix errors. This improves data quality, making it easier to analyze and more reliable for decision-making.This improves data quality, making it easier to analyze and more reliable for decision-making.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Financial reporting&lt;/strong&gt;&lt;br&gt;
Excel is commonly used in finance to create budgets, calculate profits and losses, and monitor expenses.It helps organizations keep accurate financial records and understand their financial situation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business decision-making&lt;/strong&gt;&lt;br&gt;
Businesses use Excel to track sales, compare performance over time, and identify trends.This helps managers understand what is working well and what needs improvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Excel features and formulas
&lt;/h2&gt;

&lt;p&gt;In just a week, I have learned several Excel formulas that simplify data management and make working with data more efficient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SUM function&lt;/strong&gt;&lt;br&gt;
The SUM function is used to add a range of values together in Excel, making it one of the most essential tools for quick calculations.It's used to automatically add a range of numerical values together, eliminating the need for manual calculations. This not only saves time but also reduces the chances of errors when working with large datasets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data validation&lt;/strong&gt;&lt;br&gt;
Data validation in Excel is a feature used to control what type of data can be entered into a cell. It helps ensure that only correct and meaningful information is added to a dataset, reducing errors and improving data quality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conditional formatting&lt;/strong&gt;&lt;br&gt;
Conditional formatting is a useful Excel feature that automatically changes how cells look based on their values. It helps highlight important information in a dataset, making patterns and trends easier to see at a glance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IF and IFS functions&lt;/strong&gt;&lt;br&gt;
The IF function in Excel is used to make decisions based on a condition. It checks whether something is true or false and then returns a result.The IFS function is used when there are multiple conditions.Instead of using many IF statements, it allows you to test several conditions in one formula. &lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;Learning Excel has completely changed how I understand and interact with data.At first, I used to see spreadsheets as simple grids filled with numbers that didn’t really mean much.Now, I view them as powerful tools that reveal patterns and support decision-making when used correctly.As I worked more with Excel, I became more comfortable cleaning datasets, organizing information, and drawing meaningful insights from raw data. Features like formulas, data validation, and conditional formatting made it easier for me to structure data properly and quickly identify important trends. I also learned to approach problems more logically by breaking down datasets into smaller, manageable parts during analysis.Excel has given me a strong foundation in data analysis and it has motivated me to keep improving as I move toward more advanced tools and techniques in the field.&lt;/p&gt;

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