<?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: Joseph Ngigi</title>
    <description>The latest articles on DEV Community by Joseph Ngigi (@joe_jngigi).</description>
    <link>https://dev.to/joe_jngigi</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%2F889942%2Ff733c787-7be9-4463-8848-dd883aa11418.jpeg</url>
      <title>DEV Community: Joseph Ngigi</title>
      <link>https://dev.to/joe_jngigi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joe_jngigi"/>
    <language>en</language>
    <item>
      <title>Demystifying React: How does React actually render JSX?</title>
      <dc:creator>Joseph Ngigi</dc:creator>
      <pubDate>Thu, 14 Mar 2024 22:38:53 +0000</pubDate>
      <link>https://dev.to/joe_jngigi/demystifying-react-how-does-react-actually-render-jsx-3099</link>
      <guid>https://dev.to/joe_jngigi/demystifying-react-how-does-react-actually-render-jsx-3099</guid>
      <description>&lt;p&gt;Checkout this project &lt;a href="https://github.com/joe-jngigi/react_html"&gt;React First Project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, check this &lt;a href="https://react.dev/learn/installation#try-react:~:text=Try%20React%20locally,in%20your%20browser!"&gt;Try React locally - Add React to a Website &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When explaining react, we say that it is a set of JS functions that can allow you to create front end reusable UIs and components. The &lt;strong&gt;React&lt;/strong&gt; library provides all the set functions that can be used to manipulate how the UI behaves. The React Library can put views to the DOM, mobile apps and the desktop apps. The &lt;strong&gt;&lt;code&gt;ReactDOM&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;ReactNative&lt;/code&gt;&lt;/strong&gt; Are used to render the UIs on a screen like the browsers and mobile devices.&lt;/p&gt;

&lt;p&gt;With the code below, we can use it to access the HTML container, which is basically marked with &lt;code&gt;Id&lt;/code&gt;, in this case we give the ID the name &lt;code&gt;root&lt;/code&gt;. So now using the &lt;code&gt;reactDOM&lt;/code&gt; function from react, we can now render the UI libraries. To enable all these to work, we have some scripts in the HTML file. These scripts enable you to write React code directly in your HTML page using the development versions of React and React DOM libraries. Normally, we need a JS environment like &lt;code&gt;node.js&lt;/code&gt;, but we can run bare React.js without node by adding the scripts below, which are available in the React.js Documentation referenced above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- tags am talking about  in the **head**--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/react@18/umd/react.development.js"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/react-dom@18/umd/react-dom.development.js"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- In the **body** --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"newElement"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JS File&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reactContentRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, This is REACTHTML&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reactContentRoot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;//React is a library that allows one to cleate react elements&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;item1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myElement&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;elementNew&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;React&lt;/code&gt; is a JavaScript library for building user interfaces. &lt;code&gt;ReactDOM&lt;/code&gt; is the library that interacts with the DOM. React focuses on creating UI components and managing application logic, while &lt;code&gt;ReactDOM&lt;/code&gt; handles rendering those components to the actual DOM. In simple terms, developers use React to define elements, manage state, and implement lifecycle methods, while &lt;code&gt;ReactDOM&lt;/code&gt; is specifically used for mounting components to the DOM.&lt;/p&gt;

&lt;p&gt;To run the &lt;code&gt;react&lt;/code&gt; code, we need a transpiler that can compile react code. We use the babel. A transpiler is a tool that converts code written in one programming language into another programming language while maintaining a similar level of abstraction. Since we use &lt;code&gt;JSX&lt;/code&gt;, we can convert JSX, which is just like HTML. You should note that JSX is not HTML, they just work the like 90% of the time. Babel is a tool that allows developers to write code using the latest version of JavaScript, which may not be supported by all browsers. It is a JavaScript compiler that transforms newer ECMAScript features into older versions of JavaScript that are widely supported across different browsers.&lt;/p&gt;

&lt;p&gt;So a list element will be transformed like this. So, in the background, React Uses the babel transpiler to compile the JSX code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;
&lt;span class="c1"&gt;// jsx&lt;/span&gt;
 &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Item 1&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Item 1&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Item 1&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="c1"&gt;// Java Script&lt;/span&gt;
&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;List item one&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;List item two&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  JSX Support Scripts
&lt;/h2&gt;

&lt;p&gt;With the following script, we can use it to compile our JS file by adding it to the header of our HTML file. After which we can now compile the JSX files in &lt;code&gt;react-html&lt;/code&gt;. You can check out &lt;a href="https://babeljs.io/docs/babel-standalone#when-not-to-use-babelstandalone"&gt;&lt;code&gt;@babel/standalone&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
So this will compile the JSX into JavaScript. When we add this script, we can use the &lt;strong&gt;live server&lt;/strong&gt; on &lt;strong&gt;Visual Studio Code&lt;/strong&gt; or just right-click on the HTML file and open with default browser. It opens your file on a port.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/@babel/standalone/babel.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- We then label our script tag with the type as shown --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/babel"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./index.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;So now we can render the JSX element in the place of the code below. This code is how we can create elements in React JS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arraylist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ul&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="p"&gt;,[&lt;/span&gt;
&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This is not a JSX Element&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;List item one&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;List item two&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arraylist&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;listItems&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an example of the JSX code; a simplified version of the above code. So before this JSX code is run in the browser, babel will first interpret it into JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myJSX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;This is a JSX file&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;List item one&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;List item two&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myNewItem&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myJSX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;jsxElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now when it comes to writing a React Component, we can now return the JSX inside a function, and now we can return the function as a JSX argument in the &lt;code&gt;reactDOM.render&lt;/code&gt; like shown below. Note the similarities with the above code. You can just Say &lt;strong&gt;&lt;code&gt;&amp;lt;App /&amp;gt;&lt;/code&gt;&lt;/strong&gt; or the function &lt;strong&gt;&lt;code&gt;App()&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Joseph N&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;big&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;RETURNING JSX&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;big&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;This is an arrow function. They are used to return JSX in react&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;my name is &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;userName&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt;&lt;span class="p"&gt;/&amp;gt;,&lt;/span&gt; &lt;span class="nx"&gt;returnElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Essential SQL Commands for Data Science</title>
      <dc:creator>Joseph Ngigi</dc:creator>
      <pubDate>Sat, 25 Mar 2023 20:16:55 +0000</pubDate>
      <link>https://dev.to/joe_jngigi/essential-sql-commands-for-data-science-l77</link>
      <guid>https://dev.to/joe_jngigi/essential-sql-commands-for-data-science-l77</guid>
      <description>&lt;p&gt;As a data scientist, having a strong understanding of SQL commands is important for working with large datasets and performing complex analyses. SQL provides a standardized way to interact with databases, making it a universal language for data and database management.&lt;/p&gt;

