<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dilan Bosire</title>
    <description>The latest articles on DEV Community by Dilan Bosire (@dilan_bosire).</description>
    <link>https://dev.to/dilan_bosire</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%2F3393966%2Fed153893-5657-48b0-b507-099cebed4933.png</url>
      <title>DEV Community: Dilan Bosire</title>
      <link>https://dev.to/dilan_bosire</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dilan_bosire"/>
    <language>en</language>
    <item>
      <title>Using Clustering to Group Songs by Tempo, Energy, and Vocals</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Wed, 21 Jan 2026 09:13:28 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/using-clustering-to-group-songs-by-tempo-energy-and-vocals-1505</link>
      <guid>https://dev.to/dilan_bosire/using-clustering-to-group-songs-by-tempo-energy-and-vocals-1505</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;With the rapid expansion of digital music libraries and streaming platforms, organizing and understanding large collections of songs has become increasingly important. As music datasets grow into the thousands or even millions of tracks, manual categorization becomes impractical. Clustering—an unsupervised machine learning technique—offers an effective solution by grouping songs based on shared characteristics without relying on predefined labels.&lt;/p&gt;

&lt;p&gt;This article explores how clustering can be applied to a dataset of 1,000 songs using three key audio features: tempo, energy level, and vocal presence. It also discusses the types of song groupings that are likely to emerge from such an analysis and their real-world applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding the Key Features
&lt;/h2&gt;

&lt;p&gt;Before applying clustering techniques, it is essential to understand the features used to represent each song:&lt;/p&gt;

&lt;h3&gt;
  
  
  Tempo
&lt;/h3&gt;

&lt;p&gt;Tempo refers to the speed of a song, measured in beats per minute (BPM). It plays a crucial role in defining the pace and mood of a track, distinguishing fast-paced dance songs from slower, more relaxed compositions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Energy Level
&lt;/h3&gt;

&lt;p&gt;Energy is a numerical representation of a song’s intensity and activity. It is often derived from attributes such as loudness, rhythm strength, and dynamic range. High-energy songs tend to feel lively and powerful, while low-energy songs are calmer and more subdued.&lt;/p&gt;

&lt;h3&gt;
  
  
  Vocal Presence
&lt;/h3&gt;

&lt;p&gt;Vocal presence measures the dominance of vocals in a track. This feature may be represented as a continuous scale (from low to high vocal intensity) or as a binary indicator distinguishing vocal tracks from instrumental ones.&lt;/p&gt;

&lt;p&gt;Together, these features capture both the rhythmic and expressive elements of music, making them ideal for clustering songs by mood, style, and listening context.&lt;/p&gt;




&lt;h2&gt;
  
  
  Applying Clustering Techniques
&lt;/h2&gt;

&lt;p&gt;To cluster the 1,000-song dataset effectively, the following steps are typically followed:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Data Preprocessing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Normalize or standardize tempo, energy, and vocal features to ensure that no single attribute dominates the clustering process.&lt;/li&gt;
&lt;li&gt;Handle missing or noisy data to improve the accuracy and reliability of the results.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Choosing a Clustering Algorithm
&lt;/h3&gt;

&lt;p&gt;Several clustering algorithms are well suited for music data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;K-Means Clustering&lt;/strong&gt;&lt;br&gt;
A popular and efficient algorithm that partitions songs into a predefined number of clusters based on similarity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hierarchical Clustering&lt;/strong&gt;&lt;br&gt;
Useful for exploring relationships between clusters and identifying subgroups within broader musical categories.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DBSCAN&lt;/strong&gt;&lt;br&gt;
Effective for detecting outliers or niche music styles that do not fit well into larger clusters.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Determining the Optimal Number of Clusters
&lt;/h3&gt;

&lt;p&gt;Techniques such as the &lt;strong&gt;elbow method&lt;/strong&gt; and the &lt;strong&gt;silhouette score&lt;/strong&gt; are commonly used to identify the most appropriate number of clusters.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Cluster Interpretation
&lt;/h3&gt;

&lt;p&gt;Once clustering is complete, the average tempo, energy, and vocal values of each cluster are analyzed to understand the musical characteristics of each group.&lt;/p&gt;




