Why do we have 27 rows? Let’s investigate. Now that those definitions are out of the way let’s start by figuring how many rows are in this table: SELECT COUNT(*) FROM SF5Characters - 27 Command_Grab: Does the character have a special grab besides universal?.Projectile: Does a character have a “fireball” type move.Origin: What Street Fighter game did a character debut in.Stun: How damage a character can take before they are “stunned” or immobilized.Health: How much damage a character can take.
The four most common statements are:Īlso for the those not familiar with SF5 here’s what some of the columns mean. Queries are made up of statements (the upper case words) that structure how you want the data returned. We can finally start playing SQL now! Hooray! Most SQL queries look something like this: SELECT column_name FROM table_name WHERE column_name = "Frank" filter(dataframe, column_name = "Frank") #dplyr equivalent in RĪll queries end in semicolons. Working With Data: SQL Statements & Queries Finally the next 2 lines are just so the output of our SQL statements will be clean. The next two lines are to let SQLite know that a CSV file will be coming and the actually importing of the file. Each column name is separated by a comma and the statement ends with a semicolon. The lines following are the names of the columns, the datatype the column will be accepting, and Not Null meaning it will not accept blank fields. It holds a specific set of data for us to view manipulate etc. A table is pretty much the same thing as a data frame in R. In the create table statement I created a table. import C:/sqlite/SF5Characters.csv SF5Characters sqlite>. First create a table sqlite> create table SF5Characters( Name Text Not Null, Health Int Not Null, Stun Int Not Null, Origin Text Not Null, Projectile Text Not Null, Command_Grab Text Not Null) sqlite>. Like with R, I can upload this file into a database in order to start working with it. Like I mentioned earlier, I created a CSV file of data related to characters in SF5. Simple non? But alas our database is empty. The second line is just to make sure that the file has been created. The first line tells SQLite I want to make a permanent database in a specific location called testDB. databases seq name file - 0 main C:\sqlite\testDB.dbĪnd done. Creating a new Database Note, statements go after sqlite> sqlite>. The first thing we’ll do is create a database. As to show you how it works, I’ll be creating a database in SQLite with data I created related the video game, Street Fighter 5. SQL is the language that talks to relational databases in order to store, update, change, and delete data. In this article I’ll be using the RDMS SQLite.
#Basic data analysis software#
In short, software that allows us to create and manage databases. These are called relational database management systems. You may have seen things like Oracle, MySQL, PostgreSQL, etc when looking up databases or a tech blog. Databases are useful for pretty much every kind of company and institution and come in many varieties. This can be anything from financial data, students in a university, players in an online video game etc. A database is an organized collection of data. Databases: What are they?īefore we start pulling all the fancy data with a new toy, let’s understand what a database is. With a tiny bit of effort using SQL can be pretty fun and simple. As usual, I want to give you an easy to understand 101 of both SQL and databases. Today we’ll be looking at SQL, a language that’s very important to learn when you’re working with databases.