<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Data Notes by Boladale on Medium]]></title>
        <description><![CDATA[Stories by Data Notes by Boladale on Medium]]></description>
        <link>https://medium.com/@favboladale?source=rss-7ba15a0e6169------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aenPfHkNxJFm_JXYwZBmkQ@2x.jpeg</url>
            <title>Stories by Data Notes by Boladale on Medium</title>
            <link>https://medium.com/@favboladale?source=rss-7ba15a0e6169------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:23:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@favboladale/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond Tables: Engineering a Production-Ready University Database]]></title>
            <link>https://medium.com/@favboladale/beyond-tables-engineering-a-production-ready-university-database-7110198212c3?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/7110198212c3</guid>
            <category><![CDATA[schema-design]]></category>
            <category><![CDATA[relational-databases]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[database-schema-design]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 13:30:31 GMT</pubDate>
            <atom:updated>2026-02-25T13:30:31.320Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Most database projects stop at the schema. This one doesn’t.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dOXr9ZAej77wcv2i" /><figcaption>Photo by <a href="https://unsplash.com/@domlafou?utm_source=medium&amp;utm_medium=referral">Dom Fou</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A few months ago, I started building what I thought would be a straightforward project — a database system for a university. Model the students, the courses, the results. Done.</p><p>But the further I went, the more I realized that every design decision I made was actually a question in disguise. Not just <em>what</em> to store, but <em>how</em> to store it. Not just <em>what works</em>, but <em>what works at scale</em>. Not just <em>can I query this</em>, but <em>can I query this without breaking everything else running at the same time</em>?</p><p>By the end, what started as a schema exercise had turned into a complete data platform — two separate databases, a live ETL pipeline, row-level security, automated data quality checks, and a reporting layer built specifically for analytics.</p><p>This is the story of the concepts that shaped it and why they matter well beyond any single project.</p><p>· · ·</p><p><strong>The Problem With Putting Everything in One Place</strong></p><p>The first real decision I had to make wasn’t about tables or columns. It was about architecture.</p><p>The natural instinct when building a database is to put everything in one place. One database, all your tables, done. And for small projects, that’s completely fine. But once you start thinking about how data actually gets <em>used</em>, one database becomes a problem.</p><p>Consider two very different types of queries. The first: a student clicks “Register Course” on a portal. The database needs to check their prerequisites, validate the deadline, confirm they haven’t exceeded their credit limit, and write one new row — all in under a second. The second: a Vice Chancellor wants to know the pass rates across all 14 faculties over the last three academic sessions, broken down by level. That query needs to scan millions of rows, aggregate across dozens of joins, and compute percentages.</p><p>These two queries are enemies. The first needs the database to be snappy and available for constant small reads and writes. The second needs to scan the entire table uninterrupted. Run them both on the same database, and they fight each other — long analytical queries lock up rows that operational queries need, and the database slows to a crawl for everyone.</p><p>The solution is to separate them. One database for operations — fast, current, the source of truth. A second database for analytics — structured for reading, optimised for aggregation, populated on a schedule from the first. This is the foundation of every serious data platform in production today, whether it’s called a data warehouse, a lakehouse, or something else entirely. The concept is always the same: <strong>transactional and analytical workloads should not compete for the same resources</strong>.</p><p>That’s why this project has two databases. luxuniversity_db handles everything live. luxuniversity_dw handles everything analytical. They never interfere with each other.</p><p>· · ·</p><p><strong>Your Data Has a History — Are You Keeping It?</strong></p><p>Here’s a question most databases can’t answer: what did this student’s record look like two years ago?</p><p>If you update a student’s programme, level, or status in a standard database, the old value is gone. Overwritten. You now only know what’s true today. For an operational system, that’s usually fine. But for analytics, it’s a serious problem.</p><p><em>For students who transferred from Science to Computing between 2022 and 2024, how did their GPA change after the transfer?</em></p><p>If you only store the current state of each student, you can’t answer that. You’ve lost the history.</p><p>This project handles it in two ways. For the operational database, the student table uses <strong>temporal tables</strong> — a built-in SQL Server feature where the database automatically maintains a shadow copy of every row change, with exact timestamps showing when each version was valid. No extra code. No triggers. SQL Server just does it. You can query the table as of any specific date and get a precise snapshot of what the data looked like then.</p><p>For the warehouse, the student dimension uses a technique called <strong>Slowly Changing Dimension Type 2</strong>, or SCD2. When a student’s attributes change, rather than overwriting the existing record, the old one is closed with an end date and a new one is created with a start date. Every fact — every course registration, every result — is permanently linked to the specific historical version of the student that existed when that event happened. You never lose context. You can always go back.</p><p>Together, these two techniques mean the system has a full, queryable memory. That’s not a luxury — in any environment where decisions are made from data, it’s a necessity.</p><p>· · ·</p><p><strong>Moving Data Is a Process, Not a One-Time Job</strong></p><p>Once you have two databases, you have a new problem: keeping them in sync.</p><p>The naive approach is to delete everything in the warehouse and reload it from scratch every time. For small datasets, that works. For anything real, it’s wasteful, slow, and fragile. If the job fails halfway through a full reload, you’re left with an empty warehouse until someone restarts it.</p><p>The better approach is <strong>incremental loading</strong> — and this is one of the most important concepts in data engineering.</p><p>The idea is simple: every time the pipeline runs, it only moves what’s new. To know what’s new, it needs a reference point — the last time it ran. This reference point is called a <strong>high-water mark</strong>.</p><p>In this project, the operational database has a small table with one row per entity — students, courses, results, registrations. Each row stores a timestamp: the last time that entity was extracted. When the pipeline runs, it reads these timestamps and only pulls rows updated after them. When it finishes successfully, it updates the timestamps to now. Next run, it picks up from there.</p><p>This means the pipeline is efficient regardless of how much historical data exists. It could run on a database with ten years of student records and only process the hundred rows that changed since yesterday. There’s also a failure recovery benefit: if the job fails, the watermarks aren’t updated, so the next run automatically retries from the last successful point. Nothing is skipped. Nothing is double-processed. That’s how real pipelines work.</p><p>· · ·</p><p><strong>Bad Data Doesn’t Wait for Convenient Timing</strong></p><p>One of the things I’ve observed working with real data systems: bad data always shows up at the worst possible moment — during a board presentation, during an audit, during a deadline. The reason is usually the same: nobody was checking.</p><p>This project has a data quality gate that runs before every ETL load. Ten automated checks, each one interrogating the source data for specific issues: results with total scores above 100, students registered for more than 24 credit units, grades that don’t match the score they’re supposed to represent, duplicate matric numbers, students with no programme assigned.</p><p>Two things make this more than just a list of checks. First, checks are classified by <strong>severity</strong>. Some are ERROR-level — if they find problems, the pipeline is blocked entirely. No corrupted data enters the warehouse. Others are WARNING-level — the problem is logged but the pipeline continues, because some issues need investigation without necessarily stopping everything.</p><p>Second, every check result is written to a log table with timestamps and record counts. This means you have a full history of data quality over time — you can see whether a problem has been getting worse, when it first appeared, and whether a fix had the intended effect.</p><p>Data quality shouldn’t be an afterthought you apply after something goes wrong. It should be a gate the data passes through before it’s trusted.</p><p>· · ·</p><p><strong>Not Everyone Should See Everything</strong></p><p>Data privacy is often treated as a legal obligation — something you handle with a policy document and a checkbox. But in a well-built data system, it’s enforced structurally, not just procedurally.</p><p>This project implements <strong>Row-Level Security</strong> — a SQL Server feature that makes access control part of the database itself rather than leaving it to the application. When a student logs in and queries the student table, they see exactly one row: their own. Not because the application filtered the results. Because the database engine filtered them before the application ever saw them.</p><p>The same table, queried by different users, returns different results. A student sees only their own record. A lecturer sees only students enrolled in courses they’re assigned to teach. A faculty admin sees all students in their faculty. A registry admin sees everyone.</p><p>This is enforced by a security function that SQL Server calls invisibly on every query. It cannot be bypassed by a developer who forgets to add a WHERE clause. It cannot be bypassed by a direct database connection that skips the application entirely. The restriction lives at the engine level.</p><p>This pattern applies everywhere sensitive data is handled — hospitals, financial institutions, HR systems, government platforms. The concept of enforcing access control as close to the data as possible, rather than relying on application-layer filtering, is one of the most important principles in data security.</p><p>· · ·</p><p><strong>Structure Your Analytics for the Questions You’re Actually Asking</strong></p><p>The warehouse in this project is built on a <strong>star schema</strong> — one of the most enduring patterns in analytical database design.</p><p>The idea is that you have fact tables and dimension tables. Fact tables store events — a student enrolled in a course, a student achieved a grade, a registration was submitted. Dimension tables store context — who the student is, what the course is, when it happened, where the student is from. The fact table is at the centre; the dimensions radiate outward from it like points on a star.</p><p>The reason this matters is query simplicity. When a university administrator wants to know the average grade point by faculty, broken down by session, filtered to 200L students — that query is four lines with a star schema. It would be fifteen lines navigating a fully normalised transactional schema. The star schema exists not because it’s theoretically elegant but because it makes answering real questions fast and straightforward.</p><p>This project goes a step further by adding <strong>columnstore indexes</strong> on all three fact tables. Standard databases store data row by row — to calculate an average across one column of a million rows, it has to read every column of every row even though it only needs one. Columnstore stores data column by column, compressed. To calculate that average, it only reads the one column it needs, already in a format optimised for batch processing. For analytical workloads, this typically results in queries running ten to a hundred times faster. The physical storage format matters as much as the logical design.</p><p>· · ·</p><p><strong>Building for the Questions Nobody Has Asked Yet</strong></p><p>One of the things I’m most pleased with in this project is the Nigerian state geography dimension — a table that maps all 37 states to their geopolitical zones and regions.</p><p>At first glance, it might seem optional. But consider what it enables. Not just “how many students are from Lagos” — but “is there a correlation between geopolitical zone and academic performance?” “Are students from particular regions disproportionately represented in at-risk cohorts?” “How has the regional diversity of admissions changed over the last five sessions?”</p><p>These are questions that university management, government education agencies, or policy researchers might want to ask — and the database is ready for them without any structural change. The dimension already exists. You just write the query.</p><p>This is the discipline of <strong>building for extensibility</strong> — not over-engineering, but thinking one layer ahead. Every dimension you add to a warehouse is a new axis on which you can slice every fact. Adding it later is expensive and disruptive. Adding it at design time costs almost nothing.</p><p>· · ·</p><p><strong>What This Project Is Really About</strong></p><p>On the surface, this is a university database. Under the surface, it’s a demonstration of how a thoughtful data engineer thinks about a problem.</p><p>It separates concerns that need to be separated. It preserves history that needs to be preserved. It validates data before trusting it. It enforces access control where it can’t be bypassed. It structures analytics for the questions that actually get asked. And it documents its own reasoning in the code — descriptions attached to every table and column, comments that explain not just what the code does but why.</p><p>None of these things are specific to universities. The same decisions come up when you’re building a financial platform, a healthcare system, a retail analytics stack, or a logistics operation. The domain changes. The concepts don’t.</p><p>If you want to explore the full schema, ETL pipeline, stored procedures, and documentation — the complete project, including a detailed technical README, is available on my GitHub. Click the link below:</p><p><a href="https://github.com/FavBoladale/University-Academic-Records-Database/blob/main/README.md">https://github.com/FavBoladale/University-Academic-Records-Database/blob/main/README.md</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7110198212c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Data Governance Only Shows Up for the Audit]]></title>
            <link>https://medium.com/@favboladale/when-data-governance-only-shows-up-for-the-audit-40ed1e24b580?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/40ed1e24b580</guid>
            <category><![CDATA[governance-and-tech]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-governance-framework]]></category>
            <category><![CDATA[data-governance]]></category>
            <category><![CDATA[data-best-practices]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 18:26:39 GMT</pubDate>
            <atom:updated>2026-02-04T08:01:53.192Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JYUF_M96MDQTzGcW" /><figcaption>Photo by <a href="https://unsplash.com/@dawson2406?utm_source=medium&amp;utm_medium=referral">Stephen Dawson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>No one plans to run data governance badly. But in many organizations, governance doesn’t really exist until one moment:</p><p><strong>“The auditors are coming.”</strong></p><p>That single email triggers a familiar chain reaction. Suddenly, meetings appear on calendars. Data owners are assigned overnight. Policies are dusted off, updated, and circulated. Dashboards are rebuilt. Evidence is gathered in a rush.</p><p>For a few intense weeks, everyone is “governance-focused.” Then the audit ends, and so does the discipline. This is not an exception. It’s a pattern.</p><h3>The Audit Fire Drill</h3><p>In theory, data governance is about control, clarity, and trust. In practice, many teams experience it as an emergency response exercise. During audit preparation, you often see:</p><ul><li>Lineage diagrams recreated from memory</li><li>Data quality issues rebranded as “edge cases.”</li><li>Access controls that exist in documentation but not in systems</li><li>Ownership defined by availability, not accountability</li></ul><p>The audit becomes performative rather than operational the moment governance is demonstrated, but not practiced.</p><h3>What Audits Really Reveal</h3><p>Audits don’t create governance problems. They expose the ones that already exist. To illustrate this reality, I recently conducted a comprehensive <strong>Data Governance Analysis</strong> across 5,500 data fields spanning six business domains. The analysis wasn’t designed to produce a compliance checklist; it was built to reveal behaviors and patterns that audits eventually expose.</p><p><a href="https://app.fabric.microsoft.com/links/fBhfZ0mknD?ctid=400db72b-0b52-4fb2-89fb-9381f0fa4628&amp;pbi_source=linkShare&amp;bookmarkGuid=bc58b7b2-f372-4350-989a-fb7597ebda16">Click here </a>to view the interactive Data Governance Dashboard</p><figure><img alt="An Enterprise Data Governance Overview" src="https://cdn-images-1.medium.com/max/1024/1*PkkMbv39kS-D6S197OshXg.png" /><figcaption>Enterprise Data Governance Overview</figcaption></figure><h3>The Numbers Tell a Story</h3><p>The data revealed a governance crisis hiding in plain sight:</p><ul><li><strong>11.2% Governance Health</strong> — Only 617 of 5,500 fields are compliant</li><li><strong>€2.06 billion in total exposure</strong> — €1.78B in potential fines + €277M remediation costs</li><li><strong>88.8% non-compliant or at-risk</strong> — The majority of data assets lack proper governance</li><li><strong>16,633 open issues</strong> across the organization</li></ul><p>These aren’t abstract metrics. They represent the accumulated cost of reactive governance — the kind that only activates when auditors schedule their visit.</p><h3>The Patterns of Reactive Governance</h3><p>My analysis focused less on compliance checklists and more on behaviors:</p><ul><li><strong>Where do teams struggle to produce evidence?</strong><br> The data showed 2,797 fields overdue for audit (&gt;365 days). When auditors arrive, these become scrambles to reconstruct documentation.</li><li><strong>Which controls only appear when requested?</strong><br> Only 11.1% of data qualified as “high-trust.” The rest exists in a gray zone — tracked on paper but not enforced in practice.</li><li><strong>How often does “policy” diverge from actual data usage?</strong><br> 1,050 fields showed weak controls: non-compliant, high-risk (&gt;70), and plagued with multiple issues (5+). These are fields where written policy stopped matching reality long ago.</li><li><strong>What risks remain invisible until someone asks the right question?</strong><br> HR domain carried €491M in exposure (60.2 average risk score), with 1,664 GDPR-relevant fields representing €564M in potential fines. Yet conversations about HR data governance only intensified when compliance questions arose.</li></ul><h3>When Governance is Reactive, specific patterns emerge:</h3><ul><li><strong>Quality metrics look healthy until you trace them to source systems</strong><br> Average quality score: 93.7%. Yet 2,466 fields (44.8%) had quality issues. Aggregated metrics masked field-level failures.</li><li><strong>Access reviews happen periodically, not continuously</strong><br> 45.1% of fields had Write or Admin access — excessive for many use cases, but never flagged because reviews happen “when needed.”</li><li><strong>Accountability is implied, not enforced</strong><br> 100% ownership coverage sounds impressive until you realize that zero enforcement mechanisms exist. Issues remained open indefinitely.</li><li><strong>Risk concentrates where visibility is lowest</strong><br> HR domain: €491M exposure, 60.2 average risk score. GDPR-relevant fields: €564M in potential fines. These conversations only intensified when auditors asked questions.</li></ul><p>These aren’t technical failures. They are operating model failures.</p><h3>The Cost of “Governance Theater”</h3><p>My analysis identified 1,050 fields with weak controls: non-compliant, high-risk (&gt;70), and plagued with multiple issues. These represent €879M in exposure — fields where written policy stopped matching reality long ago.</p><p>The Data_Warehouse system alone showed critical risk: high issue count, high risk score, and audit failures concentrated in one place. Yet it took a systematic analysis to surface this.</p><h3>What Good Governance Looks Like</h3><p>In my analysis, I mapped out what a functioning governance model would require:</p><p>The remediation plan demonstrated that transforming reactive governance into proactive discipline requires three things:</p><ol><li><strong>Ownership with accountability</strong> (Days 1–30)<br> Target: 1,050 high-risk fields with €879M exposure. Not just assigning owners, but tracking their progress weekly.</li><li><strong>PII protection and access control</strong> (Days 1–45)<br> Reclassify customer PII, reduce Admin access by 50%, and implement role-based access control. Governance as a technical control, not a policy hope.</li><li><strong>Data quality remediation</strong> (Days 30–90)<br> Target: 2,466 fields with quality issues. Move completeness thresholds from “measured” to “enforced.” Automated monitoring, not periodic reviews.</li></ol><p>This analysis made one thing clear: reactive governance is expensive. The €2.06B exposure wasn’t created overnight — it accumulated through thousands of small decisions to defer, delay, or “handle it later.”</p><p>This shift — from hurried compliance to continuous governance — is what my Data Governance Analysis project set out to highlight. Not by pointing fingers, but by making invisible gaps visible. Because the goal isn’t to survive the next audit, it is to build a data environment where audits no longer cause panic — because governance never went away in the first place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40ed1e24b580" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using PostgreSQL as a Data Warehouse: OLAP, CTEs, and Materialized Views]]></title>
            <link>https://medium.com/@favboladale/using-postgresql-as-a-data-warehouse-olap-ctes-and-materialized-views-8c3439347ff0?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c3439347ff0</guid>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Tue, 28 Oct 2025 10:51:35 GMT</pubDate>
            <atom:updated>2025-10-28T10:51:35.295Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5FnMxbRItKJHPX88" /><figcaption>Photo by <a href="https://unsplash.com/@casparrubin?utm_source=medium&amp;utm_medium=referral">Caspar Camille Rubin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the world of data engineering, PostgreSQL often earns respect for its reliability, ACID compliance, and open-source flexibility. But beyond transactional workloads, PostgreSQL can also shine as a lightweight data warehouse — capable of handling analytical queries, aggregations, and large-scale reporting.</p><p>In this post, we’ll explore how to use PostgreSQL for OLAP-style analytics, leveraging Common Table Expressions (CTEs) and Materialized Views to bring modern data warehousing features into your existing PostgreSQL environment.</p><p><strong>Why PostgreSQL for Data Warehousing?</strong></p><p>You might think of PostgreSQL primarily as an OLTP (Online Transaction Processing) database — the kind you’d use for storing application data. But PostgreSQL’s architecture also supports analytical workloads thanks to features like:</p><ul><li>Window functions for advanced analytics</li><li>CTEs for query organization and readability</li><li>Materialized Views for caching aggregated data</li><li>Parallel query execution for improved performance</li><li>Native JSONB for semi-structured data</li><li>BRIN indexes for efficient access to large, sequential datasets</li></ul><p>If you’re working in a small or mid-sized data team and want to avoid the cost or complexity of a full-blown data warehouse like Snowflake or BigQuery, PostgreSQL can offer a practical and scalable middle ground.</p><p><strong>Step 1: Setting Up the Data</strong></p><p>Let’s start by creating a simple dataset to simulate sales data.</p><pre>CREATE TABLE sales (<br>id SERIAL PRIMARY KEY,<br>region TEXT,<br>sale_date DATE,<br>amount NUMERIC<br>);<br><br>INSERT INTO sales (region, sale_date, amount)<br>SELECT<br>(ARRAY[&#39;East&#39;,&#39;West&#39;,&#39;North&#39;,&#39;South&#39;])[floor(random()*4 + 1)],<br>date &#39;2023–01–01&#39; + (random() * 600)::int,<br>(random()*1000)::int<br>FROM generate_series(1, 500000);</pre><p>This generates <strong>half a million rows</strong> — a realistic dataset for testing analytical workloads.</p><h3>Step 2: Basic OLAP Query</h3><p>We can start analyzing our data by grouping it by region:</p><pre>SELECT region, SUM(amount)<br>FROM sales<br>GROUP BY region;</pre><p>This simple aggregation helps confirm that PostgreSQL handles analytical queries efficiently even without extra tuning.</p><h3>Step 3: Using CTEs for Readable Analytics</h3><p><strong>Common Table Expressions (CTEs)</strong> let you break complex queries into manageable chunks. For example, to compute <strong>monthly sales</strong>, we can use:</p><pre>WITH monthly_sales AS (<br>SELECT<br>region,<br>date_trunc(&#39;month&#39;, sale_date) AS month,<br>SUM(amount) AS total_sales<br>FROM sales<br>GROUP BY region, date_trunc(&#39;month&#39;, sale_date)<br>)<br>SELECT * FROM monthly_sales<br>ORDER BY region, month;</pre><p>This is clearer, reusable, and easier to extend — a hallmark of maintainable analytical SQL.</p><h3>Step 4: Trend Analysis with Window Functions</h3><p>To analyze growth trends month-over-month:</p><pre>WITH monthly_sales AS (<br>SELECT<br>region,<br>date_trunc(&#39;month&#39;, sale_date) AS month,<br>SUM(amount) AS total_sales<br>FROM sales<br>GROUP BY region, date_trunc(&#39;month&#39;, sale_date)<br>),<br>growth AS (<br>SELECT<br>region,<br>month,<br>total_sales,<br>LAG(total_sales) OVER (PARTITION BY region ORDER BY month) AS prev_sales<br>FROM monthly_sales<br>)<br>SELECT<br>region,<br>month,<br>total_sales,<br>ROUND(((total_sales - prev_sales) / prev_sales) * 100, 2) AS growth_pct<br>FROM growth;</pre><p>This is where PostgreSQL starts to feel like a BI tool. With just SQL, you can compute metrics, growth rates, and rolling averages — all inside the database.</p><p><strong>Step 5: Speeding Things Up with Materialized Views</strong></p><p>Repeatedly querying large tables can be slow. <strong>Materialized Views</strong> allow you to store the results of expensive queries for faster access.</p><pre>CREATE MATERIALIZED VIEW mv_monthly_sales AS<br>SELECT<br>region,<br>date_trunc(&#39;month&#39;, sale_date) AS month,<br>SUM(amount) AS total_sales<br>FROM sales<br>GROUP BY region, date_trunc(&#39;month&#39;, sale_date);</pre><p>Now, you can query it directly:</p><pre>SELECT * FROM mv_monthly_sales WHERE region = &#39;East&#39;;</pre><p>And when new data arrives, simply refresh it:</p><pre>REFRESH MATERIALIZED VIEW mv_monthly_sales;</pre><p>This is especially useful when building dashboards or reporting layers.</p><p><strong>Step 6: Performance Tuning Tips</strong></p><p>PostgreSQL can scale well for analytics with a few tweaks:</p><ul><li>Use <strong>BRIN indexes</strong> for time-series or sequential data.</li></ul><pre>CREATE INDEX idx_sales_brin_date ON sales USING BRIN (sale_date);</pre><ul><li>Enable <strong>parallel queries</strong> (max_parallel_workers_per_gather &gt; 0).</li><li>Use <strong>partitioning</strong> for large fact tables (e.g., by month or region).</li><li>Keep statistics up-to-date: ANALYZE sales;.</li></ul><h3>Conclusion</h3><p>PostgreSQL isn’t just a transactional workhorse — it’s a capable, cost-effective data warehouse engine when tuned properly. By combining CTEs, window functions, and materialized views, you can build real-time analytics pipelines, dashboards, and reports directly inside PostgreSQL.</p><p>For many data teams, this means fewer moving parts, reduced costs, and faster insight delivery — without leaving the comfort of SQL.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c3439347ff0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Schema Compare in VS Code: A Hidden Gem for Data Professionals]]></title>
            <link>https://medium.com/@favboladale/schema-compare-in-vs-code-a-hidden-gem-for-data-professionals-94276f56cdfe?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/94276f56cdfe</guid>
            <category><![CDATA[sql-database]]></category>
            <category><![CDATA[schema-compare]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[vscode-extension]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Mon, 26 May 2025 08:50:02 GMT</pubDate>
            <atom:updated>2025-05-26T08:53:50.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0sXCtuDm1FVOKXJuMKIfMg.png" /><figcaption>A visual representation of Schema Compare</figcaption></figure><p>If you’re working with SQL Server or Azure SQL Database and you use <strong>Visual Studio Code</strong>, chances are you’ve already explored the <strong>MSSQL extension</strong>. But there’s one feature that often flies under the radar and deserves more attention: <strong>Schema Compare</strong>.</p><p>This post explores what Schema Compare does and why it’s useful. We’ll also walk through several real-world scenarios where it can save time, reduce risk, and streamline your database workflows.</p><p><strong>What is Schema Compare?</strong></p><p><strong>Schema Compare</strong> allows you to compare the schema (structure) of two SQL Server databases or a database and a Data-tier Application File (.dacpac). It shows you the differences — what’s added, removed, or changed — and lets you generate scripts to update the target schema to match the source.</p><p>You can think of it as <strong>Git diff</strong>, but for database structures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9sqjkrHxMPIhvFrloJMllg.png" /><figcaption>Schema Compare (preview)</figcaption></figure><h3>How to Access Schema Compare in VS Code</h3><ol><li>Install the <strong>MSSQL extension</strong> from the VS Code Marketplace.</li><li>In the Command Palette (Ctrl+Shift+P), search for <strong>“Schema Compare”</strong>.</li><li>Choose a <strong>source</strong> and <strong>target</strong> (can be live databases or .dacpac files).</li><li>Review the differences and generate a deployment script or apply changes directly.</li></ol><h3>Why Use Schema Compare?</h3><p>Manual database updates are risky. Schema Compare gives you visibility into what’s changed, helps avoid human error, and enables a smoother DevOps pipeline for SQL Server environments.</p><p>Now, let’s look at some <strong>real-world scenarios</strong> where it shines.</p><h3>8 Practical Scenarios for Using Schema Compare</h3><h3>1. Promoting Changes from Dev to Prod</h3><p>You’ve made schema updates in your development environment — maybe you added a new column, updated a stored procedure, or changed indexes. Before pushing to production, use Schema Compare to:</p><ul><li>Compare Dev with Prod</li><li>Review changes visually</li><li>Apply changes selectively or generate a script</li></ul><p>This reduces risk and ensures intentional deployments.</p><h3>2. Syncing Developer Databases</h3><p>In a team setting, each developer might have their own local SQL Server instance. Over time, their schemas drift apart.</p><p>With Schema Compare, you can:</p><ul><li>Align all local dev databases with a master development schema</li><li>Avoid merge issues during integration</li><li>Keep your environments consistent</li></ul><h3>3. Testing Environment Validation</h3><p>QA and Staging environments are supposed to mirror production, but often they don’t. Use Schema Compare to:</p><ul><li>Ensure the <strong>test DB schema</strong> matches your <strong>expected baseline</strong></li><li>Avoid bugs caused by schema mismatches during testing</li><li>Catch missing stored procedures or table changes early</li></ul><h3>4. Reverse Engineering Production Fixes</h3><p>Sometimes hotfixes are applied directly to production in emergencies. Later, you want to bring those changes back into source control or dev.</p><p>Compare <strong>Prod</strong> to <strong>Dev</strong> using Schema Compare to:</p><ul><li>Identify the schema changes made</li><li>Reapply them in Dev or source control for consistency</li></ul><h3>5. Refactoring Legacy Databases</h3><p>Planning to normalize a table or clean up your schema? Before and after the refactor, use Schema Compare to:</p><ul><li>See the full scope of changes</li><li>Validate that all intended objects were updated</li><li>Generate a script to apply the changes elsewhere</li></ul><h3>6. Comparing .dacpac to Live Database</h3><p>If you’re using a CI/CD pipeline that builds .dacpac files from source-controlled schema definitions, you can:</p><ul><li>Compare the .dacpac to a live database</li><li>See what would change if you deploy it</li><li>Validate deployments before pushing to production</li></ul><h3>7. Disaster Recovery &amp; Drift Detection</h3><p>Suspect someone made manual changes to the DB schema? Use Schema Compare to:</p><ul><li>Compare your current schema with a known good backup or .dacpac</li><li>Detect unintended changes</li><li>Restore the schema to its intended state</li></ul><h3>8. Schema Change Reviews</h3><p>Reviewing a pull request that includes database changes? Use Schema Compare to:</p><ul><li>Spin up the updated schema in a test DB</li><li>Compare it to the mainline schema</li><li>See what has changed without digging through SQL scripts</li></ul><p>The <strong>Schema Compare</strong> feature in the MSSQL extension is more than a convenience — it’s a powerful safety net for database development. It helps bridge the gap between manual changes and automated deployments, giving you confidence and control.</p><p>If you work in a team, manage environments, or simply want more visibility into how your database is evolving, Schema Compare is a tool you should add to your workflow.</p><h3>Want to Try It?</h3><ol><li>Install the<a href="https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql"> MSSQL extension</a> in VS Code</li><li>Connect to your SQL Server or Azure SQL DB</li><li>Use <strong>Schema Compare</strong> and see the difference (literally)!</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94276f56cdfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting an On-Prem SQL Server to a Microsoft Fabric Lakehouse (Step-by-Step)]]></title>
            <link>https://medium.com/@favboladale/connecting-an-on-prem-sql-server-to-a-microsoft-fabric-lakehouse-step-by-step-c33b5c804aff?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/c33b5c804aff</guid>
            <category><![CDATA[dataflow-gen2]]></category>
            <category><![CDATA[microsoft-fabric-tutorial]]></category>
            <category><![CDATA[microsoft-fabric]]></category>
            <category><![CDATA[data-lakehouse]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Wed, 14 May 2025 12:42:13 GMT</pubDate>
            <atom:updated>2025-05-14T14:57:10.100Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*C4m44Ue82ovQ8XyrZFXoJg.png" /><figcaption>Securely connecting legacy SQL infrastructure to modern analytics platforms</figcaption></figure><p>Microsoft is quickly becoming the go-to unified platform for analytics, combining data lakes, warehouses, ETL pipelines, and notebooks in one modern experience. But what if your data is still sitting in an on-premises SQL Server?</p><p>Good news: you don’t need to lift and shift everything to the cloud. With Microsoft Fabric, you can connect directly to your SQL Server using a secure component called the <strong>On-premises Data Gateway</strong>, and load your data straight into a <strong>Lakehouse</strong>.</p><p>Here’s exactly how to set it up:</p><p><strong>Prequisites</strong></p><ul><li>An <strong>on-prem SQL Server instance</strong> with read access</li><li>Access to a <strong>Microsoft Fabric workspace</strong> (Pro or Trial capacity)</li><li>A machine to install the <strong>On-premises Data Gateway</strong></li><li>Power BI service access (used to manage the gateway)</li></ul><h3>Step 1: Install the On-Premises Data Gateway</h3><p>The gateway acts as a secure tunnel between your on-prem network and Microsoft’s cloud services. It only makes outbound HTTPS calls — so it’s firewall-friendly and secure.</p><h3>Install It</h3><ol><li>Download from Microsoft:<br><a href="https://www.microsoft.com/en-us/download/details.aspx?id=53127">Download the Gateway</a></li><li>Run the installer on a reliable server, VM, or personal laptop with access to SQL Server.</li><li>Choose <strong>Standard Mode</strong> and sign in with your <strong>Microsoft 365 account</strong>.</li><li>Name your gateway (e.g., FabricGateway01)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oSHNtwXX_V_KO282jOpi_g.png" /><figcaption>On-premises data gateway</figcaption></figure><h3>Step 3: Create a Fabric Workspace</h3><p>You need a workspace in Fabric that has a <strong>Pro or Trial capacity</strong> assigned.</p><ol><li>In <a href="https://app.fabric.microsoft.com/">Microsoft Fabric</a>, click <strong>Workspaces &gt; New workspace</strong></li><li>Give it a name like Fabric Integration Demo or Learning Fabric</li><li>Assign the <strong>Fabric trial capacity</strong> if prompted</li></ol><h3>Step 3: Create a Lakehouse in Fabric</h3><ol><li>In your <strong>Fabric Workspace</strong>, click <strong>New</strong> → <strong>Lakehouse</strong></li><li>Name it (e.g., SalesLakehouse) and hit <strong>Create</strong></li></ol><h3>Step 4: Ingest SQL Server Data Using Dataflows Gen2</h3><p>This is where the magic happens.</p><ol><li>In your Fabric workspace, click <strong>New Item</strong>→ <strong>Dataflow Gen2. </strong>Then give it any name of your choice.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCmS3Tew5TPafecCsv8o2Q.png" /><figcaption>Dataflow Gen2</figcaption></figure><p>2. A Power Query page will open up. Click the <strong>“Get data” </strong>option in the Home tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ITsGLupDT-NUOdt8Umz1A.png" /><figcaption>Power Query</figcaption></figure><p>3. Select the <strong>SQL Server database</strong> as your source to get data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7aIWbDtbODMA0wejmMYFRQ.png" /><figcaption>Connect to SQL Server database</figcaption></figure><p>In the connection settings:</p><ul><li>Server &amp; Database: Add your on-prem server name and the exact database you want to connect to</li><li>Connection: If it is your first time doing this, leave the “create new connection” option. The connection name is usually created automatically.</li><li>Data Gateway: Select the on-prem data gateway you created earlier. Do not cancel it, the best approach is to minimize it.</li><li>Authentication Kind: I used the Windows option. Select the appropriate one for your machine.</li><li>Username &amp; Password: Add your machine or laptop username and password. To know your laptop username, open your command prompt and type “whoami”.</li><li>Click Next. If the connection is successful, you should see this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtDMzkUreKzlfhqpe_QxYA.png" /><figcaption>Choose Data</figcaption></figure><p>4. Select the table(s) you want. Then click the “Create” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQbEYMExhO84HVttqBsJ_w.png" /><figcaption>Select only needed table(s)</figcaption></figure><p>5. Use Power Query to clean, filter, or transform your data if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2bXNacQyOnhjMlUiK2nmA.png" /><figcaption>Transform Data</figcaption></figure><p>6. Click the “Add data destination” dropdown, choose <strong>Lakehouse</strong> as the destination</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3F8BZ6mX4leImYXMn47K1A.png" /><figcaption><strong>Lakehouse</strong> as the destination</figcaption></figure><p>7. After validation, select the exact Lakehouse you want to use as the data destination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lscUNmLuYCn9pFrN7RQyyQ.png" /><figcaption>Connect to destination</figcaption></figure><p>8. Configure your destination setting- Update Method, Schema Option, Column Mapping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9XK9MJ4cbxIFSto4F8f3Kg.png" /><figcaption>Destination settings</figcaption></figure><p>9. After saving the settings, click on “Save &amp; run” to load the transformed data into your Lakehouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNBbZBdAAuUa_94wJsbl6A.png" /><figcaption>Save and run Power Query</figcaption></figure><h3>Step 5: Explore Your Data in the Lakehouse</h3><p>Go to your Lakehouse → open the <strong>Tables</strong> tab.<br> Your ingested SQL Server tables should now be listed and ready for querying!</p><p>From here, you can:</p><ul><li>Use <strong>SQL endpoints</strong> to run queries</li><li>Build notebooks or Power BI reports</li><li>Schedule automated data refreshes</li></ul><h3>(Optional) Step 6: Schedule Refreshes</h3><p>Fabric makes it easy to keep your Lakehouse in sync with your on-prem SQL data.</p><p>Just go back to your <strong>Dataflow Gen2</strong>, and set up a <strong>refresh schedule</strong> (e.g., every hour, daily, etc.). It will pull new data using the same secure gateway.</p><h3>Wrapping Up</h3><p>Microsoft Fabric makes it surprisingly easy to connect modern analytics with traditional systems. With just a few clicks — and a secure gateway — you can bring data from your <strong>on-prem SQL Server</strong> directly into a <strong>Lakehouse</strong>, where it’s ready for analysis, modeling, or AI.</p><p>No migrations, no firewalls, no mess.</p><p><em>If you’re just starting with Microsoft Fabric, I highly recommend exploring Lakehouses and Dataflows Gen2 — they’re game-changers for modern data teams.</em></p><p>Got questions or need help setting this up in your environment? Drop a comment or message me!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c33b5c804aff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating A Custom Technical Dashboard]]></title>
            <link>https://medium.com/@favboladale/creating-a-custom-technical-dashboard-47f128c9fa74?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/47f128c9fa74</guid>
            <category><![CDATA[dashboard-design]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-analytics-dashboards]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[technical-support]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Mon, 03 Jun 2024 11:54:15 GMT</pubDate>
            <atom:updated>2024-06-03T12:05:42.380Z</atom:updated>
            <content:encoded><![CDATA[<h3>For companies who intend to deliver customer-centric support and monitor compliance with Industry Standards</h3><p>The success of the technical support department is a key differentiator for most businesses because the power to achieve a high level of customer satisfaction and loyalty lies in their hands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D74P6BqbfeDHRpt-" /><figcaption>A Technical Support Team</figcaption></figure><p>A company’s technical support department frequently generates a sea of data because of their direct contact with the customers. How then do we make sense of this vast sea of data generated daily ranging from the number of calls, emails, issues, compliance, etc? How do we make sense of everything to bring out insights to make informed decision-making and establish efficient operations?</p><p>Investing in a robust technical support dashboard is not just about improving support efficiency — it’s about building a resilient and customer-centric business. It helps streamline operations, facilitates proactive management, and ultimately contributes to a more satisfied and loyal customer base.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kFOZKKPhZJ5Iv3u1.png" /><figcaption>A Technical Support Dashboard</figcaption></figure><p>Here are some of the major importance of using a technical dashboard:</p><h3>Real-Time Monitoring:</h3><p>A technical support dashboard provides real-time visibility into ongoing issues, system performance, and support activities. This allows support teams to swiftly identify and address problems, minimizing downtime and enhancing user experience.</p><h3>Data-Driven Decisions:</h3><p>By aggregating and displaying key metrics such as response times, resolution rates, and customer satisfaction scores, a dashboard empowers managers to make informed decisions. These insights help in optimizing support processes, allocating resources effectively, and identifying areas for improvement.</p><h3>Enhanced Productivity:</h3><p>With all relevant information consolidated in one place, support agents can quickly access the data they need to resolve issues. This reduces the time spent on finding information and allows agents to focus more on providing solutions, thereby increasing productivity.</p><h3>Proactive Support:</h3><p>Dashboards can highlight trends and patterns in support tickets, enabling teams to anticipate and prevent potential issues before they escalate. Proactive support leads to fewer critical incidents and a more stable technical environment for users.</p><h3>Customer Satisfaction:</h3><p>Timely and efficient support is directly linked to higher customer satisfaction. A dashboard helps ensure that customer issues are addressed promptly and effectively, fostering trust and loyalty. Happy customers are more likely to stay with the company and recommend its services to others.</p><h3>Team Performance Tracking:</h3><p>Individual and team performance metrics displayed on the dashboard help in setting benchmarks and tracking progress. This not only motivates the support staff to maintain high standards but also assists in identifying training needs and recognizing top performers.</p><h3>Ensuring Compliance and Quality Control</h3><p>Many industries have strict regulations regarding customer interactions. Tracking support data ensures that your department adheres to these regulations and maintains high standards of quality control. Regular audits and reviews based on this data help in identifying compliance gaps and implementing necessary corrective actions.</p><p>Experience has shown many that creating technical support dashboards is not just a luxury but a necessity. I just built a robust technical support dashboard to improve the future of the business and ensure compliance, click the link <a href="https://app.powerbi.com/view?r=eyJrIjoiNDA0MTgwMjUtNDU0OS00Yjg2LThhNjItZDMzYzVkMmYwYmJhIiwidCI6IjQwMGRiNzJiLTBiNTItNGZiMi04OWZiLTkzODFmMGZhNDYyOCJ9">here</a> to see and let me know what you think.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47f128c9fa74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing a Banking Database Using SQL and Python]]></title>
            <link>https://medium.com/@favboladale/designing-a-banking-database-using-sql-and-python-1898cd29172f?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/1898cd29172f</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 17:28:41 GMT</pubDate>
            <atom:updated>2023-10-27T17:28:41.424Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8x4wE9YPDy5nIrjQtXLmg.png" /><figcaption>Designing a Banking Database</figcaption></figure><p>Introduction</p><p>In the world of finance, data is king. Banks and financial institutions handle vast amounts of information every day, from customer accounts and transactions to regulatory compliance data. To efficiently manage and analyze this data, a robust and well-structured database is essential.</p><p>In this blog post, we’ll explore the process of designing a banking database using SQL and Python, combining the power of structured query language with the flexibility of a high-level programming language.</p><h3>Why Use SQL and Python?</h3><p>SQL (Structured Query Language) is a powerful and widely used database language. It allows you to create, modify, and query data in a relational database. SQL excels at managing structured data, which is a perfect fit for the banking industry, where data integrity and consistency are paramount.</p><p>Python, on the other hand, is a versatile, high-level programming language known for its readability and ease of use. Python’s extensive library ecosystem and data-handling capabilities make it a great choice for interacting with databases, automating tasks, and performing complex data analysis.</p><h3>Planning the Banking Database</h3><p>Before diving into the technical details, careful planning is essential. To design a banking database, consider the following key elements:</p><h3>Entities:</h3><p>Identify the main entities in your banking system, such as customers, accounts, transactions, and employees.</p><h3>Attributes:</h3><p>Determine the attributes (fields) for each entity. For example, a “Customer” entity might have attributes like “customer_id,” “name,” “address,” and “contact_information.”</p><h3>Relationships:</h3><p>Define how these entities are related. A customer can have multiple accounts, and each account can have multiple transactions, forming a one-to-many relationship.</p><h3>Data Integrity:</h3><p>Enforce data integrity through constraints like primary keys, foreign keys, and unique constraints.</p><h3>Normalization:</h3><p>Apply database normalization techniques to minimize data redundancy and improve data consistency.</p><h3>Creating the Database Using SQL</h3><p>With your database design in hand, you can now start creating the database using SQL. Here are the basic steps:</p><ul><li>Select a Database Management System (DBMS): Choose a DBMS like MySQL, PostgreSQL, or SQLite, and install it on your system.</li><li>Create the Database: Use SQL commands to create the database schema. For example, use the CREATE DATABASE statement to create a new database.</li><li>Define Tables: Create tables for each entity with the appropriate attributes. Use SQL’s CREATE TABLE statement to define the table structure.</li><li>Set Relationships: Define relationships between tables using foreign keys. For instance, link the “Customer” and “Account” tables via the customer_id field.</li><li>Enforce Constraints: Add constraints to ensure data integrity. This includes defining primary keys, unique constraints, and check constraints.</li><li>Normalize the Database: Apply normalization techniques to organize the data efficiently.</li></ul><h3>Interacting with the Database Using Python</h3><p>Once your banking database is in place, you can use Python to interact with it. Python provides libraries and modules for database connectivity and manipulation, such as:</p><ul><li>SQLAlchemy: This popular library provides a high-level, Pythonic interface for interacting with databases, making it easier to perform complex queries, insert data, and manage transactions.</li><li>SQLite3: For simple applications or prototypes, you can use the built-in SQLite3 module in Python to interact with SQLite databases.</li><li>Pandas: If you need to perform data analysis and manipulation, the Pandas library is excellent for working with data retrieved from your database.</li><li>Flask/Django: If you’re building a web application, Python web frameworks like Flask and Django offer convenient tools for connecting your database to your application.</li></ul><h3>Conclusion</h3><p>Designing a banking database is a complex and critical task, requiring careful planning and attention to detail. SQL is your go-to tool for creating and maintaining the database schema, while Python adds flexibility and power to your database interactions.</p><p>By combining SQL and Python, you can build a robust and scalable banking database that not only stores customer information and transactions securely but also provides the foundation for robust analytics and automation to enhance your banking operations. Remember to follow best practices in database design and development to ensure the integrity and security of your financial data.</p><p>Click the link below to check the first banking database I created as a task on the engineering track of Datacamp.</p><p><a href="https://github.com/FavBoladale/Bank-Marketing-Database">https://github.com/FavBoladale/Bank-Marketing-Database</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1898cd29172f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Incremental Load in SSIS Using Lookup Transformation: Real-World Scenarios]]></title>
            <link>https://medium.com/@favboladale/incremental-load-in-ssis-using-lookup-transformation-real-world-scenarios-1a8e2b9a06f5?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a8e2b9a06f5</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[ssis-package-sql]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[etl-tool]]></category>
            <category><![CDATA[incremental-load]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Wed, 25 Oct 2023 10:19:08 GMT</pubDate>
            <atom:updated>2023-10-25T10:19:08.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mK7iSYs12Ns5uzpW0xatxg.png" /><figcaption>Incremental Load in SSIS</figcaption></figure><p>In the world of data integration, maintaining the freshness and accuracy of your data is paramount. The ETL (Extract, Transform, Load) process plays a crucial role in achieving this, and SSIS (SQL Server Integration Services) is a popular choice for ETL tasks. When dealing with large datasets, it’s not efficient to reload the entire dataset each time an update occurs. That’s where incremental load using the Lookup transformation in SSIS comes into play.</p><p>In this blog post, we’ll explore the concept of incremental loading using real-world scenarios.</p><h3>What is Incremental Load?</h3><p>Incremental load is an ETL technique used to update a target database with only the new or changed data, reducing the processing time and resource usage. Instead of transferring the entire dataset, you only move the data that is new or modified. The Lookup transformation in SSIS is a powerful tool for achieving this efficiently.</p><h3>Real-World Scenarios</h3><p>Scenario 1: Sales Data</p><p>Consider a retail company with a vast sales database. Each day, thousands of sales transactions are recorded. It’s neither practical nor efficient to reload all sales data every day. With incremental loading, you can use the Lookup transformation to identify and load only the new sales transactions. Here’s how:</p><h4>Data Extraction</h4><p>Extract the new sales data from your source (e.g., a point-of-sale system) using a timestamp or an incremental key.</p><h4>Lookup Transformation</h4><p>In your SSIS package, use the Lookup transformation to compare the source data with the existing data in the target database. This helps you identify the new sales records.</p><h4>Destination Load</h4><p>Load the new sales records into your target database using the OLE DB Destination.</p><p>Scenario 2: User Profiles</p><p>Imagine a social media platform with millions of users. Users update their profiles frequently with new information, such as profile pictures, bios, and contact details. Incremental loading is essential here to keep user profiles up-to-date without reloading the entire user database. Here’s how the Lookup transformation helps:</p><h4>Data Extraction</h4><p>Extract the changed user profiles from your source database, typically by comparing the timestamps of the last update.</p><h4>Lookup Transformation</h4><p>Use the Lookup transformation to identify the user profiles that have been updated or changed.</p><h4>Update in Target</h4><p>Update the user profiles in the target database with the new information. The Lookup transformation provides the necessary keys for this operation.</p><p>Scenario 3: Product Catalog</p><p>In an e-commerce company, the product catalog can include thousands of products. Products might get added, removed, or modified daily. To maintain an accurate product catalog, incremental loading with the Lookup transformation is vital:</p><h4>Data Extraction</h4><p>Extract the product data from your source system, such as a product management database.</p><h4>Lookup Transformation</h4><p>Use the Lookup transformation to compare the source product data with the existing catalog. Identify new products, changes, or deletions.</p><h4>Insert, Update, and Delete</h4><p>Depending on the results from the Lookup transformation, insert new products, update existing ones, and delete obsolete products in your product catalog.</p><h3>Benefits of Incremental Loading with Lookup Transformation</h3><h4>Efficiency</h4><p>Incremental loading reduces the amount of data transferred, making your ETL process more efficient.</p><h4>Faster Processing</h4><p>Smaller datasets mean quicker processing times, allowing for more frequent updates.</p><h4>Resource Savings</h4><p>By loading only the necessary data, you save both network and database resources.</p><h4>Improved Data Freshness</h4><p>Keeping your data up-to-date ensures that your business decisions are based on the latest information.</p><h4>Scalability</h4><p>As your data grows, incremental loading can help you manage the increasing data volumes effectively.</p><h3>Conclusion</h3><p>Incremental load using the Lookup transformation in SSIS is a powerful technique for keeping your data up-to-date with minimal resource consumption. Real-world scenarios, like sales data, user profiles, and product catalogs, demonstrate how this approach can be applied to different domains. By adopting this strategy, you can ensure that your ETL processes are efficient, timely, and reliable, ultimately supporting better business decisions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a8e2b9a06f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step-by-Step Guide on How to Load and Overwrite Data from SQL Server into an Excel File Using…]]></title>
            <link>https://medium.com/@favboladale/a-step-by-step-guide-on-how-to-load-and-overwrite-data-from-sql-server-into-an-excel-file-using-a415cbaec269?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/a415cbaec269</guid>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[ssis-package-sql]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 11:19:54 GMT</pubDate>
            <atom:updated>2023-10-24T13:14:14.485Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Step-by-Step Guide on How to Load and Overwrite Data from SQL Server into an Excel File Using SSIS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6zkAkvpvudC3x-VS" /></figure><h3>Introduction</h3><p>In the world of data integration and ETL (Extract, Transform, Load), SQL Server Integration Services (SSIS) is a powerful tool that allows you to connect to various data sources, transform the data, and load it into different destinations. One common destination for your data is Microsoft Excel.</p><p>Overwriting data in an Excel file using SQL Server Integration Services (SSIS) can be necessary for several reasons, depending on your data integration and reporting requirements. Some of these include periodic data updates, automated reporting, data sharing among team members, or improvement of performance and storage</p><p>In this blog post, we’ll explore how to load and overwrite data into an Excel file using SSIS, step by step.</p><h3>Prerequisites:</h3><p>Before we dive into the process, ensure you have the following prerequisites:</p><ul><li>SQL Server Data Tools (SSDT) installed.</li><li>SQL Server Integration Services (SSIS) installed.</li><li>A basic understanding of SSIS packages.</li><li>SQL Server Management Studio (SSMS)</li></ul><h3>Step 1: Create and Configure a New SSIS Project</h3><p>Create a new Integration Services Project. In the Solution Explorer, right-click on the “SSIS Packages” folder and select “New SSIS Package” to create a new package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pzSt9Q_ba7eVrX5F" /><figcaption>Creating and Configuring a New SSIS Project</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zCfv_RjJ3yT0RUN9" /><figcaption>New SSIS Package</figcaption></figure><h3>Step 2: Add Data Flow Task</h3><p>Within your SSIS project, add a Data Flow Task to your control flow by dragging and dropping a Data Flow Task from the Toolbox onto the Control Flow canvas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oi49CyVk1RvVoYMc" /><figcaption>Adding a Data Flow Task to your control flow</figcaption></figure><h3>Step 3: Configure the Data Source</h3><p>In the Data Flow tab, drag and drop an “OLE DB Source” as a data source component from the SSIS Toolbox onto the Data Flow canvas. Then double-click on the “OLE DB Source” to configure the source component to extract the data you want to overwrite in Excel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2t7u5H45QnEVltyN" /><figcaption>Configuring the Data Source- OLE DB</figcaption></figure><p>You can click new to select the server name, the database you want to connect to, and the table or view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TvDJKTWulCYfpe1_" /><figcaption>Configuring the properties used by the data flow to obtain data from our OLE DB source</figcaption></figure><h3>Step 4: Configure the Excel Destination</h3><p>Add an Excel Destination component from the toolbox to the Data Flow canvas.</p><p>Connect the output of your data source to the Excel Destination. Double-click the Excel Destination to configure it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tjqpA6nfC9kMbfqJ" /><figcaption>Configuring the Excel Destination</figcaption></figure><p>In the Excel Connection Manager, select an existing Excel file or create a new one where you want to overwrite the data. In the Excel Destination, specify the worksheet where you want to write the data. You can also set the “Excel Version” property to the appropriate version if it’s not detected automatically. Click OK to close the dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yih916L1ha8MY1jT" /><figcaption>Configuring the properties that enable the insertion of data via Excel provider</figcaption></figure><h3>Step 5: Configure the SQL Command or Table/View Name</h3><p>In the “OLE DB Source Editor,” under the “Data access mode” section, you can either specify an SQL command or choose a table or view from the Excel file in the “Name of the table or view” dropdown.</p><p>If you’re using an SQL command, enter your query in the “SQL command text” box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2Fh632cHIFIHSdCW" /><figcaption>Configuring the SQL Command</figcaption></figure><h3>Step 6: Mapping Columns</h3><p>After configuring the source, go to the “Columns” tab in the “OLE DB Source Editor” to map the corresponding columns from your data source (in this case your SQL serve)r to the destination in your SSIS data flow which is the Excel file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k_1VVCqF9_3pBDmw" /><figcaption>Mapping Columns</figcaption></figure><h3>Step 7: Execute the Package</h3><p>Save and execute the package by right-clicking on it in the Solution Explorer and selecting “Execute Package.”</p><p>If you follow the steps religiously, there is a high possibility of running into certain errors as seen in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/0*yBjjbfIx5f6ciaxN" /><figcaption>Package Validation Error</figcaption></figure><h3>Step 8: Error Handling and Logging</h3><p>It’s essential to implement proper error handling and logging in your SSIS package. You can add error flow components and configure logging to capture any issues during the execution of the package.</p><p>This error occurred because Excel does not recognize the data type “VARCHAR” as you would find in a database system (e.g., SQL Server, MySQL) which typically represents a variable-length character string with a character set (e.g., ASCII or UTF-8). Instead, Excel uses a general format called “Text” for representing alphanumeric or string data. In Excel, text data is treated as a general text string without a specific character length limit.</p><p>To handle the error above, I will be adding “Data Conversion” to the Data Flow so as to change the columns (City and Country) data type from a string [DT_STR] to a Unicode string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b_BOHhHGE_4wauk8" /><figcaption>Configuring the properties used to convert the data type of an input column to a different data type.</figcaption></figure><p>Also, will be editing the mapping to Copy of City and Copy of Country to City and Country respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pIwazJH9fpO39gCs" /><figcaption>Configuring the properties that enable the insertion of data via an Excel provider</figcaption></figure><h3>Step 9: Verify the Overwritten Data</h3><p>Now you can save and execute. Your package execution should be completed with success by now. Open the Excel file to verify that the data in the specified worksheet has been overwritten with the new data from the source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nBkyb1Xn_fkg_4Vd" /><figcaption>Data overwritten successfully</figcaption></figure><h4>Common Error in Overwriting Data</h4><p>More often than not, a major issue arises from this type of Data Flow where the more you re-execute the data flow, the more the Excel file gets populated with duplicate data. This is how to resolve that:</p><h3>Step 1:</h3><p>Add “Execute SQL Task” to the control flow (as seen in the image below) to drop and recreate the Excel sheet when you execute the project. Then connect it to the Data Flow task you already have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*94XlB89FCiFz2Jhy" /><figcaption>Adding “Execute SQL Task”</figcaption></figure><h3>Step 2:</h3><p>Double-click and edit the Connection type to Excel, Connection to Excel Connection Manager, and write an SQL code to drop the table and recreate it when you re-execute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jfpp78RheTYiRF24" /><figcaption>Configuring the properties required to run SQL statements</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E0mQjzNyYEIdL5Fj" /><figcaption>Configuring the properties required to run SQL statements</figcaption></figure><pre>Drop Table MyCityData<br>go<br>CREATE TABLE `MyCityData` (<br>`Id` INT,<br>`City` NVARCHAR(100),<br>`Country` NVARCHAR(100)<br>)</pre><p>Then re-execute and check your Excel file, the duplicates should be gone. Even when you re-execute it multiple times, you will not see a duplicate because of the SQL code you just included.</p><h3>Conclusion</h3><p>Overwriting data in an Excel file using SQL Server Integration Services (SSIS) is a common task in data integration projects. By following these steps, you can create a robust SSIS package that extracts data from a source, overwrites the data in an Excel file, and automates the process for your data integration needs. Remember to save your work regularly, test your package thoroughly, and consider scheduling its execution as needed to keep your data up-to-date.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a415cbaec269" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Limit a User’s Access Using the AWS IAM]]></title>
            <link>https://medium.com/@favboladale/how-to-limit-a-users-access-using-the-aws-iam-20da9ff4206b?source=rss-7ba15a0e6169------2</link>
            <guid isPermaLink="false">https://medium.com/p/20da9ff4206b</guid>
            <category><![CDATA[iam-user]]></category>
            <category><![CDATA[aws-iam-user]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-engineering]]></category>
            <dc:creator><![CDATA[Data Notes by Boladale]]></dc:creator>
            <pubDate>Sat, 07 Oct 2023 16:42:12 GMT</pubDate>
            <atom:updated>2023-10-07T16:42:12.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L4omMtlFNl0VzbG6" /></figure><h3>Introduction:</h3><p>In AWS (Amazon Web Services), IAM (Identity and Access Management) provides a robust framework for managing user permissions and access control. Inline policies offer a flexible way to define fine-grained permissions directly within an IAM entity. This blog post will walk you through the process of creating inline policies in AWS IAM, enabling you to precisely control access to your AWS resources. Let’s dive in!</p><h3>Step 1: Navigate to the IAM Service</h3><p>Once logged in, search for “IAM” in the services search bar at the top of the AWS Management Console. Click on “IAM” from the suggestions or select it from the list of available services.</p><h3>Step 2: Select the IAM Entity</h3><p>In the IAM console, locate and click on the entity (user, group, or role) to which you want to attach the inline policy. Here, I will be using the User entity “Francis” because I want to give him read-only permission to IAM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*20qoCyuHKEEQw-To" /></figure><h3>Step 3: Access the Permissions Tab</h3><p>Within the IAM entity’s details page, navigate to the “Permissions” tab. This tab displays the existing policies associated with the selected entity. Click the Add permission button on the right top and select the Create Inline Policy from the dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QrNuoAJNbnN6oJdd" /></figure><h3>Step 4: Add Inline Policy</h3><p>Under the “Permissions” tab, locate the “Inline Policies” section. Click on the “Add inline policy” button to create a new inline policy. In the policy editor, you can choose between the visual or JSON editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RMWglRmTa17P2nTE" /></figure><p>For simplicity, you can use the visual editor. Start by selecting the service or resource you want to grant access to from the “Service” dropdown. Specify the desired actions or permissions for the selected service or resource. Optionally, you can refine the policy by adding conditions using the “Add condition” button.</p><p>Personally, I prefer to use the JSON method. All I have to do is supply the code from IAM read-only access official documentation. Then click next and provide the policy details</p><pre>{</pre><pre>    &quot;Version&quot;: &quot;2012-10-17&quot;,</pre><pre>    &quot;Statement&quot;: {</pre><pre>        &quot;Effect&quot;: &quot;Allow&quot;,</pre><pre>        &quot;Action&quot;: [</pre><pre>            &quot;iam:Get*&quot;,</pre><pre>            &quot;iam:List*&quot;,</pre><pre>            &quot;iam:Generate*&quot;</pre><pre>        ],</pre><pre>        &quot;Resource&quot;: &quot;*&quot;</pre><pre>    }</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iM08__J6Q9KFYQz4" /></figure><h3>Step 5: Review and Name the Policy</h3><p>Review and fine-tune the policy until it accurately reflects your desired access requirements. Then provide a meaningful name for the policy in the “Name” field. Then click the Create Policy button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1YfFaeEmzBTLclyg" /></figure><h3>Step 6: Confirmation and Verification</h3><p>AWS will create the inline policy and associate it with the selected IAM entity.</p><p>You can confirm the successful creation by reviewing the inline policy in the entity’s permissions tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gyV6Qe9RJ_F_d2Yz" /></figure><h3>Conclusion</h3><p>Congratulations! You have successfully created an inline policy in AWS IAM. Inline policies offer a convenient way to define specific permissions directly within an IAM entity, granting fine-grained control over access to your AWS resources. By leveraging inline policies, you can customize and tailor permissions to meet your organization’s security and operational requirements.</p><p>To learn more about best practices and strategies to secure your cloud resources, implement identity and access management (IAM) policies, set up network security controls, and comply with industry standards and regulations, check out other blog posts I have on AWS IAM.</p><p><a href="https://favboladale.hashnode.dev/aws-iam-strengthening-security-and-access-control-in-the-cloud"><strong>AWS IAM: Strengthening Security and Access Control in the Cloud</strong></a></p><p><a href="https://favboladale.hashnode.dev/how-to-create-an-iam-user-and-add-mfa">How to Create an IAM User and Add MFA</a></p><p><a href="https://favboladale.hashnode.dev/how-to-create-an-iam-group">How to Create an IAM Group</a></p><p><a href="https://favboladale.hashnode.dev/step-by-step-guide-how-to-create-iam-roles-in-aws"><strong>How to Create IAM Roles in AWS</strong></a></p><p>Remember to subscribe to stay updated with the latest posts, and feel free to share your favorite blog posts with friends and family who crave engaging and enriching content. Happy reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20da9ff4206b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>