&lt;h2&gt;
  
  
  Expected Song Groupings
&lt;/h2&gt;

&lt;p&gt;Based on tempo, energy, and vocal presence, several natural clusters are likely to emerge:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. High-Tempo, High-Energy, Vocal-Heavy Songs
&lt;/h3&gt;

&lt;p&gt;These clusters typically include pop, EDM, dance, and upbeat hip-hop tracks. They are well suited for workouts, parties, and energetic environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. High-Tempo, High-Energy, Instrumental Songs
&lt;/h3&gt;

&lt;p&gt;Often composed of electronic or instrumental dance music, these tracks are commonly used for gaming, background music, or focus-driven activities.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Medium-Tempo, Medium-Energy, Vocal-Focused Songs
&lt;/h3&gt;

&lt;p&gt;This group includes mainstream pop, rock, and alternative music, making it ideal for casual listening and radio play.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Low-Tempo, Low-Energy, Vocal-Heavy Songs
&lt;/h3&gt;

&lt;p&gt;Ballads, acoustic tracks, and emotionally expressive songs fall into this category and are often associated with relaxation or reflection.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Low-Tempo, Low-Energy, Instrumental Songs
&lt;/h3&gt;

&lt;p&gt;Ambient, classical, and lo-fi music typically form this cluster, commonly used for studying, meditation, or background ambiance.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Outlier or Niche Clusters
&lt;/h3&gt;

&lt;p&gt;These include experimental tracks with unusual tempos or mixed energy levels. While they may not align with common listening patterns, they represent unique artistic styles.&lt;/p&gt;




&lt;h2&gt;
  
  
  Practical Applications
&lt;/h2&gt;

&lt;p&gt;Clustering songs based on audio features has several real-world applications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Music Recommendation Systems&lt;/strong&gt;&lt;br&gt;
Improves personalized recommendations by grouping similar songs together.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Playlist Curation&lt;/strong&gt;&lt;br&gt;
Helps create playlists tailored to specific moods, activities, or environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Music Analysis and Discovery&lt;/strong&gt;&lt;br&gt;
Enables artists, producers, and analysts to understand musical trends and listener preferences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Market Segmentation&lt;/strong&gt;&lt;br&gt;
Allows streaming platforms to better target different listener groups.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A strong, data-driven method for grouping songs according to tempo, intensity, and vocals is clustering. Meaningful and intuitive song groups that reflect common listening moods and styles naturally arise when unsupervised learning techniques are applied to a dataset of 1,000 songs. These clusters deepen our understanding of musical patterns and listener behavior in addition to improving music discovery and recommendation systems.&lt;/p&gt;




</description>
      <category>algorithms</category>
      <category>data</category>
      <category>datascience</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Understanding Parametric and Non-Parametric Tests in Statistics</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Sun, 12 Oct 2025 10:02:12 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/understanding-parametric-and-non-parametric-tests-in-statistics-56mj</link>
      <guid>https://dev.to/dilan_bosire/understanding-parametric-and-non-parametric-tests-in-statistics-56mj</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In statistics, data rarely come in one form or follow one rule. Sometimes we have neat, normally distributed data; other times, our data are messy, skewed, or come from small samples. Because of this, researchers rely on two main types of tests to analyze data — &lt;strong&gt;parametric&lt;/strong&gt; and &lt;strong&gt;non-parametric tests&lt;/strong&gt;. Knowing the difference between them and when to use each is essential for drawing accurate conclusions from research.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What Are Parametric Tests?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Parametric tests&lt;/strong&gt; are statistical tests that make specific assumptions about the population data. The most important assumption is that the data follow a &lt;strong&gt;normal distribution&lt;/strong&gt;. These tests also assume that the data are measured on an &lt;strong&gt;interval or ratio scale&lt;/strong&gt; (meaning they have meaningful numerical values and equal spacing between them).&lt;/p&gt;