&lt;p&gt;In this article, we will explore some most important SQL commands for data scientists. From querying data to manipulating tables, we will cover the key commands that every data scientist should know. We will also discuss best practices for using SQL, including how to optimize queries and avoid common errors.&lt;/p&gt;

&lt;p&gt;I have some SQL script you can use for your queries &lt;a href="//link.com"&gt;here&lt;/a&gt;. These will create a table for your database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Retrieval
&lt;/h2&gt;




&lt;h3&gt;
  
  
  SELECT * FROM
&lt;/h3&gt;

&lt;p&gt;This is used to query data; in simple terms to list or get the data in a given Table. One can manupulate it to get a specific field in a record like shown&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0c7o6rpfmir76ji8luu1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0c7o6rpfmir76ji8luu1.png" alt="SelectQuery" width="687" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data Retrieval with Simple Conditions &lt;em&gt;Where&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="nv"&gt;`agent`&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;zip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;37119&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwjlmm7n3x0r718hh500.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwjlmm7n3x0r718hh500.png" alt="SelectQuery" width="650" height="58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Distinct
&lt;/h3&gt;

&lt;p&gt;There are certain times where someone wants to get unique data, eliminating the data that is duplicate. SQL is used to eliminate duplicates from the result set of a SELECT statement. For example one may want to get a list of departments where they are duplicate in a table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;SKILL1&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employeeskills&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubs9psnlxrxu5ots5kk1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubs9psnlxrxu5ots5kk1.png" alt="SelectQuery" width="359" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ORDER BY
&lt;/h3&gt;

&lt;p&gt;This is quite a useful when someone us wants to retrieve Data while it is sorted. ORDER BY is used to sort the result set of a SELECT statement in ascending or descending order based on one or more columns. One can specify one or more columns to sort the result set by. The sorting is done in ascending order by default, but one can also specify using the the &lt;code&gt;DESC&lt;/code&gt; to set the result in descending order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEENAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;TITLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;SKILL2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;HIREDATE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employeeskills&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;HIREDATE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapt6lrmlnyc51vd3ae26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fapt6lrmlnyc51vd3ae26.png" alt="orderby" width="712" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  LIMIT
&lt;/h3&gt;

&lt;p&gt;Sometimes we are only interested in a limited number of records. We may want to retrive like just 7 records from a table. When you use the LIMIT keyword in a &lt;code&gt;SELECT&lt;/code&gt; query, you can specify the maximum number of rows to return from the result set.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;skill&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukit1h1nv5frwcx2ktir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukit1h1nv5frwcx2ktir.png" alt="limit" width="685" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Aggregations
&lt;/h2&gt;




&lt;p&gt;These are functions that operate on a set of values and return a single value. They are used to get a summary of the dataset to gain insights from the underlying data set. Aggregations are often used with the GROUP BY clause. The GROUP BY clause allows you to group data based on one or more columns, and then apply an aggregation function to each group.&lt;/p&gt;

&lt;h3&gt;
  
  
  GROUP BY &amp;amp; COUNT()
&lt;/h3&gt;

&lt;p&gt;For the group and count, I chose to get the counts of employees, since it has repeated titles with different employees(I took the last name which will display only for one employee). I have grouped the count with the employee_id, so it returned the count of employees grouped by title and displayed the employee titles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE_LNAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_TITLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;EMPLOYEE_TITLE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6clrzid2r189jzljpn7r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6clrzid2r189jzljpn7r.png" alt="SelectQuery" width="376" height="184"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;C_NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4ynqfvfvjpy3lrgb7r5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4ynqfvfvjpy3lrgb7r5.png" alt="Count" width="150" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's important to note that when using the COUNT() function with GROUP BY, you should use the "*" wildcard character instead of a specific column name. This ensures that you are counting the number of rows in each group, rather than the number of non-null values in a specific column.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8mckmugylvdym7snghn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs8mckmugylvdym7snghn.png" alt="CountAll" width="111" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SUM()
&lt;/h3&gt;

&lt;p&gt;SUM() is an aggregation function in SQL that is used to calculate the sum of all the values in a specific column.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx9w34drmez28k2q0wxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx9w34drmez28k2q0wxv.png" alt="sumamt" width="278" height="56"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also use the SUM() function in conjunction with other SQL functions such as GROUP BY, ORDER BY, and HAVING, to perform more complex queries and analyses.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2m2y019qxgip4ix42xq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2m2y019qxgip4ix42xq.png" alt="sumgrp" width="280" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AVG()
&lt;/h3&gt;

&lt;p&gt;AVG() is an aggregation function in SQL that calculates the average value of a specific column.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbi1jttpnshahndhl1dp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbi1jttpnshahndhl1dp5.png" alt="avg" width="224" height="43"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyjy92375zdsekl5j1a6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyjy92375zdsekl5j1a6.png" alt="avggrp" width="264" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Having
&lt;/h4&gt;

&lt;p&gt;HAVING is a clause in SQL that is used to filter the results of a GROUP BY query based on a given condition.  HAVING clause is similar to the WHERE clause, but it is used with GROUP BY queries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;AVG_AMT&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt; &lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="n"&gt;AVG_AMT&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcku0b936metd71p4gv39.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcku0b936metd71p4gv39.png" alt="avgamt" width="278" height="54"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;WHERE&lt;/em&gt; is used to filter data before it is grouped and aggregated. &lt;em&gt;HAVING&lt;/em&gt; is used to filter data after it has been grouped and aggregated.&lt;/li&gt;
&lt;li&gt;Alias is a temporary name given to a table or column in a query result set.It can be used to give a more descriptive name to a column or table oe differentiate columns with same name from different tables&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  MIN()
&lt;/h3&gt;

&lt;p&gt;Sometimes someone may want to get the least or the minimum value of a specific column. We can also use it with other SQL functions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;MIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbet5ig30tvzsliy5fmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbet5ig30tvzsliy5fmp.png" alt="minamt" width="271" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This query will group the amount by name and then find the minimum price for each name using the MIN() function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;MIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;A_NAME&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F498dw7zp9xcghlfr4s2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F498dw7zp9xcghlfr4s2w.png" alt="mingrp" width="285" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Joins
&lt;/h2&gt;




