<?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: Miqotes</title>
    <description>The latest articles on DEV Community by Miqotes (@miqotes).</description>
    <link>https://dev.to/miqotes</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%2F447662%2F5b5e4303-d452-4b4f-bb35-55f1f38817d8.jpeg</url>
      <title>DEV Community: Miqotes</title>
      <link>https://dev.to/miqotes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/miqotes"/>
    <language>en</language>
    <item>
      <title>Switching up the switch statement</title>
      <dc:creator>Miqotes</dc:creator>
      <pubDate>Tue, 01 Dec 2020 01:06:10 +0000</pubDate>
      <link>https://dev.to/miqotes/switching-up-the-switch-statement-5ej4</link>
      <guid>https://dev.to/miqotes/switching-up-the-switch-statement-5ej4</guid>
      <description>&lt;h1&gt;
  
  
  Let us talk a little about switch statements!
&lt;/h1&gt;

&lt;p&gt;Switch statements can replace multiple if statements. You can compare values against multiple variants in a not as clunky-looking way as if statements.&lt;/p&gt;

&lt;p&gt;You don't want to burn yourself out doing this: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.redd.it%2F13j2y2a9it351.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.redd.it%2F13j2y2a9it351.png"&gt;&lt;/a&gt;&lt;br&gt;
When you can do this instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 2 + 2;