&lt;p&gt;Common examples of parametric tests include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;t-test&lt;/strong&gt; – compares the means of two groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ANOVA (Analysis of Variance)&lt;/strong&gt; – compares means across three or more groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pearson’s correlation&lt;/strong&gt; – measures the strength and direction of a linear relationship between two continuous variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because parametric tests rely on assumptions about the data, they tend to be &lt;strong&gt;more powerful&lt;/strong&gt; when those assumptions are met. This means they’re better at detecting true differences or relationships.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
Imagine a researcher comparing average blood pressure between two groups of adults. If the data are normally distributed and measured on a ratio scale, a &lt;strong&gt;t-test&lt;/strong&gt; would be the appropriate parametric choice.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What Are Non-Parametric Tests?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Non-parametric tests&lt;/strong&gt;, on the other hand, do not rely on strict assumptions about the data’s distribution. They’re often called &lt;strong&gt;distribution-free tests&lt;/strong&gt; because they can be used when data don’t follow a normal distribution, when sample sizes are small, or when data are ranked or ordinal rather than numerical.&lt;/p&gt;

&lt;p&gt;Common examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mann–Whitney U test&lt;/strong&gt; – compares two independent groups (used instead of a t-test).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kruskal–Wallis test&lt;/strong&gt; – compares more than two groups (used instead of ANOVA).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spearman’s rank correlation&lt;/strong&gt; – measures the relationship between two ranked variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Non-parametric tests are especially useful when dealing with &lt;strong&gt;non-normal&lt;/strong&gt;, &lt;strong&gt;skewed&lt;/strong&gt;, or &lt;strong&gt;ordinal&lt;/strong&gt; data, such as survey responses or rankings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
If a researcher wanted to compare satisfaction levels between two hospitals using survey scores on a scale of 1–5, a &lt;strong&gt;Mann–Whitney U test&lt;/strong&gt; would be more appropriate than a t-test because the data are ordinal and may not be normally distributed.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Key Differences Between Parametric and Non-Parametric Tests&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Aspect&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Parametric Tests&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Non-Parametric Tests&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Assumptions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Require normal distribution, equal variances&lt;/td&gt;
&lt;td&gt;No strict distribution assumptions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data Type&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Interval or ratio data&lt;/td&gt;
&lt;td&gt;Ordinal or ranked data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Statistical Power&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Higher when assumptions are met&lt;/td&gt;
&lt;td&gt;Lower but more flexible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;t-test, ANOVA, Pearson’s correlation&lt;/td&gt;
&lt;td&gt;Mann-Whitney U, Kruskal-Wallis, Spearman’s correlation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;When to Use&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data are normally distributed and continuous&lt;/td&gt;
&lt;td&gt;Data are not normal, small sample size, or ordinal&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Why Are They Important?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Choosing the Right Test Prevents Errors&lt;/strong&gt;&lt;br&gt;
Using the wrong type of test can lead to misleading conclusions. For example, using a t-test on non-normal data could make the results unreliable. Knowing which test fits your data helps ensure accuracy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Reflect the Nature of the Data&lt;/strong&gt;&lt;br&gt;
Parametric and non-parametric tests acknowledge that data vary in quality, type, and distribution. By choosing the right test, researchers respect the data’s characteristics and avoid forcing it into the wrong model.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Complement Each Other&lt;/strong&gt;&lt;br&gt;
These two types of tests aren’t rivals—they work together. Parametric tests are ideal when data meet assumptions, while non-parametric tests are lifesavers when those assumptions are violated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Support Evidence-Based Decisions&lt;/strong&gt;&lt;br&gt;
Whether in healthcare, business, or social sciences, selecting the right statistical test ensures that decisions are grounded in reliable evidence rather than chance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Both parametric and non-parametric tests are essential tools in statistical analysis. Parametric tests are more powerful when data follow expected patterns, while non-parametric tests offer flexibility for real-world data that don’t fit neatly into assumptions. In practice, skilled researchers understand when to apply each test, ensuring their findings are accurate, fair, and meaningful. Ultimately, the choice between the two depends on one simple principle — always let the data guide the method.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;References&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Gravetter, F. J., &amp;amp; Wallnau, L. B. (2021). &lt;em&gt;Statistics for the behavioral sciences&lt;/em&gt; (11th ed.). Cengage Learning.&lt;/p&gt;

