<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by James Harrison on Medium]]></title>
        <description><![CDATA[Stories by James Harrison on Medium]]></description>
        <link>https://medium.com/@J.Code?source=rss-aaef5054a7f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QUWrhI1EWRpd6oCKYjpvRg@2x.jpeg</url>
            <title>Stories by James Harrison on Medium</title>
            <link>https://medium.com/@J.Code?source=rss-aaef5054a7f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:16:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@J.Code/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Install Flutter]]></title>
            <link>https://medium.com/@J.Code/how-to-install-flutter-6c8eb348e5ef?source=rss-aaef5054a7f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c8eb348e5ef</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[James Harrison]]></dc:creator>
            <pubDate>Fri, 11 Feb 2022 04:25:40 GMT</pubDate>
            <atom:updated>2022-02-11T04:25:40.145Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide will help you get up and running with flutter development very quick! For some reason this confused me…so if it confused you too this will help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J337suaxYncDJSEg" /><figcaption>Photo by <a href="https://unsplash.com/@joshuaryanphoto?utm_source=medium&amp;utm_medium=referral">Joshua Reddekopp</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>NOTE: Before starting this installation make sure you have <a href="https://apps.apple.com/us/app/xcode/id497799835?mt=12">Xcode</a> and <a href="https://guides.cocoapods.org/using/getting-started.html">cocoapods</a> downloaded if youre on a mac or android studio if you’re on a PC.</p><h3>Flutter Download</h3><p>Navigate to the URL below for the flutter documentation to download flutter.</p><p><a href="https://flutter.dev/docs/get-started/install">Flutter Docs! Click me</a></p><p>Once here click on your operating system, this guide is primarily for macOS Users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*6q0Rel8S_oFS4KDL8TaRYg.png" /></figure><p>After selecting your OS, I chose macOS you can now download the flutter SDK by clicking the download button here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*pfwVKrHAQwkcil6fkcBaIg.png" /></figure><h3>Install Flutter SDK</h3><p>Now that the file is downloaded double click the file to un-zip it and move the folder to the desired location on your computer.</p><p>I would create a folder called Developer under your user by going to finder clicking your user name and then creating a folder called Developer. I keep all programming related things in this folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*H0tQVWUiTHhMsU8lAh0sSA.png" /></figure><p>Now find the zip file for the flutter download and double click it to unzip it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*M6ZQw1BGSyAeBZc4PgBBFA.png" /></figure><p>After its unzipped you should see the flutter folder, drag that into your new Developer folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*wjxqpTJJfLlNuuRatIIaWQ.png" /></figure><h3>Terminal</h3><p>Now open terminal by typing cmd + space and then typing the word terminal.</p><p>We need to figure out what terminal shell is installed on your computer, different shells have different startup files. Run the command below to figure out what shell youre on.</p><pre>echo $SHELL</pre><ul><li>If the results is /bin/zsh then you are on the ZSH shell</li><li>If the results is /bin/bash then you are on the bash shell</li></ul><h3>Add Flutter File Path</h3><p>Now we need to add the flutter file path to the startup file for your shell.</p><h3>ZSH</h3><p>For the ZSH Shell, the startup file is called .zshrc, we need to update this with file to include the path to the flutter folder you just downloaded. This will tell your computer where flutter is installed, when you try to run it.</p><pre>nano $HOME/.zshrc</pre><h3>Bash</h3><p>For the bash Shell, the startup file is called bash_profile, we need to update this with file to include the path to the flutter folder you just downloaded. This will tell your computer where flutter is installed, when you try to run it.</p><pre>nano $HOME/.bash_profile</pre><p>Once you’re in the proper startup file paste the following line below into that file. You must replace pwd with the path that your flutter folder is located.</p><pre>export PATH=&quot;$PATH:`pwd`/flutter/bin&quot;</pre><p>Example based off my path:</p><pre>export PATH=&quot;$PATH:/Users/jamesharrison/Developer/flutter/bin&quot;</pre><p>So your file should look something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGzbSc4Mue3YbJSeYXx1Bg.png" /></figure><p>Once you are done then click ctrl X then Yand then Enter this will save and quit the file.</p><p>After that the final step is to quit terminal and then reopen it.</p><p>Once back in terminal type flutter doctor This will tell you if you are missing anything or if the install went correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*0scPf2RYfcO3yG7gZ1b7Sg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c8eb348e5ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Increasing My Productivity Killed My Productivity]]></title>
            <link>https://medium.com/@J.Code/how-increasing-my-productivity-killed-my-productivity-de240819f308?source=rss-aaef5054a7f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/de240819f308</guid>
            <category><![CDATA[task-management]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[James Harrison]]></dc:creator>
            <pubDate>Thu, 06 Jan 2022 06:01:32 GMT</pubDate>
            <atom:updated>2022-01-06T06:01:32.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7ZSN6RyRgRjHO71f" /><figcaption>Photo by <a href="https://unsplash.com/@workshopand?utm_source=medium&amp;utm_medium=referral">Workshop&amp;</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I consider myself a productive person but i’m also a person who loves new tools like apps and websites, or anything that will really help increase that productivity.</p><p>If you’re like me you YouTube history is full of videos about how to increase your productivity, or titles like “how this app can 2x the amount of task you complete”.</p><p>I was always researching what the fancy new app/tool is, and how I can use it in my life. I used to be very simple and barebones using tools like todoist for my task and then Evernote for my documentation. This worked well for me for a long time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*JjpHqHPQWKtvYy9wiVshFA.gif" /></figure><p>Then I got a little fancy with trying out apps like <a href="http://notion.so/">Notion</a> and that started me down the rabbit hole that i’m still coming out of. The cycle I found myself is once I found a new tool, I would force myself to get used to it, and make it apart of my workflow.</p><p>For some reason, after using that tool for a while, and feeling productive I would get the feeling that this wasn’t good enough.</p><p>I would then go back through the same process of research again. I would find something else, and either add it to my toolset or remove something that I was using and switch it with this new tool.</p><p>Little by little I found myself not using any of the tools. Worse than that I feel lost.Now when I get a new task I have used so many different tools that I dont know where to put it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*ny0Z7HXdyDC6J2yyQZDktg.gif" /></figure><p>The same with my notes, I’m currently writing this inside of apple notes, because I cant think of which tool should store my articles.</p><p>The one thing I’ve learned from all of this is find a system that works for you and stick with it. Back when I was using Todoist and Evernote, things were not fancy but I was organized. This isn’t an ad for those tools they were just what I was using at that time. The point is when you have your system, dont stress trying to change it.</p><p>This year I’m working on starting from scratch, after I write this in apple notes, I’m going to sit back and think through what do I need to stay organized and productive! So if I ever figure that out…I’ll keep yall posted!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de240819f308" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Are SQL Server Clauses]]></title>
            <link>https://medium.com/analytics-vidhya/what-are-sql-server-clauses-5d5f59644fcc?source=rss-aaef5054a7f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d5f59644fcc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[James Harrison]]></dc:creator>
            <pubDate>Fri, 08 May 2020 16:32:57 GMT</pubDate>
            <atom:updated>2020-05-08T16:32:57.026Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to not delete your whole database…</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jInHeMmJyd8U8Fwt" /><figcaption>Photo by <a href="https://unsplash.com/@jstrippa?utm_source=medium&amp;utm_medium=referral">James Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So in the last article, we learned how to insert, select and update data, pretty much the CRUD(create, read, update, delete) basics . If you’re not too familiar with SQL I would definitely give that article a read first. It will help with your understanding of this one.</p><p><a href="https://medium.com/@J.Code/sql-server-introduction-9e172e5d66ba">SQL Server Introduction</a></p><p>Most times when we are performing task such as retrieving or altering data we don’t want all the records in the table to be affected. So that’s when a clauses can be useful. There are a few clauses that we will go over today such as:</p><ul><li>Where</li><li>Like</li><li>Order By</li><li>Distinct</li></ul><p>For each of these clauses, i’ll go over the basic idea, show you the syntax, and then give you a real example with the code, so let&#39;s get started!</p><h3>Where Clause</h3><p>The Where clause is used to specify a condition whenever you are trying to retrieve/modify data from a table</p><p>If the condition which is provided to the where clauses is met, then only the specific data which meets the condition will be returned/altered.</p><p>I said returned/altered because you select statements(gets the data for you). You can also use them with update statements, delete statements and in other more advanced instances.</p><h4>Syntax</h4><p>The basic syntax is as shown below.</p><p>You begin by using whichever statement you need, whether its select, update or even delete. Then following the where clause you would add some condition.</p><pre>SELECT columnNname<br>FROM tableName<br>WHERE &lt;Some Condition&gt;;</pre><p>This condition would use logical operators such as =, &lt;, &gt;, etc, the data which is returned or altered must meet the where condition, so the logical operator must equal true. Alright thats a little confusing, lets see an example.</p><h4>Example</h4><p>In the following example we will use the * symbol to represent all columns, this is frequently used in SQL.</p><p>For all of the examples in this article, we will be using a table called Employees which was created in the first article <a href="https://medium.com/@J.Code/sql-server-introduction-9e172e5d66ba">here</a>.</p><p>We will retrieve all employees in our database whose age &gt;30, so whenever this is true, the data will be returned.</p><pre>SELECT * <br>FROM Employees<br>WHERE Age &gt; 30;</pre><h4>Result</h4><p>You should expect to see something similar like this</p><p>Only entries which meet the where clause condition should show, In this case only entries with the Age greater than 30.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*TRyoAzJMOyCFZzaqZNi6RA@2x.jpeg" /><figcaption>Employees with age &gt; 30</figcaption></figure><h4>Like Clause</h4><p>The like clause uses wildcard operators to compare similar values. It helps you get data which is “like” your condition.</p><p>There are two operators commonly used with the like clause:</p><p>%: This represents any string of zero, or multiple characters. What this means is that whenever the % symbol is used, any letter or number can go there.</p><p>_: Which represents a single character, this means the _ can only be replaced by a single character, not multiple like with the %.</p><p>Alright I know that was a bit confusing lets, see the syntax and then the examples will clear it all up.</p><h4>Syntax</h4><p>The basic syntax for the like clause is shown below. Note that operators%, _ can be located anywhere within a string.</p><p>So for the first example, we want any string, which has xxx as the last 3 characters, and we don&#39;t care how many characters are in front of it.</p><pre>SELECT * FROM tableName<br>WHERE columnName LIKE ‘%xxx’</pre><p>For this example, we want a string, which has xxx as the last 3 characters, and has ONE character in front of it.</p><pre>SELECT * FROM tableName<br>WHERE columnName LIKE ‘_xxx’</pre><p>For this example, let&#39;s get a little wild, we want a string, which has xxx any where in the middle, it doesn’t matter how many characters are in the front of the string, and has ONE character as the last character of the string. This is just to show that you can combine these operators, in any position in the string.</p><pre>SELECT * FROM tableName<br>WHERE columnName LIKE ‘%xxx_’</pre><p>Lets move on to a real example though.</p><h4>Example</h4><p>The following example will show you how the LIKE operator can be used to find employees in the table which are in their 20’s.</p><pre>SELECT * FROM Employees<br>WHERE Age LIKE ‘2%’</pre><h4>Results</h4><p>The result of this query will return all employees who are in their 20’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YIyQLMwyHZU4Ndt1OAcM-Q.png" /><figcaption>Employees in their 20s</figcaption></figure><h3>Order By Clause</h3><p>When retrieving data using a select statement, there isn’t always an obvious order to the results. In order to enforce a specific order you can use the clause order by</p><h4>Syntax</h4><p>The basic syntax for the order by clause is shown below.</p><pre>SELECT columnName FROM tableName<br>ORDER BY columnName ASC|DESC</pre><p>So I won’t go over the basic select statement since we went over it in the first post, but after your select statement you can add theorder by clause followed by the &lt;column list&gt; you want the order based off and asc or desc. This stands for ascending and descending respectively.</p><p>Note: The order is Ascending by default</p><h4>Example</h4><p>For the following example we will order the entries in the Employees table by salary in descending order. So our main money maker will be on top, and the lowest salary at the bottom.</p><pre>SELECT * FROM Employees<br>ORDER BY Salary DESC</pre><h4>Results</h4><p>The results from the above statement will show all entries in our Employees table ordered in descending order by salary, So the highest salary will be on top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9mFLIK1NCdsZP4mx-KdEw.png" /><figcaption>Order by salary descending</figcaption></figure><h3>Distinct Clause</h3><p>Another clause that is used along the select statement is the distinct clause.</p><p>This is used to ensure that only unique data is retrieved for the database and ignores any duplicate records.</p><p>If theres ever a case where you have duplicate records in your database and only want one instance of each, this would be helpful.</p><h4>Syntax</h4><p>The syntax for the distinct clause is shown below.</p><pre>SELECT DISTINCT columnName FROM tableName;</pre><p>You would select distinct the specific columns you want distinct values from.</p><h4>Example</h4><p>In the following example, we will select the age column from our table.</p><p>Our table currently looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZ_Qs4Oq2tLuD3L94NRaSw.png" /><figcaption>Select * from Employees</figcaption></figure><p>If you take a quick look you’ll see there are two entries in our data with the age of 25 but when we query with the DISTINCT clause we will only see 25 once.</p><pre>SELECT DISTINCT Age FROM Employees;</pre><p>The image below shows the result of the query, again note there is only one instance of the age 25 even though the data shows that there are two entries with age 25.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*aodMr3UOzL32yXZxo7ghdg.png" /><figcaption>Distinct list of ages</figcaption></figure><p>Thanks for reading and I hope this helps. I will post more articles going over SQL Server from the basics to the more advanced features like functions and stored procedures and keep an updated list in this article below.</p><p><a href="https://medium.com/@J.Code/sql-server-introduction-9e172e5d66ba">SQL Server Introduction</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d5f59644fcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/what-are-sql-server-clauses-5d5f59644fcc">What Are SQL Server Clauses</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Server Joins]]></title>
            <link>https://medium.com/analytics-vidhya/sql-server-joins-a6cedef552d?source=rss-aaef5054a7f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6cedef552d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[James Harrison]]></dc:creator>
            <pubDate>Thu, 07 May 2020 16:56:03 GMT</pubDate>
            <atom:updated>2020-05-07T16:56:03.642Z</atom:updated>
            <content:encoded><![CDATA[<h4>Get the data you want, when you want</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SDxl8q99TT4N7Xrw" /><figcaption>Photo by <a href="https://unsplash.com/@blakeconnally?utm_source=medium&amp;utm_medium=referral">Blake Connally</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So previously, we learned how to insert, select and update data, pretty much the CRUD(create, read, update, delete) basics . If you’re not too familiar with SQL I would definitely give that article a read first. It will help with your understanding of this one.</p><p><a href="https://medium.com/@J.Code/sql-server-introduction-9e172e5d66ba">SQL Server Introduction</a></p><p>Today we’re go over a more advanced concept in SQL, which is how to join tables.</p><p><strong>What are Joins?</strong></p><p>Joins come in useful when you want to…join data from multiple tables, hope that helps.</p><p>Joins are used to combine rows from two or more tables, these rows are based on a related column between them. Instead of having to do multiple queries to see data you want, you can use a join, and with a single query get data from multiple tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*_pGj3DixmBImxcAl_HWWdA.gif" /></figure><p>In order to really work with joins properly, you have to understand the structure of your database and really understand how your tables are related, If your project has a Database Diagram that would be one of the easiest ways to view these relationships.</p><p>If it doesn’t, then you have to just do it the hard way, actually look through all your tables and understand the relationships…RIP</p><h4>Types of Joins</h4><p>There are multiple types of joins:</p><p><em>Inner Join<br></em>This will return records that have matching values in both tables</p><p><em>Left (Outer) Join</em><br>Returns all records from the left table and the matched ones from the right table</p><p><em>Right (Outer) Join</em><br>Returns all records from the right table and the matched ones from the left table.</p><p><em>Full (Outer) Join</em><br>Returns all records from both tables.</p><p><strong>Syntax for INNER Join</strong></p><p>The syntax for all the joins are similar, its the results of the query that are different, so I will just show the syntax for the inner join.</p><pre>Select *<br>from tableOne<br>    joinType join tableTwo<br>        on (tableOne.columnName = tableTwo.columnName)</pre><ul><li>You first say which table you would like to query normally with the <br>from tableOne</li></ul><p>• After that comes the join, you declare the type of Join and then second table name, as well as the related data from both tables.</p><p>joinType join tableTwo on (tableOne.columnName = tableTwo.columnName)</p><p><strong>Creating Extra Table</strong></p><p>For this example we need a new table with related data, so lets create a table which simply stores when our employees clock in and clock out. This table will share the employee id and employee name from in our Employees Table.</p><p>So if you’re following along with my previous post where we created the Employees database you’ll need to add another table. If not you can skip ahead to the join example.</p><p>The code below will create the table, I called my database JobDatabase, if you did not, make sure you put your database name.</p><pre>USE JobDatabase<br>GO</pre><pre>CREATE TABLE TimeClock<br>(<br>    employeeID INT NOT NULL PRIMARY KEY,<br>    employeeName VARCHAR(50),<br>    timeIn time,<br>    timeOut Time<br>)<br>GO</pre><pre>INSERT INTO TimeClock VALUES (1, ‘James’, ‘10:25:35’, ‘16:56:43’);<br>INSERT INTO TimeClock VALUES (2, ‘Emily’, ‘14:45:25’, ‘16:56:43’);<br>INSERT INTO TimeClock VALUES (3, ‘Nick’, ‘10:12:56’, ‘15:48:45’);<br>INSERT INTO TimeClock VALUES (4, ‘Kyle’, ‘10:43:24’, ‘19:42:35’);<br>INSERT INTO TimeClock VALUES (5, ‘Mike’, ‘20:25:15’, ‘04:23:24’);<br>INSERT INTO TimeClock VALUES (6, ‘Anthony’, ‘17:34:35’, ‘23:45:24’);<br>GO</pre><p>The data from this table looks like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DaHvsyWHkAJ7HOzD7E4XPA.png" /><figcaption>TimeClock table</figcaption></figure><h4>Join Example</h4><p>For our example we want all the employee information, including the time they clocked in and clocked out. I don’t want to do two queries though, because I cant fully understand the data that way. I want one large table with all the data.</p><p>We want to select * columns from the employees table and from the TimeClock table if the ID from the employees table matches the employeeID from the TimeClock table</p><p>Note: To access a column in a particular table you use the tableName.columnName syntax</p><pre>select *<br>from Employees<br>inner join TimeClock on Employees.ID = TimeClock.employeeID</pre><p><strong>Results<br></strong>The results from the above query are below:</p><p>Notice that the two tables are joined together, the TimeClock table is appended to our existing Employees table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXIsUxn4g9lHJ9dzEF3z1g.png" /><figcaption>Employees table on the left and Timeclock on the right</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*z6-XWtRlCDKciBd3eS4PzQ.gif" /></figure><p>Thanks for reading and I hope this helps. I will post more articles going over SQL Server from the basics to the more advanced features like functions and stored procedures and keep an updated list in all the articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6cedef552d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/sql-server-joins-a6cedef552d">SQL Server Joins</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Server Introduction]]></title>
            <link>https://medium.com/swlh/sql-server-introduction-9e172e5d66ba?source=rss-aaef5054a7f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e172e5d66ba</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[sql-server]]></category>
            <dc:creator><![CDATA[James Harrison]]></dc:creator>
            <pubDate>Wed, 22 Apr 2020 06:59:06 GMT</pubDate>
            <atom:updated>2020-06-26T05:00:59.761Z</atom:updated>
            <content:encoded><![CDATA[<h4>What and how do you even use SQL</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ySGxB-dpe3Dbnq4q" /><figcaption>Photo by <a href="https://unsplash.com/@jstrippa?utm_source=medium&amp;utm_medium=referral">James Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hey everyone my name is James Harrison, I am have been working as software engineer for about 3 years now, and one of the languages I had to learn was Microsoft SQL Server.</p><p>It was a little challenging for me, I also couldn’t find many resources that didn’t require money and didn’t bore me to death. So I took some notes, aint going to lie, they’re fire but I hope they help.</p><p>I’ll put out a few of these, this one will cover stuff like:</p><ul><li>Basic Datatypes</li><li>Creating and dropping tables</li><li>Inserting, updating and selecting data</li></ul><p>Hope they help…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*WqJUtkGe7cPHum2sF8-BYw.jpeg" /></figure><p>Lets get started.</p><h3>Data Types</h3><p>These are attributes which specify the type of data for an object is a SQL Server data type. Each variable, expression and even column have a data type associated to it.</p><p>Some of a few categories of data types in SQL Server:</p><p>Numeric Data Types</p><ul><li>bit: An integer that can be 0(false), 1(true) or null.</li><li>int: A whole number between the range of -32,768 to 32,767</li><li>decimal(p,s): A decimal number which can have p total number of digits and s total number of digits to the right of the decimal place</li></ul><p>String Data Types</p><ul><li>char(n): This is a fixed width string of characters</li><li>varchar(n): This is a variable width string of characters</li><li>nvarchar(n): This is a variable width string of unicode characters</li></ul><p>There are a bunch of other data types that I wont go into detail about now such as:</p><ul><li>Date and Time</li><li>Binary Strings</li><li>And more</li></ul><p><strong>Creating Tables</strong></p><p>When creating tables all that is required is to type</p><pre>CREATE TABLE &lt;tableName&gt;()</pre><p>You can define the columns and their data types at this time as well.</p><h4>Syntax</h4><ul><li>The basic syntax when creating a table using the CREATE TABLE statement is shown below:</li></ul><pre>CREATE TABLE tableName( <br> firstColumnName datatype PRIMARY KEY,<br> secondColumnName datatype,<br>  thirdColumnName datatype,<br> .....<br> .....<br> NthColumnName datatype<br>);</pre><ul><li>CREATE TABLE : keyword which tells the system to create a new table.</li><li>tableName: Is just a stand in I used. Here you will put the name of your table, this name must be unique</li><li>The list of elements inside the parenthesis after the tableName consist of the names of the columns and their data type.</li><li>PRIMARY KEY : A keyword which forces a column/columns to be unique, these are typically used for identifiers such as a persons ID.</li></ul><h4>Example</h4><p>Enough theory lets see a real example, if you have sql server set up on your computer or you have an editor follow along with me.</p><p>Below is a real example of creating a table in the database. This table will be titled Employees and store information about employees.</p><pre>create table Employees(<br>    Id INT NOT NULL PRIMARY KEY,<br>    Name VARCHAR(20) NOT NULL,<br>    Age INT NOT NULL,<br>    State CHAR(25),<br>    Salary DECIMAL(18,2),<br>);</pre><p>create table Employees() : Creating a new table in the database titled Employees.</p><p>The column names are Id, Name, Age, State and Salary. The data types for these columns are to the right of the name, they are int, varchar, int, char, and decimal.</p><p>PRIMARY KEY: keyword which forces the column(s) to be unique.</p><p>NOT NULL : constraint which says this field cannot be null/empty</p><p>Now that we got a table lets get some data inserted.</p><h3>Insert statement</h3><p>This is exactly what it sounds like, using insert statements you can insert new records/rows in to the tables. To do so you need to use the keywords</p><pre>insert into</pre><h4>Syntax</h4><p>For the following method of inserting you have to specify the table you want to insert to, the column names you want to populate, and the values you want to populate those columns with.</p><p>With this method of insertion you don’t have to insert into all columns, just the ones you specify.</p><pre>insert into tableName<br>(<br>    columnName1, <br>    columnName2,<br>    columnName3, <br>    ..., <br>    columnNameN<br>)<br>VALUES <br>(<br>    value1, <br>    value2, <br>    value3,<br>    ..., <br>    valueN<br>);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7PyjXE0CJT1gUabcdbCNOw.jpeg" /></figure><h4>Examples</h4><p>An example of inserting into the employees table from early is shown below:</p><pre>INSERT INTO Employees (Id,Name,Age,State,Salary) <br>VALUES (1, &#39;James&#39;, 24, &#39;Florida&#39;, 60000.00 );</pre><pre>INSERT INTO Employees (ID,NAME,AGE,ADDRESS,SALARY) <br>VALUES (2, &#39;Emily&#39;, 32, &#39;Alabama&#39;, 73000.50 );</pre><pre>INSERT INTO Employees (ID,NAME,AGE,ADDRESS,SALARY) <br>VALUES (3, &#39;Nick&#39;, 25, &#39;Texas&#39;, 28000.00 );</pre><pre>INSERT INTO Employees (ID,NAME,AGE,ADDRESS,SALARY) <br>VALUES (4, &#39;Kyle&#39;, 30, &#39;New York&#39;, 93000.00 );</pre><pre>INSERT INTO Employees (ID,NAME,AGE,ADDRESS,SALARY) <br>VALUES (5, &#39;Mike&#39;, 31, &#39;Kansas&#39;, 47000.00 );</pre><pre>INSERT INTO Employees (ID,NAME,AGE,ADDRESS,SALARY) <br>VALUES (6, &#39;Anthony&#39;, 21, &#39;Colorado&#39;, 35000.00 );</pre><p>In the example above we inserted 6 rows into the Employees table and we populated the columns Id, Name, Age, State, Salary.</p><p>Let&#39;s go over one of them.</p><p>The employee James, thats ya boy has the following details:</p><ul><li>Id = 1</li><li>Name = James</li><li>Age = 24</li><li>State = Florida</li><li>Salary = 60000 (boy making that paper)</li></ul><h4>Select Statement</h4><p>So you started inserting data, into your new tables, but now you want to be able to retrieve this data, I hear you. To do that we need to use select statements.</p><p>The SELECT statement is used to retrieve data from a database table, this will return data in the form of a table.</p><h4>Syntax</h4><p>The basic syntax for the SELECT statement is shown below:</p><pre>SELECT firstColoumnName, secondColumnName,…NcolumnName FROM tableName;</pre><p>In that example, the select statement is followed by the specific column names which are wanted and after the `FROM` is the table name.</p><p>Let’s say you dont want to have to specify columns maybe you want them all, IDK what you want I’m not you but If you do want all the columns you can use the * symbol. This will allow you to get all the columns in a table.</p><pre>SELECT * FROM tableName;</pre><h4>Example</h4><p>Alright using our Employees table again lets try and get all the data that we inserted above</p><p>Everything in the table Employees will be selected</p><pre>SELECT * FROM Employees;</pre><p>If youre following along with this example you should get results like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KR68Rj4E5NjfqsLE1Dl37A.png" /><figcaption>Results from select statement</figcaption></figure><p>If you wanted to get specific columns you could specify them like this, lets say you just want the name and age of each employee.</p><pre>select Name, Age from Employees;</pre><h3>Update Statement</h3><p>So now we’ve inserted data in, but things change you know, so you want to update the existing records in the table. Maybe youre making more money now and want to update a salary. Thats simple, just use an update statement.</p><p>The update statement is used to change the value of an existing entry in the table.</p><h4>Syntax</h4><p>The Syntax for a basic update statement is shown below:</p><pre>UPDATE tableName<br>SET columnN = valueN</pre><p>After the update you need the name of the table which will be updated.</p><p>After the table name the SET keyword is used to show the columns and the new values.</p><p>But… how does it know which row to update, thats a good question, I’m glad I asked it. Executing the statement above will update every record in that table which might be what you want, but most likely you only need to update, 1 or a few records.</p><p>To do so you can use whats called a where clause. Ill go into more detail about this later on in another post but for now just know it can be used to specify a particular condition for the sql statements, and the query will only affect the records that match that condition.</p><p>The syntax for a update statement with a where clause is shown below.</p><pre>UPDATE tableName<br>SET column1 = value1, column2 = value2,..., columnN = valueN<br>WHERE &lt;Enter some condition&gt;</pre><p>Lets see this in action though</p><h4>Example</h4><p>The following is a real example of updating the table used in the previous examples.</p><p>In the data inserted into the Employees table there was an employee Nick who lived in Texas and had a salary of 28000. For some reason Texas wanted to give everyone there a raise to 60000. So we could do that with the statement below, lets give my boy nick more money.</p><pre>UPDATE Employees<br>SET Salary = 60000.00<br>WHERE State = &#39;Texas&#39;;</pre><p>That will increase the salary of every record, where the state = Texas.</p><p>If we just wanted to increase Nicks salary we could use his ID to be super specific. Since the ID is the primary key for this table SQL knows its unique and the query will also be much faster. We know Nicks ID is 3 because we selected it above.</p><pre>UPDATE Employees<br>SET Salary = 60000.00<br>WHERE ID = 3;</pre><p>After you execute the update statement, if you want to see the results just do another</p><p>select * from Employees;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOxXdihCETw1a6hhRd3CDQ.png" /><figcaption>Results after update to 60000</figcaption></figure><p><em>NOTE: The where clause can also be used to select a specific row, lets say we just want nicks record.</em></p><pre>select * from Employees where ID = 3;</pre><h3>Delete Statement</h3><p>So we messed up, you inserted some data you didnt mean to, or maybe its just not relevant anymore and you want to remove it. Thats easy, just use the delete statement.</p><p>The delete statement is used to delete existing records from a table in the database.</p><p>Similar to the other statements the where clause has to be used in order to select particular rows to be deleted, otherwise everything in that table will be deleted (been there done that).</p><p>The Syntax for a basic delete statement is shown below:</p><pre>DELETE FROM tableName<br>WHERE &lt;Enter some condition&gt;</pre><p>After the DELETE you need the name of the table which will the records will be deleted from.WHERE can be used to tell a particular condition for this delete.</p><p>If you wanted to delete all the contents in a table (you savage) you can leave out the WHERE clause, that would look like this:</p><pre>DELETE FROM tableName</pre><h4>Examples</h4><p>The following is a real example of deleting entries in the table used in the previous examples.</p><p>Using the data we inserted above there was one employee James(ya boy) who lived in Florida. We’re going to delete all the Florida employees.</p><pre>delete FROM Employees<br>WHERE State = &#39;Florida&#39;;</pre><p>Now if we do another</p><pre>select * from Employees;</pre><p>You should see the results below, and notice, James isn’t there anymore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHOpCinWUdqkp9Fo4gWdNw.png" /><figcaption>Results after delete of florida employees</figcaption></figure><h3>Drop Table</h3><p>So if delete is used to remove data from a table then what is used to delete a database…its Drop table.</p><p>This will remove all data, triggers, constraints, indexes and even permission specifications for a table in the database.</p><h4>Syntax</h4><p>The syntax for dropping the table is shown below:</p><pre>DROP TABLE tableName</pre><p>The keyword `DROP TABLE` followed by the table name is all thats needed</p><h3>Example</h3><p>Lets get rid of our beloved employees table…</p><pre>DROP TABLE Employees;</pre><h3>See you next time</h3><p>Thats all for this one folks, this was just a simple intro to some of the basic CRUD (Create, Read, Update and Delete) commands you can use in Microsofts SQL Server.</p><p>I will update this will the other links to my other tutorials going a little deeper into things like sub-queries, joining multiple tables, variables, functions, stored procedures and more, heres a few that might help.</p><ul><li><a href="https://medium.com/analytics-vidhya/sql-server-joins-a6cedef552d">SQL Server Joins</a></li><li><a href="https://medium.com/analytics-vidhya/what-are-sql-server-clauses-5d5f59644fcc">What Are SQL Server Clauses</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e172e5d66ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/sql-server-introduction-9e172e5d66ba">SQL Server Introduction</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>