<?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: Emilio Ochieng</title>
    <description>The latest articles on DEV Community by Emilio Ochieng (@emilio_ochieng_632030149c).</description>
    <link>https://dev.to/emilio_ochieng_632030149c</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%2F3952242%2Fdc9ad1a1-cf7a-46eb-9abe-93c1a2468598.jpg</url>
      <title>DEV Community: Emilio Ochieng</title>
      <link>https://dev.to/emilio_ochieng_632030149c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emilio_ochieng_632030149c"/>
    <language>en</language>
    <item>
      <title>Data Modeling, Joins, Relationships, and Different Schemas</title>
      <dc:creator>Emilio Ochieng</dc:creator>
      <pubDate>Fri, 19 Jun 2026 08:33:38 +0000</pubDate>
      <link>https://dev.to/emilio_ochieng_632030149c/data-modeling-joins-relationships-and-different-schemas-47en</link>
      <guid>https://dev.to/emilio_ochieng_632030149c/data-modeling-joins-relationships-and-different-schemas-47en</guid>
      <description>&lt;h1&gt;
  
  
  Data Modeling, Joins, Relationships, and Different Schemas
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Data Modeling
&lt;/h2&gt;

&lt;h1&gt;
  
  
  What is Data Modeling?
&lt;/h1&gt;

&lt;p&gt;Data modeling is the process of designing and organizing data structures to define how data is stored, connected, and accessed within a database system.&lt;/p&gt;

&lt;p&gt;A data model serves as a blueprint for creating databases by identifying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data entities&lt;/li&gt;
&lt;li&gt;Attributes&lt;/li&gt;
&lt;li&gt;Relationships&lt;/li&gt;
&lt;li&gt;Constraints&lt;/li&gt;
&lt;li&gt;Business rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The primary goal of data modeling is to ensure data consistency, accuracy, efficiency, and scalability.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Consider a university system:&lt;/p&gt;

&lt;p&gt;Students&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student ID&lt;/li&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Email&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Courses&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Course ID&lt;/li&gt;
&lt;li&gt;Course Name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enrollments&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student ID&lt;/li&gt;
&lt;li&gt;Course ID&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This model defines how students interact with courses through enrollments.&lt;/p&gt;




&lt;h3&gt;
  
  
  Types of Data Models
&lt;/h3&gt;

&lt;h2&gt;
  
  
  1. Conceptual Data Model
&lt;/h2&gt;

&lt;p&gt;The conceptual model provides a high-level view of business entities and relationships.&lt;/p&gt;

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

&lt;p&gt;Student → Enrolls In → Course&lt;/p&gt;

&lt;p&gt;Characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business-focused&lt;/li&gt;
&lt;li&gt;No technical details&lt;/li&gt;
&lt;li&gt;Easy for stakeholders to understand&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Logical Data Model
&lt;/h2&gt;

&lt;p&gt;The logical model defines attributes, primary keys, and relationships.&lt;/p&gt;

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

&lt;p&gt;Student&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Student_ID (PK)&lt;/li&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Email&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Course&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Course_ID (PK)&lt;/li&gt;
&lt;li&gt;Course_Name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enrollment&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enrollment_ID (PK)&lt;/li&gt;
&lt;li&gt;Student_ID (FK)&lt;/li&gt;
&lt;li&gt;Course_ID (FK)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Physical Data Model
&lt;/h2&gt;

&lt;p&gt;The physical model describes how data is implemented in a database system.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;Student&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;Student_ID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;Email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database-specific&lt;/li&gt;
&lt;li&gt;Includes indexes and storage details&lt;/li&gt;
&lt;li&gt;Optimized for performance&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Database Relationships
&lt;/h1&gt;

&lt;p&gt;Relationships define how tables interact with each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  One-to-One Relationship (1:1)
&lt;/h2&gt;

&lt;p&gt;Each record in one table relates to one record in another table.&lt;/p&gt;

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

&lt;p&gt;Person ↔ Passport&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Person ID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;John&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Passport ID&lt;/th&gt;
&lt;th&gt;Person ID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;P123&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A person can have only one passport.&lt;/p&gt;




&lt;h2&gt;
  
  
  One-to-Many Relationship (1:M)
&lt;/h2&gt;

&lt;p&gt;One record can relate to many records.&lt;/p&gt;

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

&lt;p&gt;Customer → Orders&lt;/p&gt;

&lt;p&gt;One customer can place many orders.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;td&gt;Emilio&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order ID&lt;/th&gt;
&lt;th&gt;Customer ID&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;101&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Many-to-Many Relationship (M:M)
&lt;/h2&gt;

&lt;p&gt;Many records relate to many records.&lt;/p&gt;

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

&lt;p&gt;Students ↔ Courses&lt;/p&gt;

&lt;p&gt;A student can take multiple courses.&lt;br&gt;
A course can have multiple students.&lt;/p&gt;

&lt;p&gt;This requires a bridge table.&lt;/p&gt;

&lt;p&gt;Student&lt;/p&gt;

&lt;p&gt;Course&lt;/p&gt;