&lt;p&gt;In some cases we may want to do some more complex data manipulation and analysis with data from different tables. In SQL, a join is a method for combining data from two or more tables into a single result set. A join can be performed by joining tables based on a common key.&lt;/p&gt;

&lt;p&gt;You can view this example from &lt;a href="https://www.datacamp.com/tutorial/tutorial-sql-commands-for-data-scientists#:~:text=SQL%20course.-,Joins,returned%20values%20ordered%20by%20the%20average%20rating%2C%20with%20the%20highest%20first.,-SELECT%20category.name"&gt;Datacamp&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;column2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;table1&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;table2&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;table1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;column&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;table2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;These are the different types of joins&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;INNER JOIN returns only the matching rows between two tables, based on a specified join condition. Non-matching rows are not returned.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LEFT JOIN returns all the rows from the left table and the matching rows from the right table. If there is no match in the right table, NULL values will be returned for the corresponding columns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RIGHT JOIN returns all the rows from the right table and the matching rows from the left table. If there is no match in the left table, NULL values will be returned for the corresponding columns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FULL OUTER JOIN returns all the rows from both tables being joined, along with any matching rows. If there is no match in either table, NULL values will be returned for the corresponding columns.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Inner join is the most common, but if you want to use any of them joins, they all have the same syntax you will just need to replace it with the join based on your query requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  INNER JOIN
&lt;/h3&gt;

&lt;p&gt;INNER JOIN is a join where it returns only the rows where there is a match between the specified columns (can be a common key between the tables) in both tables being joined.INNER JOIN is a type of join in SQL that returns only the rows where there is a match between the specified columns in both tables being joined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_LNAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_FNAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;certified&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CERTIFIED_DATE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt; &lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;certified&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;certified&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dlv6ssf0lxvuzt0ktdq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dlv6ssf0lxvuzt0ktdq.png" alt="innerjoin" width="625" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also get data from multiple tables&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_LNAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_FNAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;employeeskills&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SKILL2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;certified&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CERTIFIED_DATE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt; &lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;certified&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;certified&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt; &lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;employeeskills&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;employeeskills&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEENUMBER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EMPLOYEE_ID&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;employeeskills&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4w9x859d0a6d9efr14k5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4w9x859d0a6d9efr14k5.png" alt="innerjoinmulti" width="603" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Changing Data Types
&lt;/h2&gt;




&lt;h3&gt;
  
  
  ALTER TABLE COLUMN DATATYPE
&lt;/h3&gt;

&lt;p&gt;One can change the data type of a column using the ALTER TABLE statement with the MODIFY or ALTER COLUMN clause, depending on the database system you are using. Changing the datatype of a column happens on rare occassions, as because it can result to conversion errors&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;COLUMN&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CAST()
&lt;/h3&gt;

&lt;p&gt;CAST() is another SQL function that allows one to convert the data type of a column or an expression into a different data type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;CAST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You should note that although both the cast and alter table column have used to change the data of a given column, &lt;code&gt;alter table column&lt;/code&gt; is used to modify the data type of a column permanently while &lt;code&gt;cast&lt;/code&gt; is used to temporarily convert data for a specific query or calculation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Round()
&lt;/h3&gt;

&lt;p&gt;This SQL function that allows one to round a numeric value to a specified precision. It can be used with both integer and decimal data types. This sql statement is used to round the revenue column in the sales table to two decimal places.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sales&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Complex Conditions
&lt;/h2&gt;




&lt;p&gt;By combining different functions and clauses we have looked at, it is possible to perform complex queries within the database. We can use complex conditions in your queries by combining multiple conditions using logical operators such as AND, OR, and NOT. There ither situations where there is need to implement more logical operations to perform the requirements of our problems. This can be done in a bit more advanced SQL, like PLSQL. Some of the sql conditions we can use include&lt;/p&gt;

&lt;h3&gt;
  
  
  Case Statement
&lt;/h3&gt;

&lt;p&gt;A case statement is a powerful way to perform conditional logic in your queries. It allows one to test more conditions. This is a basic syntax for the case statement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;CASE&lt;/span&gt;
           &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;condition1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="n"&gt;result1&lt;/span&gt;
           &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;condition2&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="n"&gt;result2&lt;/span&gt;
           &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="n"&gt;default_result&lt;/span&gt;
       &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;result_column&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="s1"&gt;'2022-01-01'&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="n"&gt;order_total&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_sales_2022&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="s1"&gt;'2022-01-01'&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="n"&gt;order_total&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_sales_before_2022&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;In a practical example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;C_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;C_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;A_PHONE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="k"&gt;CASE&lt;/span&gt;
     &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'Junior Engineer'&lt;/span&gt;
        &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'Senior Enginner'&lt;/span&gt;
        &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;AMT&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'CTO'&lt;/span&gt;
        &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="s1"&gt;'Project Manager'&lt;/span&gt;
 &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;CUSTOMER_POSITION&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1sbxp7xs5j3jzee58u2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1sbxp7xs5j3jzee58u2.png" alt="case" width="466" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Subqueries
&lt;/h3&gt;

&lt;p&gt;A subquery is a query that is nested inside another query. The results of the subquery are used by the outer query to perform further operations or filtering. Subqueries can be used for filtering, joining, or aggregating data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;product_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit_price&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;category_id&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;categories&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;category_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Beverages'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



</description>
      <category>database</category>
      <category>datascience</category>
      <category>sql</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Exploratory Data Analysis(EDA)</title>
      <dc:creator>Joseph Ngigi</dc:creator>
      <pubDate>Mon, 27 Feb 2023 21:05:23 +0000</pubDate>
      <link>https://dev.to/joe_jngigi/-exploratory-data-analysiseda-1090</link>
      <guid>https://dev.to/joe_jngigi/-exploratory-data-analysiseda-1090</guid>
      <description>&lt;h2&gt;
  
  
  Introduction on EDA
&lt;/h2&gt;