switch (a) {
  case 3:
    alert( 'Not enough.' );
  case 4:
    alert( 'Perfect!' );
  case 5:
    alert( 'No more, stop.' );
  default:
    alert( 'What even is this?' );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The value of &lt;strong&gt;a&lt;/strong&gt; is being checked for strict equality against each case. case 3 would fail because 2 + 2 isn't equal to 4. &lt;/li&gt;
&lt;li&gt;The switch statement will continue on until it hits a case that matches. Then it will execute the corresponding code until it hits a &lt;strong&gt;break&lt;/strong&gt; or until the end of the switch.&lt;/li&gt;
&lt;li&gt;If zero cases match, then the default code is executed instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This feels comfortable, &lt;em&gt;right?&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.kym-cdn.com%2Fphotos%2Fimages%2Fnewsfeed%2F000%2F823%2F128%2F22e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.kym-cdn.com%2Fphotos%2Fimages%2Fnewsfeed%2F000%2F823%2F128%2F22e.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But did you know you could use objects?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let thing = {
    "abc": () =&amp;gt; "meow",
    "chonk": () =&amp;gt; "very angry",
    "littlecat": (how_many) =&amp;gt; {
        if(how_many &amp;gt; 5) { return "MEGAMEOW" }
        else { return `${how_many}x meow/scream` }
    },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an object.&lt;/p&gt;

&lt;p&gt;This object is the same as this &lt;em&gt;switch&lt;/em&gt; statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;switch("littlecat") {
    case "abc": () =&amp;gt; "meow"
    break;

    case "chonk": () =&amp;gt; "very angry"
    break;

    case "littlecat": (how_many) =&amp;gt; {
        if(how_many &amp;gt; 5) { return "MEGAMEOW" }
        else { return `${how_many}x meow/scream` }
    }
    break;
}()

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

&lt;/div&gt;



&lt;p&gt;You can call one of the fields of this object like so. &lt;br&gt;
&lt;code&gt;thing.chonk()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Another way you can access it is by:&lt;br&gt;
&lt;code&gt;thing["chonk"]()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Calling &lt;code&gt;thing["littlecat"](6)&lt;/code&gt; will return you &lt;em&gt;"MEGAMEOW"&lt;/em&gt;. If you change the input to 3, it will return &lt;code&gt;"3x meow/scream"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is how you can use an object like a switch statement!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>What's the difference between Props and State?</title>
      <dc:creator>Miqotes</dc:creator>
      <pubDate>Fri, 20 Nov 2020 00:23:56 +0000</pubDate>
      <link>https://dev.to/miqotes/what-s-the-difference-between-props-and-state-1578</link>
      <guid>https://dev.to/miqotes/what-s-the-difference-between-props-and-state-1578</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I5yjvcPX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/472zl2byv5d36jdpers8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I5yjvcPX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/472zl2byv5d36jdpers8.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Props and State within React can get kinda Funky upon first inspection. When I first started with react I was incredibly confused. I would attempt to use state where &lt;code&gt;this.props&lt;/code&gt; should have gone and vice versa. &lt;/p&gt;

&lt;p&gt;It wasn't until I was thrown into doing a project on my own that I finally got it down and realized the key differences between the two (aside from the obvious setup).&lt;/p&gt;
&lt;h2&gt;
  
  
  Props
&lt;/h2&gt;

&lt;p&gt;Props and State are related. The state of one component can become the props of another child component. Props are passed through the render method of the parent. &lt;/p&gt;

&lt;p&gt;For example, lets use &lt;strong&gt;JSX&lt;/strong&gt;. &lt;code&gt;&amp;lt;MyChild name={this.state.childsName} /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The parent's state value of the &lt;code&gt;childsName&lt;/code&gt; becomes the child's &lt;code&gt;this.props.name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To simplify it a little more. Imagine there are you and a friend in a straight line. Your friend is tossed a few balls. The ball your friend is holding is blue. The other balls are on the ground. The current state of this ball is blue. In order for the ball to be passed down to you, you need its props (properties). Think of the color of the ball as its prop. In order for you to get the blue ball prop and not a red, yellow, or green ball, your friend (parent component) has to pass the ball down to you(child component).  &lt;/p&gt;

&lt;p&gt;Now coming back to our code, in order to access that state value in the child component. You're going to want to use &lt;code&gt;this.props.name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To me, this is React magic. There is a lot going on underneath that I am not capable of clarifying at this time but walk away knowing that in order to pass state to other components, it needs to be through props.&lt;/p&gt;

&lt;p&gt;Now, is it possible to change your props? Yes and no. &lt;/p&gt;

&lt;p&gt;Props are immutable. They do not change. During a component's life cycle, props should not change. If you're working with a component that does not incorporate state, then you can refer to that component as "pure." It will always render the same output given the same input.&lt;/p&gt;

&lt;p&gt;Now is &lt;strong&gt;state&lt;/strong&gt; always necessary?&lt;/p&gt;

&lt;p&gt;Nope! If you don't have data that needs to be changed over time, then a pure (stateless) component is fine to use.&lt;/p&gt;
&lt;h2&gt;
  
  
  State
&lt;/h2&gt;

&lt;p&gt;Now we will move onto state. State has a  few key differences.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;State is created in the component.&lt;/li&gt;
&lt;li&gt;State can be changed!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A question I had, in the beginning, was &lt;em&gt;" when should I use state?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When a component needs to keep track of information between renderings the component itself can create, update, and use state.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;State&lt;/em&gt; contains "private" information. Its set in the parent component for it to be initialized, changed and used on its own.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Props&lt;/em&gt; contain the information set within the parent component (default props can be set) and should not change.&lt;/p&gt;

&lt;p&gt;Let's say we have a counter! We set the state of that counter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;state ={
count: 0
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we want to create a method that updates the state every time you click a button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;updateCount() {
this.setState((prevState, props) =&amp;gt; {
return { count: prevState.count + 1}
});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;em&gt;prevState&lt;/em&gt; is what state was when declared. Even if you changed state somewhere else, it will reference the initial state set above (which is super &lt;em&gt;magicalllllll&lt;/em&gt;).  &lt;/p&gt;

&lt;p&gt;Counts prevState of zero is being updated by one, every time you click the button. On top of this, setState triggers a call to render()!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;render() {
  return (&amp;lt;button onClick={() =&amp;gt; this.updateCount()} &amp;gt;
            Clicked {this.state.count} times
         &amp;lt;/button&amp;gt;);
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will update in real-time without the need for a page refresh.&lt;/p&gt;

&lt;p&gt;Hopefully, this is helpful! &lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>5 starter friendly CSS libraries</title>
      <dc:creator>Miqotes</dc:creator>
      <pubDate>Thu, 19 Nov 2020 22:14:01 +0000</pubDate>
      <link>https://dev.to/miqotes/5-starter-friendly-css-libraries-53n6</link>
      <guid>https://dev.to/miqotes/5-starter-friendly-css-libraries-53n6</guid>
      <description>&lt;p&gt;Recently I had a project alongside my teammates where we ran into some issues and were able to finish it within the 2 last days of the 5 we had. &lt;/p&gt;

&lt;p&gt;For a moment we thought we wouldn't have enough time to implement any decent CSS and so we would have been left with a page that looked like it came from the early 2000s. &lt;/p&gt;

&lt;p&gt;Fortunately, with a little &lt;em&gt;google fuu&lt;/em&gt; we came upon some wonderful libraries that were quick and easy to implement within our code. &lt;/p&gt;

&lt;p&gt;Here are some example libraries that while we did not implement all of them, were amongst our choices. &lt;/p&gt;

&lt;h2&gt;
  
  
  Bulma CSS
&lt;/h2&gt;

&lt;p&gt;One of Bulma's greatest features is its simple readable classes. The system for creating tiles is quick to be implemented and the code its self takes little time to understand. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://bulma.io/"&gt;Click here to be taken to Bulma's website.&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/jgthms/bulma"&gt;Link to Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pure.CSS
&lt;/h2&gt;

&lt;p&gt;Pure has small responsive CSS modules for whatever you could need. Layout and styling for your HTML elements are available. Its style is also minimal and has a very clean design. It is another perfect option for beginners. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://purecss.io/"&gt;Click here to be taken to Pure.CSS's website.&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/pure-css/pure/"&gt;Link to Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Animate.CSS
&lt;/h2&gt;

&lt;p&gt;This is one of my favorites. It's simple and fast to incorporate within your HTML (or Javascript). &lt;/p&gt;

&lt;p&gt;If you desire quick flashy fun on your webpage, Animate.CSS is perfect. Just remember to not overdo it(even though it may be fun). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://animate.style/"&gt;Click here to be taken to Animate.CSS's website&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/animate-css/animate.css"&gt;Link to Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;Tailwind has customizable building blocks. You won't have to worry about fighting set styles to override them. Instead of having predefined components, it gives you CSS helper classes to work. These classes allow you to create custom designs and in the end, you will have a much more personally designed website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/"&gt;Click here to be taken to Tailwind CSS's website&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/tailwindlabs/tailwindcss"&gt;Link to Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Semantic UI
&lt;/h2&gt;

&lt;p&gt;Semantic UI uses five descriptive categories for their re-usable UI components. &lt;/p&gt;

&lt;p&gt;They are : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UI Element&lt;/li&gt;
&lt;li&gt;UI Collection&lt;/li&gt;
&lt;li&gt;UI View&lt;/li&gt;
&lt;li&gt;UI Module&lt;/li&gt;
&lt;li&gt;UI Behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Almost every component has types, states and variations. A button can vary in size and color and can be formatted as a basic, social, fluid, toggle, and more. This gives you a great amount of flexibility in a component’s appearance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://semantic-ui.com/"&gt;Click here to be taken to Semantic UI's website&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/semantic-org/semantic-ui"&gt;Link to Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Lets talk about Dynamic Programming</title>
      <dc:creator>Miqotes</dc:creator>
      <pubDate>Tue, 13 Oct 2020 06:08:24 +0000</pubDate>
      <link>https://dev.to/miqotes/lets-talk-about-dynamic-programming-4i7g</link>
      <guid>https://dev.to/miqotes/lets-talk-about-dynamic-programming-4i7g</guid>
      <description>&lt;p&gt;Last week, while working through labs, I had a question for my partner. I was confused about what Dynamic Programming is. &lt;/p&gt;

&lt;p&gt;I kept hearing the term while watching others work on algorithm challenges during our meetups. &lt;/p&gt;

&lt;p&gt;I thought I had understood it before, but realized I didn't exactly.&lt;/p&gt;

&lt;p&gt;This led to a long tangent on the history of the term Dynamic Programming and of course what it is.&lt;/p&gt;




&lt;h3&gt;
  
  
  Eye of the hurricane
&lt;/h3&gt;

&lt;p&gt;Richard Ernest Bellman was an applied mathematician, who introduced dynamic programming in 1953. Bellman died on March 19th, 1984, but he left behind a wonderful autobiography that has a pretty funny excerpt pertaining to where the term Dynamic Programming came from.&lt;/p&gt;

&lt;p&gt;Before I learned about this, my partner taught me that the 1950s were hostile to programming and research. Our government didn't view it as something worth investing in nor paying attention to. Bellman knew this and figured his way around this problem. &lt;/p&gt;

&lt;p&gt;Here is an excerpt from &lt;em&gt;Eye of the Hurricane&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I spent the Fall quarter (of 1950) at RAND. My first task&lt;br&gt;
was to find a name for multistage decision processes.&lt;br&gt;
“An interesting question is, ‘Where did the name,&lt;br&gt;
dynamic programming, come from?’ The 1950s were not&lt;br&gt;
good years for mathematical research. We had a very interesting gentleman in Washington named Wilson. He was&lt;br&gt;
Secretary of Defense, and he actually had a pathological&lt;br&gt;
fear and hatred of the word, research. I’m not using the&lt;br&gt;
term lightly; I’m using it precisely. His face would suffuse,&lt;br&gt;
he would turn red, and he would get violent if people used&lt;br&gt;
the term, research, in his presence. You can imagine how he&lt;br&gt;
felt, then, about the term, mathematical. The RAND Corporation was employed by the Air Force, and the Air Force&lt;br&gt;
had Wilson as its boss, essentially. Hence, I felt I had to do&lt;br&gt;
something to shield Wilson and the Air Force from the fact&lt;br&gt;
that I was really doing mathematics inside the RAND Corporation. What title, what name, could I choose? In the first&lt;br&gt;
place I was interested in planning, in decision making, in&lt;br&gt;
thinking. But planning, is not a good word for various reasons. I decided therefore to use the word, ‘programming.’&lt;br&gt;
I wanted to get across the idea that this was dynamic, this&lt;br&gt;
was multistage, this was time-varying—I thought, let’s kill&lt;br&gt;
two birds with one stone. Let’s take a word that has an&lt;br&gt;
absolutely precise meaning, namely dynamic, in the classical physical sense. It also has a very interesting property&lt;br&gt;
as an adjective, and that is it’s impossible to use the word,&lt;br&gt;
dynamic, in a pejorative sense. Try thinking of some combination that will possibly give it a pejorative meaning.&lt;br&gt;
It’s impossible. Thus, I thought dynamic programming was&lt;br&gt;
a good name. It was something not even a Congressman&lt;br&gt;
could object to. So I used it as an umbrella for my activities” (p. 159)&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;He was correct that even a congressman couldn't reject this name.&lt;/p&gt;

&lt;p&gt;I was under the impression that Dynamic Programming was something much more than it was. I was shown a simple to understand diagram and realized it wasn't something to be apprehensive of.&lt;/p&gt;

&lt;p&gt;My understanding is you break down a problem into simpler, smaller problems. You store the solution to each sub-problem so that they are each only solved once. &lt;/p&gt;

&lt;p&gt;The act of storing solutions to our sub-problems in dynamic programming is known as a technique called memoization.&lt;/p&gt;

&lt;p&gt;For a better understanding of how to break a problem into sub-problems and go on to solve them, &lt;a href="https://www.freecodecamp.org/news/demystifying-dynamic-programming-3efafb8d4296/#:~:text=Dynamic%20Programming%20Defined,example%20of%20a%20sub%2Dproblem."&gt;click here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Why SQLite is simple to use!</title>
      <dc:creator>Miqotes</dc:creator>
      <pubDate>Thu, 13 Aug 2020 04:24:20 +0000</pubDate>
      <link>https://dev.to/miqotes/why-sqlite-is-fun-to-use-3ikf</link>
      <guid>https://dev.to/miqotes/why-sqlite-is-fun-to-use-3ikf</guid>
      <description>&lt;p&gt;Coding can be frustrating. There are some parts that will come easily to you. You'll catch on fast and maybe even question if it was really that simple. &lt;strong&gt;SQLite&lt;/strong&gt; may at first seem complicated upon your first glance, but it is truly a simple tool you can learn to read and &lt;strong&gt;&lt;a href="https://mystery.knightlab.com/"&gt;play with&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

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

&lt;p&gt;SQLite (Structured Query Language) is a relational database management system (RDBMS). &lt;br&gt;
Relational database management systems allow us to store records of information we desire and want to connect. The information we want to store is recorded within large tables. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--juXh8LB2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dd6fwk650pg5f3f48aea.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--juXh8LB2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dd6fwk650pg5f3f48aea.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Storing your data within SQLite gives you a large number of options to choose from to manage your data in the way you want. Database engines process query commands (sometimes very complex) that can take in data from many tables to generate, for example, reports and or data summaries.&lt;/p&gt;

&lt;p&gt;SQLite's name comes from the fact that it is simpler to use and easy to read for new developers and or someone who just loves tables.  &lt;/p&gt;
&lt;h2&gt;
  
  
  Using SQLite within the terminal
&lt;/h2&gt;

&lt;p&gt;You can create tables, access the data within, modify data, along with dropping tables right from your terminal. You can even view your desired table as well. &lt;/p&gt;

&lt;p&gt;If you want to create an SQLite database file, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sqlite3 new_sqlite.db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now you're within the SQLite prompt. Next, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create table new_table(id);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This will create a table called new_table. &lt;/p&gt;

&lt;p&gt;To check if your table was created, type: &lt;br&gt;
&lt;code&gt;.tables&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To exit simply type: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;.quit&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  SQLite Query Commands ex.
&lt;/h3&gt;

&lt;p&gt;Let us go over some SQL statements first!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SELECT - returns desired data from a database
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;"SELECT name, age FROM people WHERE gender = 'F' "&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;INSERT INTO - inserts new data into the table
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;INSERT INTO people (name, age, gender) VALUES ('sam', 28, 'F');&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DROP TABLE - deletes the table
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;DROP TABLE people;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CREATE TABLE - creates a new table
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE cats (&lt;br&gt;
 FurColor string,&lt;br&gt;
    Loud boolean,&lt;br&gt;
    ToeBeans integer&lt;br&gt;
)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ALTER TABLE - changes table columns, add, drop, or modify&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1 . Add column&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER TABLE cats
ADD Fluffy boolean;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;2 . Drop column&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER TABLE cats
DROP COLUMN Fluffy;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;3 . Modify column&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER TABLE cats
ALTER COLUMN Fluffy string;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;These statements are very straightforward and quick to pick up. There are many more statements to use. You can find more &lt;strong&gt;&lt;a href="https://www.codecademy.com/articles/sql-commands"&gt;here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  SQLite Functions ex.
&lt;/h4&gt;

&lt;p&gt;These functions return a value calculated from columns&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AVG()
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT AVG(column_name) FROM table_name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;COUNT()
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT COUNT(column_name) FROM table_name;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;FIRST()
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT FIRST(column_name) FROM table_name;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There are so many more. You can find them &lt;strong&gt;&lt;a href="http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/sql/sql_functions.asp.html"&gt;here&lt;/a&gt;&lt;/strong&gt; with many examples.&lt;/p&gt;

&lt;h4&gt;
  
  
  DB Browser
&lt;/h4&gt;

&lt;p&gt;The &lt;em&gt;DB Browser&lt;/em&gt; tool enables you to view your tables, check the data seeded, and update data. There are many more options available as well to engage with your data and tables. &lt;/p&gt;

&lt;p&gt;This is also a better visual depiction of your tables than what you will see within your terminal.  &lt;/p&gt;

&lt;p&gt;Download DB Browser &lt;strong&gt;&lt;a href="https://sqlitebrowser.org/dl/"&gt;here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  End
&lt;/h4&gt;

&lt;p&gt;SQLite has a multitude of uses. You'll find it within Active Record, Ruby on Rails, and amongst other use cases. It is a wonderful tool to learn. &lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>sql</category>
      <category>activerecord</category>
    </item>
  </channel>
</rss>
