Diving (Back) Into SQL World

Abraham Setiawan
3 min readJan 15, 2022

Two months into the Data Analyst program at Hyper (I will use this to refer to Hyper Island going forward), we started the fourth module: Data Analysis and Intro to Visualization. We had the pleasure of having Andrea Scaringello as our Industry Leader (the term used for the industry expert who comes to Hyper to lead the module), who started the module with a bang by giving a very appreciated 5-day SQL bootcamp. SQL stands for Structured Query Language and it is the standard language to query data from a database.

Photo by Caspar Camille Rubin on Unsplash

Some of you might know that I have a background in Computer Science. However, I had stopped programming right after getting my B.Sc. in 2013. Avid programmers would say that they get rusty after not coding for 2 weeks, imagine how it was for me after 8 years.

To be honest, I was overwhelmed by the complexity of coding infrastructures and thought that I would do better in the business side of tech industry. But hey, when I signed up for this program, I knew that programming comes in the package, so I took a deep breath and got ready to dive in to this world again.

In the bootcamp, Andrea came with a generated database about freelance jobs and introduced us to Google Colab (a Python notebook run in Google server). He basically taught us how to write SQL queries on Python environment. For the simplicity of this post, the snippets below are in the form of pure SQL.

He started with a super basic query:

Query output on Google Colab

And slowly getting deeper into joins, conditions, aggregating, grouping, and sorting. Here is an example:

Query output on Google Colab

I thought it would take a long time to remember all these, but it turns out that I actually could remember and do querying quite well. Maybe coding is like a language. Like a language that I used to know well but rarely practice now and forget a lot of things, but when I hear people talking in that language, it just comes back to me. It’s called programming language after all!

One concept that was new to me was Common Table Expressions (CTE). In short, CTEs are like creating a temporary table with some calculations that can be used for writing more complex queries. Here’s a query that my friend Joyce and I wrote to find the percentage of job distribution per city per role compared to national percentage (yeah, it already sounds complex) using 4 CTEs:

Query output on Google Colab
Visualizing the query output for London using Microsoft Excel

Not to my expectation, I was actually really excited to do SQL again. After doing many exercises on SQL, I regained my confidence in the programming world, at least in the SQL world.

You can find the code from this 5-day bootcamp on my GitHub and the story of my independent project for this module here.

--

--

Abraham Setiawan

Data Analyst student at Hyper Island with experience in product and innovation. I write about my journey in the data world. Website: abrahamsetiawan.com