&lt;p&gt;EDA is an important stepping stone before one begins on the exploration of &lt;strong&gt;Data Analysis&lt;/strong&gt;. EDA is done once there is a defined problem in which can be typically a normal business problem, or a company is looking forward to look for a business opportunity. So, before conducting an analysis, there is a verification of whether the data is appropriate. A quality analysis of data depends on how well one understands the data they are dealing with. EDA is very helpful as it helps one discover and resolve Data Quality issues for example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Duplicates&lt;/li&gt;
&lt;li&gt;Unwanted datapoints&lt;/li&gt;
&lt;li&gt;Missing Data&lt;/li&gt;
&lt;li&gt;Incorrect Values&lt;/li&gt;
&lt;li&gt;Detect Outliers and Anomalies&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;EDA generates data summaries like Mean, median, sum, count and other statistical information. The main purpose of Exploratory data analysis is to Analyze and summarize a dataset.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;strong&gt;Dataset&lt;/strong&gt; is a collection of related data, typically organized in a structured format which can be be accessed individually or in combination or managed as a whole entity.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is EDA?
&lt;/h2&gt;

&lt;p&gt;It is an approach to analyzing data that focuses on analyzation and investigating data sets and summarize their main characteristics, often employing data visualization methods. EDA is aimed to discover the underlying structure and nature of the data, rather than simply confirming preconceived hypotheses. It uses statistical and graphical techniques, such as histograms so as to visualize the data.&lt;/p&gt;

&lt;p&gt;After completing the process of EDA and extracting insights, the characteristics of the data can be utilized for more advanced data analysis or modeling tasks, such as machine learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Data Analysis Process
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Defining an Objective&lt;/strong&gt;&lt;br&gt;
In data analytics, the first step is defining &lt;strong&gt;Problem Statement&lt;/strong&gt;. This is the process of coming up with a hypothesis and figuring out how to test it. One can start by defining a business problem(eg. Why are we losing customers as Xiaomi). As a data analyst, you will look into depth by trying to find the factors that are negatively impacting the customer experience. The analysis is not limited to only this, of course there are other factors. Defining the objective is mostly about the soft skills, lateral thinking and the business model knowledge. Business Metrics and Key Performance Indicators(KPIs) can help track problem points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Collection&lt;/strong&gt;&lt;br&gt;
Can be Qualitative on Quantitative Data. The data can be categorized into:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First-Party Data: This is the data that is directly collected from customers through various channels such as website, mobile apps, social media accounts, customer relationship management (CRM) software. This data is clear and structured.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second-Party Data: Second-party data is data that a company acquires directly from another company or organization, rather than collecting it themselves. A car manufacturer might acquire second-party data from a car dealership that has customer data from its own sales and service interactions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Third-Party Data: Tt is data that is collected by one company and then sold or licensed to other companies for their own use. It can include demographic information, browsing behavior, purchase history, and more.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Data Collection tool&lt;/em&gt;&lt;br&gt;
There are various tools that can be used for data collection. One important tool that can be used for this is a Data Management Platform(DMP). It allows one to identify and aggregate data from numerous sources before you can manipulate it. Examples include Salesforce, SAS, Xplenty(Data Integration Platform). Some open source platforms can be Pymcore and Dswarm&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cleaning The Data&lt;/strong&gt;&lt;br&gt;
This is an important step in [EDA] Exploratory Data Analysis so as to get it ready for Analysis and make sure that you are working with high quality data. &lt;em&gt;Data cleaning&lt;/em&gt; is the process of identifying and correcting errors, inconsistencies, and inaccuracies in a dataset. Key cleaning data tasks include:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Removing major Error, duplicates and Outliers&lt;/li&gt;
&lt;li&gt;Removing unwanted data points&lt;/li&gt;
&lt;li&gt;Bringing Structure to the data eg. Fixing typos ot layout issues&lt;/li&gt;
&lt;li&gt;Filling or removing unwanted&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are various tools that can be used for data cleaning. &lt;a href="https://openrefine.org/"&gt;OpenRefine&lt;/a&gt; is one of the open source tools that one can use for data cleaning. This might not be suitable for large datasets. Python library &lt;a href="https://pandas.pydata.org/"&gt;Pandas&lt;/a&gt; and other &lt;a href="https://www.r-project.org/"&gt;R&lt;/a&gt; libraries can be a much better suit for cleaning the large datasets. There are much more &lt;a href="https://www.linkedin.com/pulse/top-11-data-cleaning-tools-scientists-2022-harshit-goyal/?trk=pulse-article_more-articles_related-content-card"&gt;DataCleaningTools&lt;/a&gt; tools. Check them out&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Analyzation&lt;/strong&gt;&lt;br&gt;
Data analyis typically depends on your objective from the data. Some techniques of Data analysis include; Univariate or Bivariate analysis, Data Mining analysis, Time series analysi and Machine Learning. Categorically, all data analyzation can fit into:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Descriptive Analysis which uses current and historical data to identify relationships and trends&lt;/li&gt;
&lt;li&gt;Diagnostic Analysis is an advanced analytics that examines data and diagnosing problems or issues to understand why it happened&lt;/li&gt;
&lt;li&gt;Predictive Analysis is the analytics that makes predictions about future outcomes using statistical and machine learning techniques to analyze historical data&lt;/li&gt;
&lt;li&gt;Prescriptive Analysis is the analysis where one analyzes data and content to recommend the optimal course of action to achieve the objective&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Visualization of The Data&lt;/strong&gt;&lt;br&gt;
This involves the interpretation of the outcomes and present them. The results are expected to be unambiguous. Data visualization is the practice of presenting information or data in a visual form, such as charts, graphs, maps, and other interactive visual representations. There are many tools that can used for data visualization. They include; Data wrapper, Tableau, Google Charts, Power BI, etc. These don't require one to have coding skills. Plotty, Seaborn and Matplotlib are some python data visualization tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of exploratory data analysis
&lt;/h2&gt;