&lt;p&gt;Lane, D. M. (2020). &lt;em&gt;Introduction to statistics online edition&lt;/em&gt;. Rice University. &lt;a href="https://onlinestatbook.com" rel="noopener noreferrer"&gt;https://onlinestatbook.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Urdan, T. C. (2017). &lt;em&gt;Statistics in plain English&lt;/em&gt; (4th ed.). Routledge.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>datascience</category>
      <category>science</category>
    </item>
    <item>
      <title>Understanding Degrees of Freedom: Why They Matter in Statistics</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Sun, 12 Oct 2025 09:36:56 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/understanding-degrees-of-freedom-why-they-matter-in-statistics-438o</link>
      <guid>https://dev.to/dilan_bosire/understanding-degrees-of-freedom-why-they-matter-in-statistics-438o</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you’ve ever taken a statistics class, you’ve probably come across the term degrees of freedom. At first, it can sound confusing or overly technical—but it’s actually a simple and important idea. Degrees of freedom play a key role in how we calculate statistics, interpret results, and make decisions based on data. Understanding what they are and why they matter can help make sense of various statistical tests, including t-tests, ANOVA, and the chi-square test.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Degrees of Freedom?
&lt;/h2&gt;

&lt;p&gt;In simple terms, degrees of freedom (df) tell us how many numbers in a statistical calculation are free to vary. They represent the number of independent pieces of information we have when estimating something from a sample.&lt;/p&gt;

&lt;p&gt;Here’s an easy way to think about it:&lt;br&gt;
Imagine you have a sample of five numbers. You can pick any four of them freely, but once you know the average (mean) of the group, the fifth number can’t just be anything—it has to fit the mean. That means you only have four values that can truly vary, giving you 4 degrees of freedom (calculated as n - 1).&lt;/p&gt;

&lt;p&gt;In general, every time we estimate a parameter (like the mean) from data, we lose one degree of freedom. This adjustment helps keep our calculations accurate.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Degrees of Freedom in Common Statistical Tests&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;t-Test&lt;/strong&gt;&lt;br&gt;
When we compare means using a t-test, the degrees of freedom depend on how many observations we have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For a &lt;strong&gt;one-sample t-test&lt;/strong&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;df = n - 1&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For a &lt;strong&gt;two-sample t-test&lt;/strong&gt; (assuming equal variances):&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;df = n_1 + n_2 - 2&lt;/p&gt;

&lt;p&gt;The degrees of freedom tell us which &lt;em&gt;t&lt;/em&gt;-distribution to use when finding critical values or &lt;em&gt;p&lt;/em&gt;-values.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Chi-Square Test&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
For a &lt;strong&gt;goodness-of-fit&lt;/strong&gt; test, degrees of freedom are based on the number of categories:&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;df = k - 1&lt;/p&gt;

&lt;p&gt;In a &lt;strong&gt;test of independence&lt;/strong&gt; using a table, it’s:&lt;/p&gt;

&lt;p&gt;df = (r - 1)(c - 1)&lt;/p&gt;

