<?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 Elizabeth on Medium]]></title>
        <description><![CDATA[Stories by Elizabeth on Medium]]></description>
        <link>https://medium.com/@elizabeth2023?source=rss-7b124ff39d3c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Elizabeth on Medium</title>
            <link>https://medium.com/@elizabeth2023?source=rss-7b124ff39d3c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:35:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elizabeth2023/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[Summarizing in SQL]]></title>
            <link>https://medium.com/@elizabeth2023/summarizing-in-sql-1d0d65e6d448?source=rss-7b124ff39d3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d0d65e6d448</guid>
            <category><![CDATA[aggregate-function]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Elizabeth]]></dc:creator>
            <pubDate>Wed, 19 Jun 2024 21:52:32 GMT</pubDate>
            <atom:updated>2024-06-20T06:30:53.251Z</atom:updated>
            <content:encoded><![CDATA[<p>The ability to extract meaningful insights from vast sets of data is cruicial in today’s data-driven world. For this purpose, SQL (Structured Query Language) stands out as the essential tool for managing and manipulating the data and the databases. Mastering SQL’s summarizing functions can significantly enhance analytical capabilities. It doesn&#39;t matter if you are a data analyst, business intelligence professional or a data enthusiast.</p><p>Summarizing means <strong>to make a summary of something</strong>, which is a concise form or a reduced version of the original information. To summarize is to express the main facts of ideas of something in a short and a clear way. Summarizing in SQL involves aggregating (forming groups or clusters) and manipulating large volumes of information to reveal important trends, patterns and anomalies that might otherwise go unnoticed. It is the fastest way to learn key insights about your dataset.</p><p>Let us delve into the essential techniques and functions that SQL offers to summarize data effectively. With tools like SUM(), which adds up values, AVG(), which calculates the average, and COUNT(), which counts the number of rows, you can create helpful summaries of your data. And when you use those tools together with the GROUP BY command, which groups rows based on a specific column, you can look at your data from different angles — like grouping course data by topic to see how engagement compares across subjects. The GROUP BY() statement is used to arrange identical data into groups.</p><p>In SQL, scalar functions and aggregate functions serve different purposes and operate in distinct ways. Here’s a detailed comparison of the two:</p><h3>Scalar Functions</h3><p><strong>Definition:</strong></p><ul><li>Scalar functions operate on a single or individual value and return a single value. Scalar functions in SQL help in manipulating data efficiently and the simplify complex calculations in the queries.</li></ul><p><strong>Characteristics:</strong></p><ul><li><strong>Input and Output:</strong> They take one input value and return one output value.</li><li><strong>Row-wise Operation:</strong> Scalar functions operate on each row individually.</li><li><strong>Usage:</strong> Commonly used to perform calculations or transformations on individual column values.</li><li><strong>Examples:</strong></li><li>UPPER(column_name): Converts a string to uppercase.</li><li>LEN(column_name): Returns the length of a string.</li><li>ABS(column_name): Returns the absolute value of a number.</li><li>GETDATE(): Returns the current date and time.</li></ul><pre>SELECT LOWER(first_name) as lower_case_name<br>FROM employees;</pre><p>In the above example, the ‘LOWER’ function is applied to each row’s ‘first_name’ column individually, and converts them into lowercase.</p><h3>Aggregate Functions</h3><p><strong>Definition:</strong></p><ul><li>Aggregate functions operate on a set of values and return a single summary value. They are mostly used with the GROUP BY clause to summarize data.</li></ul><p><strong>Characteristics:</strong></p><ul><li><strong>Input and Output:</strong> They take multiple input values (typically from a column) and return one summary value.</li><li><strong>Set-wise Operation:</strong> Aggregate functions operate on groups of rows, often defined by the GROUP BY clause.</li><li><strong>Usage:</strong> Commonly used to calculate summary statistics for a dataset.</li><li><strong>Examples:</strong></li><li>SUM(column_name): Returns the sum of values in a column.</li><li>AVG(column_name): Returns the average value of a column.</li><li>COUNT(column_name): Returns the number of non-null values in a column.</li><li>MAX(column_name): Returns the maximum value in a column.</li><li>MIN(column_name): Returns the minimum value in a column.</li></ul><pre>SELCT department_id, AVG(salary) as average_salary<br>FROM employees<br>GROUP BY department_id; </pre><p>In this example, the AVG function calculates the average salary for each department. The GROUP BY clause groups the rows by department_id, and the aggregate function operates on each group.</p><p>Lets look at some more examples of <strong>Aggregate</strong> functions.</p><p><strong>SUM()</strong> allows us to sum all the rows of a given column by adding the column values by row and resulting in a single value.</p><pre>SELECT SUM(price) AS total_cost<br>from order;</pre><p><strong>AVG()</strong> is used to calculate a column’s rows average.</p><pre>SELECT AVG(price) as avg_cost<br>FROM order;</pre><p>MIN() is used to find the minimum value and MAX() is used to find the maximum value in a column.</p><pre>SELECT MIN(price) as min_cost, MAX(price) as max_cost<br>FROM order;</pre><p>COUNT() applies directly to the rows. It allows counting the rows in a table.</p><pre>SELECT count(*) as num_rows<br>FROM invoice;</pre><p>The above query gives the count of the number of rows in the invoice table.</p><p>In conclusion, mastering aggregate functions in SQL is essential for anyone looking to harness the full power of data analysis within relational databases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d0d65e6d448" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic bar charts in Tableau]]></title>
            <link>https://medium.com/@elizabeth2023/basic-bar-charts-in-tableau-1e4ef026c476?source=rss-7b124ff39d3c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e4ef026c476</guid>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[bar-chart]]></category>
            <dc:creator><![CDATA[Elizabeth]]></dc:creator>
            <pubDate>Thu, 11 Jan 2024 17:22:16 GMT</pubDate>
            <atom:updated>2024-01-13T03:17:19.871Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we will look at how to create basic bar charts in tableau. We will take a look at three basic bar charts — <strong>Vertical, Horizontal and Stacked</strong>.</p><p>To understanding the creation of bar charts, we need to understand the difference between rows and columns in Tableau canvas. When you place a data point in rows, that data point gets displayed vertically and the data point that is placed in columns is displayed horizontally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*TkPLhuj-UNCpzhzL.png" /></figure><p>The green pills in Tableau denote continuous fields. They are displayed as a number line . They also produce the axis. Whereas Blue pills denote discrete fields. They slice up your data and also produce headers.</p><p>Now coming to the types of bar charts.</p><p><strong>Horizontal bar chart:</strong></p><p>The bars in the horizontal chart are parallel to the X axis. This means the green continuous field has to be on the column shelf. I used data from the SuperStore sample data set to create some examples. This dataset can be found in Tableau website or on kaggle.com. In the image below, you can see the SUM(quantity) continuous field on the column shelf, and the Sub-category which is a discrete field on the Rows shelf. The sub category data produced the headers on the side for different sub categories in the sales. The bar chart now shows the total quantity of items sold in each sub category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*OhMySSbiJRmO5dRD.png" /></figure><p>The bars can be sorted in ascending or descending order to see which sub category made the most or least sales.</p><p>To do that these two icons in the tool bar can be used. In the example below, the sales are sorted in the descending order. Binders have the highest sales and copiers the lowest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*3KDIfawX1KLYjd7q.png" /></figure><p><strong>Vertical Bar chart:</strong></p><p>We simply need to reverse the placement of the discrete and continuous data in the row and columns shelves.</p><p>The green continuous pill goes on the row shelf and the blue discrete pill on the column shelf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*_oREIonpjrtD-zWX.png" /></figure><p>Instead of manually moving the pills to different shelves, a vertical bar chart can be made from a horizontal bar chart by using this shortcut icon on the tool bar. And vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*QkKEHssXVc8x19P7.png" /></figure><p><strong>Stacked bar chart:</strong></p><p>To create a stacked bar chart, we can use either a horizontal or vertical bar chart. To create stacks, the bars need to be further subdivided into segments. In the marks card, we have different properties that can be used to create segments. There are color, size, label or detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/0*76CQXN_GXlTH1f0D.png" /></figure><p>In this example, ship mode is used. Dropping ship mode on to color divides the vertical bars in segments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*B7u4d2PLM7NUqBk5.png" /></figure><p>Adding Ship Mode again into label adds more information to the stacked vertical bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*W0svAJGtiiR0A7ee.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e4ef026c476" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>