&lt;p&gt;Enrollment&lt;/p&gt;


&lt;h1&gt;
  
  
  Primary Keys and Foreign Keys
&lt;/h1&gt;
&lt;h2&gt;
  
  
  Primary Key (PK)
&lt;/h2&gt;

&lt;p&gt;A unique identifier for records in a table.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;Student_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unique&lt;/li&gt;
&lt;li&gt;Cannot be null&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Foreign Key (FK)
&lt;/h2&gt;

&lt;p&gt;A field that references a primary key in another table.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;Student_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in Enrollment table references:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;Student&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Student_ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintains data integrity&lt;/li&gt;
&lt;li&gt;Creates relationships&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Joins
&lt;/h1&gt;

&lt;p&gt;Joins combine data from multiple tables based on related columns.&lt;/p&gt;

&lt;h2&gt;
  
  
  INNER JOIN
&lt;/h2&gt;

&lt;p&gt;Returns matching records from both tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;
&lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;Only customers who have placed orders appear.&lt;/p&gt;




&lt;h2&gt;
  
  
  LEFT JOIN
&lt;/h2&gt;

&lt;p&gt;Returns all records from the left table and matching records from the right table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;
&lt;span class="k"&gt;LEFT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;All customers appear, even those without orders.&lt;/p&gt;




&lt;h2&gt;
  
  
  RIGHT JOIN
&lt;/h2&gt;

&lt;p&gt;Returns all records from the right table and matching records from the left table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;
&lt;span class="k"&gt;RIGHT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Returns all records from both tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;
&lt;span class="k"&gt;FULL&lt;/span&gt; &lt;span class="k"&gt;OUTER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  CROSS JOIN
&lt;/h2&gt;

&lt;p&gt;Produces every possible combination.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Products&lt;/span&gt;
&lt;span class="k"&gt;CROSS&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Stores&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simulations&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Matrix generation&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Schemas in Data Warehousing
&lt;/h1&gt;

&lt;p&gt;A schema defines how tables are structured and connected within a database or data warehouse.&lt;/p&gt;




&lt;h2&gt;
  
  
  Star Schema
&lt;/h2&gt;

&lt;p&gt;The most common schema in Business Intelligence and Power BI.&lt;/p&gt;

&lt;p&gt;Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          Customer
              |
Product -- Fact Sales -- Date
              |
           Store
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One central fact table&lt;/li&gt;
&lt;li&gt;Multiple dimension tables&lt;/li&gt;
&lt;li&gt;Simple structure&lt;/li&gt;
&lt;li&gt;Fast query performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to understand&lt;/li&gt;
&lt;li&gt;Optimized for reporting&lt;/li&gt;
&lt;li&gt;Ideal for Power BI&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Snowflake Schema
&lt;/h2&gt;

&lt;p&gt;A normalized version of the Star Schema.&lt;/p&gt;

&lt;p&gt;Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Product
   |
Category
   |
Fact Sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dimension tables are split further&lt;/li&gt;
&lt;li&gt;Reduces redundancy&lt;/li&gt;
&lt;li&gt;More complex joins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better data integrity&lt;/li&gt;
&lt;li&gt;Reduced storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disadvantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More joins&lt;/li&gt;
&lt;li&gt;Slightly slower queries&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Galaxy Schema (Fact Constellation)
&lt;/h2&gt;

&lt;p&gt;Contains multiple fact tables sharing dimension tables.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fact Sales
      |
Customer
      |
Fact Inventory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Used when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple business processes exist&lt;/li&gt;
&lt;li&gt;Enterprise-level data warehouses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Supports complex analytics&lt;/li&gt;
&lt;li&gt;Highly scalable&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Relationships in Power BI
&lt;/h1&gt;

&lt;p&gt;Power BI relies heavily on relationships between tables.&lt;/p&gt;

&lt;p&gt;Common Relationship Types:&lt;/p&gt;

&lt;h3&gt;
  
  
  One-to-Many
&lt;/h3&gt;

&lt;p&gt;Most common.&lt;/p&gt;

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

&lt;p&gt;Customers → Orders&lt;/p&gt;

&lt;p&gt;CustomerID&lt;/p&gt;




&lt;h3&gt;
  
  
  Many-to-One
&lt;/h3&gt;

&lt;p&gt;Reverse of one-to-many.&lt;/p&gt;




&lt;h3&gt;
  
  
  Many-to-Many
&lt;/h3&gt;

&lt;p&gt;Used when multiple records match across tables.&lt;/p&gt;

&lt;p&gt;Requires careful management to avoid ambiguity.&lt;/p&gt;




&lt;h1&gt;
  
  
  Best Practices
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Use Star Schema whenever possible.&lt;/li&gt;
&lt;li&gt;Create meaningful primary keys.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary many-to-many relationships.&lt;/li&gt;
&lt;li&gt;Use surrogate keys in data warehouses.&lt;/li&gt;
&lt;li&gt;Keep fact tables narrow and dimension tables descriptive.&lt;/li&gt;
&lt;li&gt;Optimize joins for performance.&lt;/li&gt;
&lt;li&gt;Document all relationships clearly.&lt;/li&gt;
&lt;/ol&gt;




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