&lt;p&gt;where &lt;em&gt;r&lt;/em&gt; is the number of rows and &lt;em&gt;c&lt;/em&gt; is the number of columns.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ANOVA (Analysis of Variance)&lt;/strong&gt;&lt;br&gt;
ANOVA divides degrees of freedom into two parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Between groups: &lt;em&gt;k - 1&lt;/em&gt; (where &lt;em&gt;k&lt;/em&gt; is the number of groups)&lt;/li&gt;
&lt;li&gt;Within groups: &lt;em&gt;N - k&lt;/em&gt; (where &lt;em&gt;N&lt;/em&gt; is the total number of observations)
These help determine whether the differences between group means are statistically significant.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Why Are Degrees of Freedom Important?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Adjust for Sample Size&lt;/strong&gt;&lt;br&gt;
Degrees of freedom make sure our statistical results reflect that we’re working with a sample, not an entire population. This adjustment helps keep our estimates more accurate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Shape Statistical Distributions&lt;/strong&gt;&lt;br&gt;
Many statistical distributions—like the &lt;em&gt;t&lt;/em&gt;-distribution and chi-square distribution—change shape depending on their degrees of freedom. For example, when df is small, the &lt;em&gt;t&lt;/em&gt;-distribution is wider and has heavier tails, but as df increases, it starts to look like the normal distribution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Ensure Accurate Results&lt;/strong&gt;&lt;br&gt;
Using the correct degrees of freedom means that our &lt;em&gt;p&lt;/em&gt;-values and confidence intervals are reliable. Getting them wrong could make us think results are significant when they’re not.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They Account for Constraints in the Data&lt;/strong&gt;&lt;br&gt;
Every time we calculate something like a mean or variance, we add a restriction on how the data can vary. Degrees of freedom adjust for these restrictions, keeping our calculations honest and precise.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Degrees of freedom may sound like a small technical detail, but they’re essential to accurate and meaningful statistical analysis. They help us understand how much information our data really gives us and ensure that the tests we use are fair and reliable. In short, degrees of freedom are what make our statistics trustworthy—they balance the freedom of data with the limits of estimation.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;References&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Gravetter, F. J., &amp;amp; Wallnau, L. B. (2021). &lt;em&gt;Statistics for the behavioral sciences&lt;/em&gt; (11th ed.). Cengage Learning.&lt;/p&gt;

&lt;p&gt;Lane, D. M. (2020). &lt;em&gt;Introduction to statistics online edition&lt;/em&gt;. Rice University. &lt;a href="https://onlinestatbook.com" rel="noopener noreferrer"&gt;https://onlinestatbook.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Urdan, T. C. (2017). &lt;em&gt;Statistics in plain English&lt;/em&gt; (4th ed.). Routledge.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>beginners</category>
      <category>science</category>
      <category>learning</category>
    </item>
    <item>
      <title>Similarities Between a Stored Procedure in SQL and a Function in Python</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Wed, 10 Sep 2025 09:03:48 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/similarities-between-a-stored-procedure-in-sql-and-a-function-in-python-11ko</link>
      <guid>https://dev.to/dilan_bosire/similarities-between-a-stored-procedure-in-sql-and-a-function-in-python-11ko</guid>
      <description>&lt;p&gt;Programming and database development share overlapping concepts, even though they operate in distinct environments. A SQL stored procedure and a Python function may appear unrelated, one is in a database, the other in an application, but both are reusable blocks of logic that perform tasks efficiently. Let’s look at their similarities.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Encapsulation of Logic
&lt;/h2&gt;

&lt;p&gt;Stored procedures and Python functions allow developers to define a set of instructions once and reuse them as needed, eliminating the need to rewrite code multiple times.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE PROCEDURE get_all_customers
AS
BEGIN
    SELECT * FROM Customers;
END;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Python Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def get_all_customers(customers):
    return customers

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Reusability
&lt;/h2&gt;

&lt;p&gt;Reusability is a key advantage in programming. Once created, SQL stored procedures and Python functions can be executed multiple times without needing to be redefined. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In SQL, use &lt;code&gt;EXEC ProcedureName&lt;/code&gt; to run a stored procedure. &lt;/li&gt;
&lt;li&gt;In Python, call a function with &lt;code&gt;function_name()&lt;/code&gt;. 
This saves time, reduces redundancy, and minimizes errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Parameters and Arguments
&lt;/h2&gt;

&lt;p&gt;Stored procedures and Python functions can accept input parameters to modify their behavior.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQL Example with Parameter:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are creating a stored procedure that takes a department name as a parameter and returns the employees in that department.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE PROCEDURE GetEmployeesByDepartment @DeptName NVARCHAR(50)
AS
BEGIN
    SELECT employee_id, name, department
    FROM Employees
    WHERE department = @DeptName;
END;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How to run it (passing an argument):&lt;br&gt;
&lt;code&gt;EXEC GetEmployeesByDepartment 'HR';&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python Example with Argument:&lt;br&gt;
In Python, we create a function that takes a department name as input and returns the employees from that department.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def get_employees_by_department(employees, dept_name):
    return [emp for emp in employees if emp["department"] == dept_name]

