SQL has become a common skill requirement across industries and job profiles over the last decade.
Companies like Amazon and Google will often demand that their data analysts, data scientists, and product managers are at least be familiar with SQL. This is because SQL remains the language of data.
This has lead to SQL being a staple part of many data professionals interview loops. Meaning you better plan to include SQL in your study sessions. That being said, just walking through SQL problems doesn't always cut.
In this article I will go over three tips to help you improve your SQL both for interviews and in general.
Attempt To Solve A SQL Problem In Multiple Ways
There is more than one way to solve most SQL problems.
But often we resort to the methods we have most recently used.
For example, if you just learned about analytical functions it can pigeonhole a lot of your future solutions. This is why it is important to try to solve SQL problems in multiple ways.
In order to do all of our problems I will be using problem sets from InterviewQuery which is a site that can be used by data scientists to practice much more than SQL.
But for now let's look at a simple problem they offer.
We're given two tables, a
users
table with demographic information and the neighborhood they live in and aneighborhoods
table.Write a query that returns all neighborhoods that have 0 users.
The tables we have are listed below.
Here we have two input tables and an expected output. Before reading further do you have any thoughts on how to get neighborhood names that have 0 users?
What is your first answer?
Regardless, let's look at this first example of a possible solution.
Keep reading with a 7-day free trial
Subscribe to SeattleDataGuy’s Newsletter to keep reading this post and get 7 days of free access to the full post archives.