&lt;p&gt;There are four primary types of EDA&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Univariate analysis&lt;/strong&gt; This EDA is Non-graphical. It is the simplest and it deals with analyzing a single variable mainly to identify patterns, trends, and outliers in the data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Univariate graphical&lt;/strong&gt; This method provide graphical presentation, providing Histograms, a bar plot, Box plots(minimum, first quartile, median, third quartile, and maximum.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multivariate nongraphical&lt;/strong&gt; This involves analyzing multiple variables simultaneously to identify patterns, trends, and correlations in the data. Usually, it displays the correlation between two or more data variables by using cross-tabulation or statistical techniques.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multivariate graphical&lt;/strong&gt; This one uses uses graphics to display relationships. The most used is a grouped bar plot or bar chart.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Scatterplot, Multivariate chart, Bubble chart, Run chart and Heatmap&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  EDA Tools
&lt;/h2&gt;

&lt;p&gt;These are various common tools that can b e used for EDA. &lt;code&gt;Python&lt;/code&gt; and &lt;code&gt;R&lt;/code&gt; are the most common used for data Analysis and Visualization&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pandas&lt;/strong&gt; is a Python library that can be used for data manipulation and analysis and it provides tools that are suitable to manipulate large datasets. Pandas is built on top of &lt;strong&gt;NumPy&lt;/strong&gt;, another popular Python library for scientific computing. Pandas can be used for Data cleaning and preparation, Data exploration, Data analysis and Time series analysis&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NumPy&lt;/strong&gt; This is a python library that used in scientific computing, providing tools to work with Array and Matrices.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Matplotlib&lt;/strong&gt;A Python library for data visualization, including scatter plots, line graphs, and histograms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Seaborn&lt;/strong&gt; A Python library for statistical data visualization, including heatmaps, cluster maps, and box plots.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Other common tools include; Tableau, Power BI, RStudio, SAS and IBM SPSS&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

&lt;p&gt;EDA tools provide a range of statistical functions and techniques that can be used to gain insights and make data-driven decisions. Some of these functions include Data visualization, Correlation analysis, egression analysis, Clustering and dimension reduction techniques and clustering analysis&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>dataanalysis</category>
    </item>
    <item>
      <title>Linking Github repositories</title>
      <dc:creator>Joseph Ngigi</dc:creator>
      <pubDate>Sun, 26 Feb 2023 19:39:37 +0000</pubDate>
      <link>https://dev.to/joe_jngigi/linking-github-repositories-3378</link>
      <guid>https://dev.to/joe_jngigi/linking-github-repositories-3378</guid>
      <description>&lt;h2&gt;
  
  
  Git Submodules
&lt;/h2&gt;

&lt;p&gt;Someone may come across a situation where they might want to link or associate two Github repositories. You may want to do  this, probably for referencing on something. You need to have your two repositories ready in Github, In this tutorial, I will not go to much details on handling advanced git commands.&lt;br&gt;
For both, one has the required submodule with you will put in the other that does not have it.&lt;br&gt;
This is a picture of how the targeted repos&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4znvdp1p30zk1gd75nhh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4znvdp1p30zk1gd75nhh.png" alt="@joe-jngigi" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Navigate to the local git-repository that you want to add the git-submodule: In this case, I added &lt;code&gt;Python_Codebase&lt;/code&gt; as a submodule to to the &lt;code&gt;lux_data_scince&lt;/code&gt; repo. If you type &lt;code&gt;git submodule&lt;/code&gt;, it will show you a few commands.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To link the repos, use &lt;code&gt;git submodule add &amp;lt;add_your_target_url&amp;gt;&lt;/code&gt;. This will clone your targeted URL into the new repo. After wards you can now push your changes to the main repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git clone &amp;lt;add_your_url&amp;gt; --recurssive&lt;/code&gt; This will clone the Github repo &lt;em&gt;&lt;code&gt;lux_data_scince&lt;/code&gt;&lt;/em&gt; that contains the submodules. If not the gitsubmodule you added are left behind&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;.gitmodules&lt;/strong&gt; is a file that shows how it links to the repo, and you can use &lt;code&gt;tree&lt;/code&gt; to view your repo tree&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Alternatively, you can setup &lt;code&gt;git config submodule.recursive true&lt;/code&gt; This is if the incase of a pull/clone and you want to get all your modules&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can used &lt;code&gt;git submodule update --init&lt;/code&gt;  to download/update the repo submodules&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The branches will not have any problems, and if you make any changes to the targeted repository, it will not affected your main repository.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

</description>
      <category>github</category>
      <category>git</category>
    </item>
    <item>
      <title>Stuck on updating start menu link</title>
      <dc:creator>Joseph Ngigi</dc:creator>
      <pubDate>Wed, 22 Feb 2023 08:54:52 +0000</pubDate>
      <link>https://dev.to/joe_jngigi/stuck-on-updating-start-menu-link-2bk3</link>
      <guid>https://dev.to/joe_jngigi/stuck-on-updating-start-menu-link-2bk3</guid>
      <description>&lt;p&gt;I recently came across  problem while installing MYSQL on my Windows(I am on windows 11), where I got stuck in the step, it could not resolve updating start menu link. I found this post on &lt;a href="https://stackoverflow.com/questions/43986780/configuration-of-mysql-server-is-taking-longer-than-expected"&gt;Stackoverflow&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
If you have troubles in while on Windows 11, here is a guide to solve the problem&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to the control panel, and find the &lt;strong&gt;Windows Tools&lt;/strong&gt;. IF you want to easily find the make sure to sort using small icons&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6wsw8pvq47rrm65if76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6wsw8pvq47rrm65if76.png" alt="Windows tools" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On windows tools, scroll and find the &lt;strong&gt;Services&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol3e1s4me3ctw49zuevd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol3e1s4me3ctw49zuevd.png" alt="Services" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once in services, Scroll through and find &lt;strong&gt;MYSQL&lt;/strong&gt; services for my case I am using the latest version so it is MYSQL80. Right click on it and go to &lt;strong&gt;Properties&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0j772xvj584p8dv24ct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0j772xvj584p8dv24ct.png" alt="MySQL service" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On properties, click on &lt;strong&gt;Log On&lt;/strong&gt; tab, choose &lt;strong&gt;Local System Account&lt;/strong&gt; and click on apply.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr0zov5ahykyydt9qebs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyr0zov5ahykyydt9qebs.png" alt="Log On" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go run the MYSQL installer and MySQL from the start and re-configure the MYSQL server. This worked on my side.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxohlndwxu2ahbhtutr52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxohlndwxu2ahbhtutr52.png" alt="My SQL installer" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remember to go back to step 4 and choose the default &lt;strong&gt;This Account&lt;/strong&gt;. You can now enjoy MYSQL from the Workbench or the MySQL Shell&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Learning SQL and an Introduction on Python for Data Science</title>
      <dc:creator>Joseph Ngigi</dc:creator>
      <pubDate>Sat, 18 Feb 2023 20:46:32 +0000</pubDate>
      <link>https://dev.to/joe_jngigi/learning-sql-and-an-introduction-on-python-for-data-science-5hii</link>
      <guid>https://dev.to/joe_jngigi/learning-sql-and-an-introduction-on-python-for-data-science-5hii</guid>
      <description>&lt;h1&gt;
  
  
  SQL For Data Analysis
&lt;/h1&gt;

&lt;p&gt;SQL is a powerful tool for analyzing data, thanks to its ability to work with multiple databases simultaneously and its use of relational databases. It's a widely used and versatile language that is both user-friendly for beginners and highly advanced for creating sophisticated data analysis tools and dashboards.&lt;br&gt;
In order to dive into SQL for data analysis, wel will dive into some basic questions that one may ask themselves when diving into this field&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;What Data Analysis&lt;/li&gt;
&lt;li&gt;What is data and big Data, and  data processing&lt;/li&gt;
&lt;li&gt;What is SQL and how is is used in Data Analysis&lt;/li&gt;
&lt;li&gt;Dabase and SQL&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Data Analysis
&lt;/h2&gt;

&lt;p&gt;Data analysis is the process of inspecting, transforming, and modeling data in order to extract useful information and draw conclusions from it. Data analysis is a valuable procedure that can minimize the risks associated with decision-making by offering useful insights and statistical information. This information is typically presented through charts, images, tables, and graphs. An everyday example of data analysis occurs when we assess past events or anticipate future outcomes to make decisions. In essence, this involves analyzing the past or the future and using that analysis to make an informed decision.&lt;br&gt;&lt;br&gt;
With the help of data analytics, businesses can better keep track of and understand how they run and what services they offer. It gives them a deep understanding of the problems and experiences of their clients. When businesses shift their focus from data to insights and then take action, they can make their products and services fit the needs of each customer, streamline their processes, and increase output across the board.&lt;br&gt;&lt;br&gt;
Data analysis plays a crucial role in processing big data into useful information.&lt;/p&gt;
&lt;h2&gt;
  
  
  Data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Data is all information that may be collected, stored, and analyzed for the goal of making decisions or gaining insights is referred to as data. Text, numbers, photos, audio, and video are all examples of data.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Big Data&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Big data refers to extremely large and complex data sets that cannot be easily processed or analyzed using traditional data processing techniques. These data sets typically contain a wide variety of data types, including structured data (such as data stored in databases or spreadsheets), unstructured data (such as text or multimedia content), and semi-structured data (such as web log files or sensor data).&lt;br&gt;&lt;br&gt;
Big data analytics follows five steps to analyze any large datasets: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data collection&lt;/li&gt;
&lt;li&gt;Data storage&lt;/li&gt;
&lt;li&gt;Data processing&lt;/li&gt;
&lt;li&gt;Data cleansing&lt;/li&gt;
&lt;li&gt;Data analysis&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  SQL And SQL in Data Analysis
&lt;/h2&gt;

&lt;p&gt;SQL, which stands for "Structured Query Language," is a type of programming language used to manage data in a relational database. A database is an organized collection of data. SQL is useful for conducting aggregations like sums, counts, minimums, and maximums that you would typically perform in an Excel pivot table, but over much bigger datasets and on numerous tables at once.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;SQL is widely used in data analysis as it provides a powerful and efficient way to extract, filter, and transform data in a structured and consistent manner.&lt;br&gt;&lt;br&gt;
SQL is used in data analysis to query and manipulate big data sets to derive useful insights. Data analysts can use SQL to collect data from several tables, apply filters to that data based on user-defined criteria, and conduct computations and aggregations on the retrieved data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Filtering data: SQL can be used to pull out information that satisfies specific parameters, like only including records that are inside a specified date range or that belong to a specific client.&lt;br&gt;
Aggregating data: SQL can be used to get the sum, average, and maximum of a group of numbers.&lt;br&gt;
Data transformation: In order to facilitate analysis, SQL can be used to transform data into a more usable form, for as by transforming dates into a standard format or by adding new variables depending on existing data.&lt;br&gt;
Joining data: Joining from different sources or tables and it is a powerful feature of SQL.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Database and SQL Syntax
&lt;/h2&gt;

&lt;p&gt;Database is an electronic filing system. We will use a relational database system. It is a software system from which we can manipulate the data in a database. DB maria will be our database management system. The datatypes used are;&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Int&lt;/code&gt; For storing integers&lt;br&gt;
&lt;code&gt;Decimal(m, n)&lt;/code&gt; For storing the decimals, m is the main number and n is number of digits after decimals&lt;br&gt;
&lt;code&gt;BLOB&lt;/code&gt; For storing the large files (Binary large objects) like photos and videos&lt;br&gt;
&lt;code&gt;VARCHAR&lt;/code&gt; For storing strings characters or values&lt;br&gt;
&lt;code&gt;DATE&lt;/code&gt; For storing time date&lt;br&gt;
&lt;code&gt;TIEMSTAMP&lt;/code&gt; For storing the time stamp when something was installed&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  The SQL syntax
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;CREATE&lt;/code&gt; is used to create a database and table in a database. You start with the command and then the name of the database or the table. After describing the table, the other information describing the attributes of the table are found in brackets, and the statements end with the semicolon.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;CREATE DATABASE {name_of_database}&lt;/code&gt;&lt;br&gt;
&lt;code&gt;CREATE TABLE {name} (student VARCHAR (20) PRIMARY KEY, name VARCHAR );&lt;/code&gt;&lt;br&gt;
&lt;code&gt;DROP&lt;/code&gt; is the command for deleting the anything on the Database or the database for that case&lt;br&gt;
&lt;code&gt;DESCRIBE&lt;/code&gt; is for displaying information about the table&lt;br&gt;
&lt;code&gt;ALTER&lt;/code&gt; is used for altering the table in the database&lt;br&gt;
&lt;code&gt;ALTER TABLE {name} ADD (name of column to add)&lt;/code&gt; &amp;gt;&lt;code&gt;ALTER TABLE {name} DROP COLUMN (name of column to add)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Inserting Information
&lt;/h3&gt;

&lt;p&gt;This is inserting the information in the database tables&lt;br&gt;&lt;br&gt;
&lt;code&gt;INSERT INTO {table name} VALUES (‘Joseph’, ’Physics’,’ Sc200’)&lt;/code&gt;. The data must be put in the older by Which the database table is already.&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT*FROM {table name}&lt;/code&gt; This one displays a table how it looks like or the tables in the databaseAnd how they are laid out.&lt;br&gt;&lt;br&gt;
When inserting information in the database, there some of the members who may not have all the information as required by the database. How to solve this, is just after the table name, you open the brackets and put in the name of the attributes by which all the information is available for input.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT INTO employee(`emp_id`, `first_name`, `last_name`, `birth_date`, `sex`, `salary`, `super_id`, `branch_id`) VALUES
('103','Tabby','Mutharu','1999,16,24,','f','60550','3','2')’
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Constraint Commands
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;NULL&lt;/code&gt; This means that an entity can have no value under the attribute.&lt;br&gt;
These are the unique codes in the SQL syntax from which they affect how the data in the tables are affected. These commands are put when one is creating the tables and their attributes.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;NOT NULL&lt;/code&gt; This means that for an entity, the attribute has to have a value for the data inserted to be valid, otherwise there is an error.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;UNIQUE&lt;/code&gt; This means that the values for an entity put for an attribute with this parameter is and is only for that entity. No other entity can possess such attributes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DEFAULT&lt;/code&gt; This is when one can put in something that appears once a column is left blank. Example;&lt;code&gt;table_name (major VARCHAR (20) DEFAULT ‘undecided’);&lt;/code&gt; In the column this appears as “Undecided” once the pace is left unfilled.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AUTO_INCREMENT&lt;/code&gt; This can be used instead of the primary keys. What happens is that it increments in the series 1, 2, 3…. Once each of the data is inserted in the database. Example; &lt;code&gt;table_name VARCHAR (20) AUTO_INCTREMENT);&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Updating and Deleting
&lt;/h3&gt;