# Example data
employees = [
    {"id": 1, "name": "Alice", "department": "HR"},
    {"id": 2, "name": "Bob", "department": "IT"},
    {"id": 3, "name": "Charlie", "department": "HR"}
]

# Call function (passing argument)
print(get_employees_by_department(employees, "HR"))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{'id': 1, 'name': 'Alice', 'department': 'HR'},
 {'id': 3, 'name': 'Charlie', 'department': 'HR'}]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Return Results
&lt;/h2&gt;

&lt;p&gt;Both can return results.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stored procedures typically return result sets (such as query rows) or output parameters. &lt;/li&gt;
&lt;li&gt;Python functions return values with the return keyword.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;SQL: Returning employee rows.&lt;/li&gt;
&lt;li&gt;Python: Returning a filtered list of employees.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Improved Maintainability
&lt;/h2&gt;

&lt;p&gt;Both approaches enhance code maintainability. When logic changes, you only need to update the procedure or function once, rather than modifying multiple queries or code snippets throughout the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Support for Control Flow
&lt;/h2&gt;

&lt;p&gt;Python is more powerful, but stored procedures also support conditional logic (IF, CASE) and loops (WHILE). In contrast, Python functions use standard control flow structures (if, for, while).&lt;/p&gt;

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

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IF EXISTS (SELECT * FROM Employees WHERE Department = 'HR')
    PRINT 'HR Department found';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if any(emp["department"] == "HR" for emp in employees):
    print("HR Department found")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both check if at least one HR employee exists and then display a message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A stored procedure in SQL and a function in Python share several similarities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Both encapsulate logic into reusable blocks.&lt;/li&gt;
&lt;li&gt;Both accept parameters and return results.&lt;/li&gt;
&lt;li&gt;Both support control flow and enhance code maintainability.&lt;/li&gt;
&lt;li&gt;Both improve efficiency and consistency in programming.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key difference is that stored procedures run in a database engine, while Python functions run in an application. However, they both aim to organize logic effectively and efficiently for reuse.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding the Difference Between Subquery, CTE, and Stored Procedure</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Wed, 10 Sep 2025 08:21:15 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/understanding-the-difference-between-subquery-cte-and-stored-procedure-3mg5</link>
      <guid>https://dev.to/dilan_bosire/understanding-the-difference-between-subquery-cte-and-stored-procedure-3mg5</guid>
      <description>&lt;p&gt;In SQL and database programming, developers have several tools for organizing and optimizing queries. Among these are subqueries, Common Table Expressions (CTEs), and stored procedures. While they can sometimes be used to achieve similar goals, each serves a different purpose and has unique strengths. Let’s break down the differences.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Subquery
&lt;/h2&gt;

&lt;p&gt;A subquery is a query nested inside another query. It is often used to filter, aggregate, or transform data before the main query executes. Subqueries can appear in SELECT, FROM, WHERE, or HAVING clauses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;If you have a table called employees with name and salary columns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name, salary
FROM employees
WHERE salary &amp;gt; (SELECT AVG(salary) FROM employees);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the subquery calculates the average salary, and the outer query filters employees based on that value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Characteristics:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Runs each time it is called in the outer query.&lt;/li&gt;
&lt;li&gt;Can return a single value, multiple rows, or a table.&lt;/li&gt;
&lt;li&gt;Great for quick inline logic, but overuse can harm performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Common Table Expression (CTE)
&lt;/h2&gt;

&lt;p&gt;A Common Table Expression (CTE) is a temporary result set created with the WITH clause. It can be referenced within a query, enhances readability, and can be reused, helping to simplify complex queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;If you have a table called orders and customers with a common column called customer_id, and you want to rank customers based on their total quantities&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;with customer_rankings as (
    select orders.customer_id,sum(orders.quantity)as total_quantity,
        row_number() over (order by sum(orders.quantity)desc) as rankings
    from orders
    group by orders.customer_id)