&lt;p&gt;Data modeling, joins, relationships, and schemas are fundamental concepts in database design and data engineering. Data modeling provides structure, relationships define how data interacts, joins retrieve meaningful information, and schemas organize data efficiently for analytics and reporting. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>dataengineering</category>
      <category>sql</category>
    </item>
    <item>
      <title>Linux Fundamentals for Data Engineers.</title>
      <dc:creator>Emilio Ochieng</dc:creator>
      <pubDate>Thu, 18 Jun 2026 13:02:38 +0000</pubDate>
      <link>https://dev.to/emilio_ochieng_632030149c/linux-fundamentals-for-data-engineers-84h</link>
      <guid>https://dev.to/emilio_ochieng_632030149c/linux-fundamentals-for-data-engineers-84h</guid>
      <description>&lt;h3&gt;
  
  
  The Essential Guide
&lt;/h3&gt;

&lt;p&gt;In the world of data engineering, Python, SQL, and Spark often steal the spotlight. Yet underneath these tools lies the operating system that powers most data platforms: Linux. Whether you're managing Airflow on an EC2 instance, troubleshooting a Kafka cluster, or building ETL pipelines in a Docker container, Linux proficiency directly impacts your productivity and reliability as a data engineer.This guide covers the Linux fundamentals every data engineer should master.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why Linux Matters in Data Engineering
&lt;/h2&gt;

&lt;p&gt;Most cloud data platforms (AWS, GCP, Azure) run on Linux. Self-hosted tools like Apache Airflow, dbt, Spark, Kafka, Flink, and PostgreSQL are designed for Linux environments. Data engineers who understand Linux can:Debug infrastructure issues faster&lt;br&gt;
Write more efficient automation scripts&lt;br&gt;
Secure data pipelines properly&lt;br&gt;
Optimize resource usage&lt;br&gt;
Reduce dependency on DevOps teams&lt;/p&gt;

&lt;p&gt;Mastering Linux turns you from a "SQL + Python" engineer into a true infrastructure-aware data professional.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Installation &amp;amp; User Management
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Choosing the Right Distribution
&lt;/h4&gt;

&lt;p&gt;For data engineering, Ubuntu LTS (22.04 or 24.04) is the most popular choice due to its stability and vast package ecosystem. CentOS/Rocky Linux/AlmaLinux are common in enterprise environments.&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating a Dedicated UserNever run data pipelines as root.
&lt;/h4&gt;

&lt;p&gt;Create a dedicated user:&lt;br&gt;
&lt;strong&gt;bash&lt;/strong&gt;&lt;br&gt;
sudo adduser dataeng&lt;br&gt;
sudo usermod -aG sudo dataeng   # Optional: grant sudo access&lt;/p&gt;

&lt;p&gt;SSH Key Authentication (Best Practice)bash&lt;/p&gt;

&lt;p&gt;ssh-keygen -t ed25519 -C "dataeng@workstation"&lt;br&gt;
ssh-copy-id dataeng@your-server-ip&lt;/p&gt;

&lt;p&gt;Disable password authentication in /etc/ssh/sshd_config for better security.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. File System &amp;amp; Permissions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Understanding the Linux Filesystem Hierarchy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/home – User files&lt;/li&gt;
&lt;li&gt;/var/log – Application and system logs (critical for debugging)&lt;/li&gt;
&lt;li&gt;/etc – Configuration files&lt;/li&gt;
&lt;li&gt;/opt – Third-party software&lt;/li&gt;
&lt;li&gt;/tmp – Temporary files (cleaned on reboot)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Permissions Deep Divebash&lt;/p&gt;

&lt;p&gt;ls -la&lt;br&gt;
chmod 755 script.sh          # Owner: rwx, Group/Other: rx&lt;br&gt;
chown dataeng: dataeng /opt/pipeline&lt;/p&gt;

&lt;p&gt;Special Permissions for Data WorkUse umask to control default file permissions and setfacl for complex shared directories in team environments.&lt;br&gt;
Practical Example:&lt;br&gt;
&lt;strong&gt;bash&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Create a shared data directory
&lt;/h5&gt;

&lt;p&gt;sudo mkdir -p /data/lakehouse&lt;br&gt;
sudo chown -R dataeng:dataeng /data&lt;br&gt;
sudo chmod -R 775 /data&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Process &amp;amp; Resource Management
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Essential commands&lt;/strong&gt;&lt;br&gt;
ps aux | grep spark          # Find processes&lt;br&gt;
top / htop                   # Interactive monitoring&lt;br&gt;
kill -9                 # Force kill (use carefully)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Systemd – The Modern Init System&lt;/strong&gt;&lt;br&gt;
Most data tools run as systemd services:&lt;br&gt;
sudo systemctl status postgresql&lt;br&gt;
sudo systemctl restart airflow&lt;br&gt;
sudo journalctl -u airflow -f   # Live logs&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>dataengineering</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
