A couple of weeks ago, a friend of a friend reached out to me that he wanted to learn more about data analytics. He said he'd been manually doing lots of analysis in Excel but he wanted to understand more. After a long conversation, we thought a good first step would be to learn SQL
Not that much more senior to him, strapped for time with some life circumstances, and trying to focus on some of my own learning goals, I knew that I did not have the bandwidth to really help guide him, but I knew that I wanted to do more than drop a link to a "really good tutorial" and run, as so many people before me had done to me.
You see, at twenty-something, I've spent most of my life in school, learning from structured curriculums with timelines. When people dropped a link to a really good tutorial, I was always grateful, of course. I mean, they took the time to respond (something we should always be grateful for) and pointed me in the right direction to learn, but that wasn't exactly my learning style. I craved, no I needed, more structure than that.
The Only Way to Learn Is By Doing
I had one particular mentor who repeatedly told me that the only way to learn really was by doing. When we talked about those online tutorial, he often talked about how he'd gather the most basic of skills and then he'd go build something thing that gave him the chance to actually use those skills.
My inexperience, though, left me frustrated. I'd start a tutorial and have top go to work or have to go make dinner or walk my dog and then the tutorial would just get pushed to the bottom of my never-ending todo list. Maybe it'd eventually get done, but more often than not, it wouldn't.
Frustrated with myself and determined to learn much more (and much more quickly), I decided to change that. I started creating my own online syllabi, such as this one I created when I decided I would work my way through Learn Python The Hard Way. I identified what I wanted to learn, what about my current set up wasn't working for my successful, and addressed that issue. Yes, the only way to learn was doing, but that didn't mean that I didn't have to put in foundational work, such as making a syllabus, before I started writing.
Having recognized this behavior in myself and wanting to set my friend of a friend up for success, I decided to take a slightly different approach to helping him learn SQL.
I explained to him that the only way to learn was by doing, and that the best thing to do was something he really wanted. When we identified that he was really into soccer, we decided we'd want to work with an open source data set on the subject. The goal was to create a local database of data that he was interested in with the goal of using SQL to build out some of his beginner analyses. Below are the steps we laid out.
STEP 1. FIND AN OPEN SOURCE DATA SET YOU'RE EXCITED BY
Given his interest in soccer, we settled for this series of data sets. It is very important to have multiple data sets and not just one tabular table of data. The goal is to practice SQL and not just use a database to do things you could do in excel.
STEP 2. DOWNLOAD POSTGRES
Postgres is a very easy to use database and spinning it up locally is very easy for a non-technical beginner. Once installed, this is the server for your database, but you can't access your database through it. You'll need another piece of software for that.
STEP 3. INSTALL POSTICO
While there are lots of tools that will let you query the database, I personally prefer Postico. Other options include SQL Workbench and DBeaver. This is the tool you will you to access the information stored inside of your data base.
STEP 4. LOAD THE DATA INTO YOUR DATABASE
Loading data into your database is a two-step process. First, you'll have to actually create the table for your data. This is the process of you telling the database what the table name will be, where the table belongs (what schema), how many columns of data there will be, and what type of data each of those will hold. The second step is the process of moving the data from where you have it (on your computer, at a link, etc) into the database. You'll be running these commands in Postico or your equivalent.
STEP 4A. CREATE TABLE
CREATE TABLE is the call that is creating the table. In order to create the table, you'll need to know data types. The most important ones to know are date, float, bigint, varchar, boolean, and timestamp.
But Emilie how am I supposed to know the data types if I haven't looked at the data?
I'm so glad you asked! When creating your first table, let everything be a varchar. Once you've gotten the data loaded (Step 4B), you'll be able to see the data to better decipher the appropriate data types. After a while, you'll get a hang of this and won't have to make test tables before loading data for the first time. You might hit some issues. If so, take a deep breath and checkout step 5.
Remember that the process of creates the table and the columns. You still have to dump the data into the table.
STEP 4B. GET THE DATA INTO YOUR NEW TABLE
You will want to use a COPY function to get the data from wherever it is into your database.
STEP 5. WHEN IN DOUBT, GOOGLE IT OUT
Having an issue? Seeing an error? Google, Stack Overflow, and technical slack communities should become your most visited websites.
Get an Accountability Partner
Learning something totally new is hard. If you're a entrepreneurial millennial, though, you're likely not the only one of your friends trying to learn something new. Find a friend who is also pushing him or herself outside of their comfort zones and become accountability partners. You can do weekly check-ins or something more frequent than that, depending on what works for each of you.
While learning can be hard, it can also be incredibly rewarding. I believe that we should always be working to learn something new each day. Whether your goal is to gain some new knowledge through a book or gain a new skill through practice, get in the habit of pushing your boundaries. I think you'll be pleased with the end result.
About our blog:
This blog (like Flock) is centered around women and non-binary technologists flying higher together.