select customers.first_name,customers.second_name,customer_rankings.total_quantity ,customer_rankings.rankings
from customers join customer_rankings on customers.customer_id= customer_rankings.customer_id
order by customer_rankings.total_quantity desc;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Characteristics:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Improves SQL readability and modularity.&lt;/li&gt;
&lt;li&gt;Supports recursion for hierarchical data, such as organizational charts.&lt;/li&gt;
&lt;li&gt;Exists only during query execution.&lt;/li&gt;
&lt;li&gt;Cannot be reused across sessions without rewriting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Stored Procedure
&lt;/h2&gt;

&lt;p&gt;A stored procedure is a set of SQL statements, possibly with procedural logic, saved in the database for repeated use. Unlike subqueries or CTEs, it operates independently and can be called multiple times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example:
&lt;/h2&gt;

&lt;p&gt;If you have a table called employees with employee_id, name, and department columns, and we want a stored procedure that shows all employees in the HR department.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE PROCEDURE GetHREmployees
AS
BEGIN
    SELECT employee_id, name, department
    FROM employees
    WHERE department = 'HR';
END;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Characteristics:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Stored and run on the database server.&lt;/li&gt;
&lt;li&gt;Supports parameters, control-of-flow logic, error handling, and transactions.&lt;/li&gt;
&lt;li&gt;Improves performance by minimizing network traffic—only the procedure call is sent.&lt;/li&gt;
&lt;li&gt;Enhances security by controlling access with permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use subqueries for inline filtering or calculations in another query.&lt;/li&gt;
&lt;li&gt;Use Common Table Expressions (CTEs) for better readability, recursive queries, and simplifying complex logic.&lt;/li&gt;
&lt;li&gt;Use stored procedures for reusable, parameterized, and secure database logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools give SQL developers the flexibility to manage tasks from simple lookups to complex data processing.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Excel’s Strengths and Weaknesses in Predictive Analysis and Its Role in Data-Driven Business Decisions</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Sun, 10 Aug 2025 10:54:36 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/excels-strengths-and-weaknesses-in-predictive-analysis-and-its-role-in-data-driven-business-2189</link>
      <guid>https://dev.to/dilan_bosire/excels-strengths-and-weaknesses-in-predictive-analysis-and-its-role-in-data-driven-business-2189</guid>
      <description>&lt;p&gt;When you think of business tools, Microsoft Excel is probably one of the first that comes to mind. For decades, it has been the go-to tool for organizing numbers, crunching data, and making sense of information. But as businesses become more data-driven and predictive analysis grows in importance, it’s worth asking: How well does Excel hold up? Let’s take a closer look at where Excel shines, where it falls short, and how it fits into today’s decision-making landscape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Excel’s Strengths in Predictive Analysis
&lt;/h2&gt;

&lt;p&gt;-Widely Accessible &amp;amp; Familiar: Most professionals know Excel, making it easy to adopt for predictive tasks.&lt;/p&gt;

&lt;p&gt;-Built-in Statistical Tools: Offers basic predictive modeling (e.g., regression, forecasting) without coding.&lt;/p&gt;

&lt;p&gt;-What-If &amp;amp; Scenario Analysis: Tools like Goal Seek and Scenario Manager help explore different outcomes.&lt;/p&gt;

&lt;p&gt;-Data Visualization: Strong charting and dashboard features for communicating trends and forecasts.&lt;/p&gt;

&lt;p&gt;-Enhanced Data Modeling: Power Query and Power Pivot allow for more complex data handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Excel’s Weaknesses in Predictive Analysis
&lt;/h2&gt;

&lt;p&gt;-Limited Advanced Analytics: Lacks support for advanced machine learning techniques.&lt;/p&gt;

&lt;p&gt;-Scalability Issues: Struggles with huge datasets; performance drops or crashes.&lt;/p&gt;

&lt;p&gt;-Error-Prone: Manual data entry and formulas can lead to mistakes.&lt;/p&gt;

&lt;p&gt;-Collaboration Challenges: Weak version control and simultaneous editing issues.&lt;/p&gt;

&lt;p&gt;-Limited Automation: Less suited for automated, repeatable workflows compared to coding languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Excel’s Role in Data-Driven Business Decisions
&lt;/h2&gt;

&lt;p&gt;-Quick Prototyping: Great for rapidly testing ideas and building initial models.&lt;/p&gt;