&lt;p&gt;Updating can be used to correct certain data or insert new data of an existing entity into a table. Example, the syntax for updating the data for an entity is &lt;code&gt;UPDATE table_name SET major = ‘Bio’ WHERE major = ‘Biology’;&lt;/code&gt; This line of SQL will update the table mentioned where the Biology is changed to Bio. Also, we can update other places of the table &lt;code&gt;UPDATE table_name SET major = ‘Chemistry’ WHERE student_id = ‘4’&lt;/code&gt;.&lt;br&gt;
We can change maybe two or more entities have the different majors but are in the same table&lt;br&gt;&lt;br&gt;
&lt;code&gt;UPDATE table_name SET major = ‘Bio-Chemistry’ WHERE major = ‘Biology’ OR major=’Chemistry’&lt;/code&gt;&lt;br&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Where is used for comparison. Other comparisons are =(Equals), not equal &lt;code&gt;(&amp;lt;&amp;gt;)&lt;/code&gt;, Greater than &lt;code&gt;(&amp;gt;)&lt;/code&gt;, Less than &lt;code&gt;(&amp;lt;)&lt;/code&gt;, less than equals to&lt;code&gt;(&amp;lt;=)&lt;/code&gt; and greater than equals to&lt;code&gt;(&amp;gt;=)&lt;/code&gt;.&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Deleting is when you want to completely remove a certain entity from the table all delete all the data from the table. The syntax for the above is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DELETE FROM table_name WHERE student_id = ‘3’&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DELETE FROM student&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Basic Queries:
&lt;/h3&gt;

