<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: SALOME CHEMUTAI</title>
    <description>The latest articles on Forem by SALOME CHEMUTAI (@salomestack).</description>
    <link>https://forem.com/salomestack</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3824114%2F5ba4d842-8a83-40a4-b287-272f691590df.png</url>
      <title>Forem: SALOME CHEMUTAI</title>
      <link>https://forem.com/salomestack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/salomestack"/>
    <language>en</language>
    <item>
      <title>SQL AND CTEs</title>
      <dc:creator>SALOME CHEMUTAI</dc:creator>
      <pubDate>Tue, 21 Apr 2026 03:35:40 +0000</pubDate>
      <link>https://forem.com/salomestack/sql-and-ctes-4di0</link>
      <guid>https://forem.com/salomestack/sql-and-ctes-4di0</guid>
      <description>&lt;p&gt;What is a subquery?&lt;br&gt;
Is a query that is written inside another query and allows one to carry out operations that actually depend on the result of another query. &lt;br&gt;
There are different types of subqueries&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; SCALAR SUBQUERY&lt;/li&gt;
&lt;li&gt; MULTI-ROW SUBQUERY &lt;/li&gt;
&lt;li&gt; CORRELATED AND NON-CORRELATED SUBQUERY 
SCALAR SUBQUERY
It runs a single value that is one row, one column 
Its operators mostly are greater than, less than, equal to, and EXISTS 
Example 
Find students who scored higher than the class average.
SELECT
student &lt;em&gt;name, score
FROM exam&lt;/em&gt; results
WHERE score &amp;gt; (SELECT AVG (score) FROM exam &lt;em&gt;results);
This should give you the students who scored way above the class average 
MULTI-ROW SUBQUERY 
It returns many rows, like one row with multiple columns or one column with multiple rows 
Example 
Find the names of students who are enrolled in "CRE," but the names are in the students table, and enrolment data is in the Enrolments table.
SELECT
student&lt;/em&gt; name 
FROM students 
WHERE student_id IN (
SELECT student &lt;em&gt;id
FROM enrolments 
WHERE course&lt;/em&gt; name = 'CRE'
);
This should give the names of students who enrolled in CRE, but their names are in different rows and columns.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CORRELATED AND NON-CORRELATED SUBQUERY&lt;br&gt;
Correlated subquery actually depends on the outer query, and it can never be executed on its own.&lt;br&gt;
Non-correlated subquery does depend on the inner query and can be executed on its own. &lt;br&gt;
Example &lt;br&gt;
Find students who scored higher than the average for their specific subject.&lt;br&gt;
 SELECT &lt;br&gt;
student_ name, subject, score&lt;br&gt;
FROM exam_ results AS main&lt;br&gt;
WHERE score &amp;gt; (&lt;br&gt;
    SELECT AVG (score) &lt;br&gt;
    FROM exam_ results AS sub &lt;br&gt;
    WHERE sub. subject = main. Subject&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;WHEN TO USE? &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Comparisons -between data in the tables &lt;/li&gt;
&lt;li&gt; Filtering data in a row &lt;/li&gt;
&lt;li&gt; Replacing temporary tables &lt;/li&gt;
&lt;li&gt; For the calculation of bigger sums &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What are CTEs &lt;br&gt;
Also called common table expressions &lt;br&gt;
CTEs named results in SQL can be referenced in a single statement for easier simplifications of complex logics, be readable, and reusable &lt;br&gt;
Types of CTEs and their uses &lt;br&gt;
Non-recursive CTEs &lt;br&gt;
Mostly used in SQL &lt;br&gt;
Refers to a set of your script that you can refer to anytime &lt;br&gt;
Uses &lt;br&gt;
For simplifying results, e.g., totals, AVG &lt;br&gt;
Used in listing multiple CTEs &lt;br&gt;
Used in referencing, e.g., reusing codes &lt;br&gt;
Recursive CTEs &lt;br&gt;
Reference itself independently &lt;br&gt;
Executions always continue only until you command them to stop &lt;br&gt;
Uses &lt;br&gt;
For organizations of data in a systematic way &lt;br&gt;
Used to create lists of data or series, such as generating all the working days in a certain month &lt;br&gt;
Used in finding paths in different places &lt;/p&gt;

&lt;p&gt;Conclusion &lt;br&gt;
We used CTEs mostly because it allows you to write your code once &lt;br&gt;
When you define your data source at the beginning, it makes the query read like a story.&lt;/p&gt;

&lt;p&gt;Comparisons between subqueries and CTEs &lt;br&gt;
Readability- Subquery is nested inside, while CTEs are nested outside &lt;br&gt;
Maintenance – Subquery is a bit challenging to maintain due to the large logic, while CTEs are easier &lt;br&gt;
Reusability – Subqueries cannot be reused, while CTEs are commonly reused within the same query &lt;br&gt;
Use case- Subquery is convenient for simple filtrations, while CTEs are convenient for complex filtrations.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>devops</category>
      <category>web3</category>
      <category>database</category>
    </item>
    <item>
      <title>excel</title>
      <dc:creator>SALOME CHEMUTAI</dc:creator>
      <pubDate>Tue, 21 Apr 2026 03:28:29 +0000</pubDate>
      <link>https://forem.com/salomestack/sql-and-ctes-5b78</link>
      <guid>https://forem.com/salomestack/sql-and-ctes-5b78</guid>
      <description>&lt;h1&gt;
  
  
  DAY 1
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Excel
&lt;/h3&gt;

&lt;p&gt;I learnt &lt;strong&gt;excel&lt;/strong&gt; &lt;em&gt;today&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Publish Power report and embed into Website</title>
      <dc:creator>SALOME CHEMUTAI</dc:creator>
      <pubDate>Tue, 07 Apr 2026 01:21:21 +0000</pubDate>
      <link>https://forem.com/salomestack/how-to-publish-power-report-and-embed-into-website-53i8</link>
      <guid>https://forem.com/salomestack/how-to-publish-power-report-and-embed-into-website-53i8</guid>
      <description>&lt;p&gt;INTRODUCTION &lt;br&gt;
Publishing a Power BI report and embedding it into a website depends entirely on whether your data is public or private and how it is in the data set &lt;br&gt;
Currently, was doing power bi project,this article do explain the steps i applied as from data cleaning,modellings ,use of DAX functions,dashboards and etc &lt;br&gt;
STEP 1. CREATE A WORKSPACE.&lt;br&gt;
Before you publish your work, first you must have a workspace in power bi desktop where you will create your work and keeping tracks of your projects.&lt;br&gt;
STEP 2. PUBLISH FROM POWER BI DESKTOP&lt;br&gt;
When you have save your file, you can now publish it  by click publish on right side of power bi desktop, hence select.&lt;br&gt;
STEP 3. GENERATE EMBED CODE &lt;br&gt;
After publishing your data, you can now generate the code that is on website which is the browser when you click the file at the left top.&lt;br&gt;
STEP 4. EMBED ON THE WEBPAGE &lt;br&gt;
You now open a HTML file in text editor ,paste where you want your report to appear at after saving the file .&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>learning</category>
      <category>git</category>
    </item>
  </channel>
</rss>