&lt;p&gt;-Cost-Effective for SMBs: Meets basic analysis needs for small and medium businesses.&lt;/p&gt;

&lt;p&gt;-Bridges Business &amp;amp; Data Teams: Makes data accessible and understandable for both technical and non-technical users.&lt;/p&gt;

&lt;p&gt;-Complements Other Tools: Often used alongside advanced analytics platforms for visualization and reporting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Excel is a valuable and accessible tool for early-stage analysis, prototyping, and reporting; however, it has limitations when it comes to handling complex models and large datasets. It works best as a complementary tool rather than a replacement for advanced analytics platforms.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Install and Set Up PostgreSQL on a Linux Server</title>
      <dc:creator>Dilan Bosire</dc:creator>
      <pubDate>Fri, 01 Aug 2025 11:48:40 +0000</pubDate>
      <link>https://dev.to/dilan_bosire/how-to-install-and-set-up-postgresql-on-a-linux-server-17m8</link>
      <guid>https://dev.to/dilan_bosire/how-to-install-and-set-up-postgresql-on-a-linux-server-17m8</guid>
      <description>&lt;p&gt;In this article, I will show you how to install and set up PostgreSQL on a Linux server.&lt;/p&gt;

&lt;p&gt;Make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A Linux server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Internet access to install packages&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Log into your Ubuntu server
&lt;/h2&gt;

&lt;p&gt;you can use the command,&lt;br&gt;
&lt;code&gt;ssh username@server_ip_&lt;/code&gt;&lt;br&gt;
Then you'll be prompted to enter your password.&lt;br&gt;
If the password entered is correct then you are in the server.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Install PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Search &lt;a href="https://www.postgresql.org/download/" rel="noopener noreferrer"&gt;https://www.postgresql.org/download/&lt;/a&gt; to see the download versions of available.&lt;br&gt;
Select the one for linux and ubuntu.&lt;br&gt;
You'll get the image below.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxjnp6njibcmso53qio8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxjnp6njibcmso53qio8.png" alt=" " width="800" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy and paste the lines of code as below into your ubuntu server, and you'll have downloaded posgresql.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install curl ca-certificates
sudo install -d /usr/share/postgresql-common/pgdg
sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
. /etc/os-release
sudo sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main' &amp;gt; /etc/apt/sources.list.d/pgdg.list"
sudo apt update
sudo apt -y install postgresql-16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Connect to PostgreSQL
&lt;/h2&gt;

&lt;p&gt;PostgreSQL creates a system user named postgres. You can switch to this user to open the PostgreSQL prompt:&lt;br&gt;
We use,&lt;br&gt;
&lt;code&gt;sudo -i -u postgres&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then type, psql.&lt;br&gt;
You should now be at the PostgreSQL prompt:&lt;/p&gt;

&lt;p&gt;postgres=#&lt;/p&gt;

&lt;p&gt;To exit the prompt, type:&lt;br&gt;
&lt;code&gt;\q&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then return to your regular user:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;exit&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Create a New Database and User
&lt;/h2&gt;

&lt;p&gt;If you want to create a new PostgreSQL user and database:&lt;/p&gt;

&lt;p&gt;Switch to the postgres user:&lt;br&gt;
&lt;code&gt;sudo -i -u postgres&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a new user:&lt;br&gt;
&lt;code&gt;createuser --user_name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will prompt you for a username and whether the new user should be a superuser.&lt;/p&gt;

&lt;p&gt;Create a new database:&lt;br&gt;
&lt;code&gt;createdb database_name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you can select the database you want to use and add tables and values to it, to select use&lt;br&gt;
&lt;code&gt;\c database_name&lt;/code&gt;&lt;br&gt;
Then from there you can add your tables and values.&lt;/p&gt;

&lt;p&gt;Check posgres status:&lt;br&gt;
&lt;code&gt;sudo systemctl status posgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To stop posgresql:&lt;br&gt;
&lt;code&gt;sudo systemctl stop posgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To start posgresql:&lt;br&gt;
&lt;code&gt;sudo systemctl start posgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To restart posgresql:&lt;br&gt;
&lt;code&gt;sudo systemctl restart posgresql&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