&lt;p&gt;These using various SQL statements so as to get information from a database.&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT&lt;/code&gt; statement in SQL. The select statement tells the database that we want to get some information from it.&lt;br&gt;
&lt;code&gt;SELECT * FROM table_name&lt;/code&gt; This means that we are going to tell the DB to display the whole of the table. The asterisk means that get everything from the table.&lt;br&gt;&lt;br&gt;
This implies that we can also use select statement to perform actions like Selecting a column in a table. That is SELECT Student_name FROM table_name&lt;br&gt;
&lt;code&gt;SELECT Student.Student_name, student.major FROM &amp;lt;table_name&amp;gt;&lt;/code&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;In the table we can use the ORDER BY command to sort the names in any way like the alphabetical order or the numbered way. You can add the DESC or ASC after specifying on which column you want the name sort.&lt;br&gt;
SELECT Student.Student_name, student.major FROM table_name ORDER BY student_name ASC&lt;br&gt;
You can also use another command called Limit. It limits the results from which you have specified.&lt;br&gt;
&lt;code&gt;SELECT * FROM student LIMIT 2&lt;/code&gt;&lt;br&gt;
We can also filter the data in the table using the specific information we want. Like for example we want to display a name of a certain student in a table. We can filter this using their student ID by which is Unique for them.&lt;br&gt;
&lt;code&gt;SELECT student_name FROM student WHERE student_id = 2&lt;/code&gt;&lt;br&gt;
In this case one can use the common operators where the “=” is. The operators are &amp;lt;, &amp;gt;, &amp;lt;&amp;gt;, AND, OR &amp;lt;= and &amp;gt;=&lt;br&gt;
&lt;code&gt;SELECT * FROM student WHERE Student_id &amp;lt;= 4 AND major &amp;lt;&amp;gt; 'Software Engineering'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates a table with the named columns. There below is a way by which the foreign key is set with the reference to the named table and then the column with which it’s set. This give two tables a relation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE branch
(
branch_id INT PRIMARY KEY,
branch_name VARCHAR(40),
mgr_id INT,
mgr_start_date DATE,
FOREIGN KEY(mgr_id) REFERENCES employee(emp_id) ON DELETE SET NULL
);

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;SELECT STATEMENT&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
We can change how the name of the databases are changed to whatever we want displayed based on the circumstances one is in.&lt;br&gt;
SELECT student_name AS forename FROM student&lt;br&gt;&lt;br&gt;
&lt;strong&gt;DISTINCT&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
In an Example there could be information stored with same data. It gives a list of the different individual data in a column data given like male, female and others.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;SELECT DISTINCT emp_id FROM works_with ORDER BY emp_id&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  SQL Functions
&lt;/h3&gt;

&lt;p&gt;These are lines of codes that do perform different functions for us like doing averages, adding up the data or counting certain data. They are useful when we are collection and doing analyzation of data to get the information about it. Here are some functions in SQL:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;COUNT()&lt;/strong&gt; &lt;br&gt;&lt;br&gt;
This will count the number of employees in the column name and give the number of entities as the function says.&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT COUNT(emp_id)&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT COUNT(emp_id) WHERE sex = ‘F’ AND birth_date = ‘1980-01-01’&lt;/code&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AVG()&lt;/strong&gt;&lt;br&gt;
This gives the average of whatever you’d want to calculate in any column of any table in the database. Below is the syntax for the average&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT AVG (salary) FROM employee&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SUM()&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This one finds the sum of the selected column for specified table. You can filter to what is needed.&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT sum(salary) FROM employee&lt;/code&gt;&lt;br&gt;&lt;br&gt;
One can filter to the desired way of how the’d want present on analyze data.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AGGREGATION&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This is going to specify the name of the sex available on the name. To be more precise like shown below. This is going to show the number of females or males in the given table.&lt;br&gt;
&lt;code&gt;SELECT COUNT (sex), sex FROM EMPLOYEE&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;SELECT COUNT (sex), FROM employee GROUP BY sex&lt;/code&gt;&lt;br&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Python for Data Science
&lt;/h1&gt;

&lt;p&gt;Python's ease of use, adaptability, and general-purpose nature have led to the language's widespread adoption in the field of data science. In spite of the fact that it wasn't the first major programming language, its status as one has steadily increased over time. About two-thirds of data scientists in 2018 said they used Python on a daily basis, making it the most popular language among analytics experts.&lt;/p&gt;

&lt;p&gt;In order to get started on Python for dta science, it is important to first learn and understand the basics of Python as a Programming language. TO pratices this one need to install an environment to allow us to code Python. There are various ways to achieve this. I will discus two major ways. The first step involves installing a Python environment. This is the best way to learn how to do this as it will give you a chance on how to setup environments especially if you are using a Linux system. Linux system usually comes pre-installed with Python. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installation of a Python Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Manual Installation&lt;/strong&gt;&lt;br&gt;
Download a the latest version of python.&lt;a href="https://www.python.org/downloads/"&gt;Python&lt;/a&gt;. Install it on your Windows or MAC. Install a VS code text Editor and navigate to Extensions. Find necessary extensions. My most preffered is &lt;code&gt;Pylance&lt;/code&gt; as it gives me an intellisense for Python. Here you can practice the Python basics through tutorials, but the best way to learn is through doing simple projects as you progress and make use of the free documentations from the internet.&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: To use Python files have an extension of &lt;code&gt;.py&lt;/code&gt;. To make a project or a file, On your text editor Click on files&amp;gt;New file and name it as -anyname.py- then save it in your favorite place or your projects folder&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Setup and installation of the Python environment for data science(Anaconda, Jupyter Notebook)&lt;/strong&gt;&lt;br&gt;
Download and install Anaconda: Anaconda is a free and open-source distribution of Python that includes a large number of data science packages and libraries.&lt;a href="https://www.anaconda.com/products/distribution"&gt;Anaconda&lt;/a&gt;. Jupyter Notebook is included with Anaconda, so you can start using it right away. The Jupyter Notebook is an open-source web application that lets data scientists make and share documents that include live code, equations, computational output, visualizations, and other multimedia resources, along with explanatory text &lt;a href="https://odsc.medium.com/why-you-should-be-using-jupyter-notebooks-ea2e568c59f2#:~:text=The%20Jupyter%20Notebook%20is%20an,text%20in%20a%20single%20document."&gt;JupyterNotebooks&lt;/a&gt;. To launch Jupyter Notebook, open Anaconda Navigator and click on the "Launch" button next to Jupyter Notebook. This will open Jupyter Notebook in your default web browser. Click on the "New" button in the top right corner of the Jupyter Notebook interface and select "Python 3".&lt;/p&gt;

&lt;h2&gt;
  
  
  Python data science basics:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DataTypes&lt;/strong&gt;&lt;br&gt;
To learn practice data science, there need to be knowledge for the datatypes used in Python and how to manipulate the. There are four basics datatypes of Python which include&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Lists: A list is a collection of items that can be of any type. Lists are mutable, meaning they can be changed after they are created.&lt;/li&gt;
&lt;li&gt;Dictionaries: A dictionary is a collection of key-value pairs. Each key is associated with a value, which can be of any type. Dictionaries are mutable, and you can add, remove, or modify key-value pairs.&lt;/li&gt;
&lt;li&gt;Tuples: A tuple is similar to a list, but it is immutable, meaning it cannot be changed after it is created. Tuples are often used to represent a collection of related values.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Tools&lt;/strong&gt;&lt;br&gt;
There are many tools and libraries available in Python for data science. The common tools used for Data science in Python include:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;NumPy: NumPy is a Python library that is often used to work with numerical data. It gives you tools that are fast and easy to use for working with arrays, which are groups of data that can be any size. NumPy also has a number of functions, like addition, multiplication, and trigonometric functions, that can be used to do math operations on arrays.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pandas: Pandas is a library for Python that lets you work with data in tables. It has data structures like the Series and the DataFrame, which are like improved lists and dictionaries, respectively. Pandas also has tools that let you read and write data in different formats, like CSV and Excel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Matplotlib: Matplotlib is a Python library that lets you make visuals of data. It has many tools for making charts and plots, such as line charts, scatter plots, and histograms. Matplotlib can be used to make both static and interactive visualizations that can be saved as image files or put into web applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;Other common used for machine Learning include&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Scikit-learn is a library that is used to teach machines how to do things. It has a lot of algorithms for things like regression, classification, clustering, and reducing the number of dimensions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TensorFlow is a library that is used to build and train deep learning models. It gives you a strong and flexible base on which to build a wide range of machine learning models.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Data Cleaning&lt;/strong&gt;&lt;br&gt;
Cleaning and manipulating data are important parts of any data science project, since data is rarely clean and organized enough to be analyzed right away.&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Aggregating data: Pandas has methods for aggregating data, like groupby(), which groups data by a given column, and aggregate(), which does calculations on grouped data.&lt;/li&gt;
&lt;li&gt;Combining data: Methods like merge() and concat can be used to combine data from different sources ().&lt;/li&gt;
&lt;li&gt;Handling missing data: Pandas gives you ways to find missing data in a DataFrame, filter it, and fill it in.&lt;/li&gt;
&lt;li&gt;Renaming columns: You can change the names of columns in a DataFrame by using the rename() method.&lt;/li&gt;
&lt;li&gt;Getting rid of duplicates: The drop duplicates() method can be used to find and get rid of duplicates.&lt;/li&gt;
&lt;li&gt;Filtering and sorting data: Methods like loc[, iloc[, and sort values can be used to filter and sort data ().&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

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