SQL is the most underappreciated and overlooked coding language.
It’s maybe not the sexiest language, but SQL is one of the most powerful languages for what it provides to us.
In college, my undergraduate degree was mainly focused on learning databases and therefore, a lot of SQL and database design. At the time, I thought it was dumb that I was learning how to query data, combine & filter tables, and do things I thought I could do in Excel.
Boy was I wrong.
Data is the new currency of the digital age, and whoever can access and make sense of all of this data will be the winner. There’s so much data that is being stored and collected each day. It’s estimated by some people that Google has around 10 exabytes of data in their databases, which is 10 BILLION GIGABYTES! That’s a lot of data.
SQL is one of, if not, the most powerful tools in harnessing the power of data so you can see why it is an important language to learn. I work with backend engineers, data engineers, data scientists, and frontend engineers, and the one language that merges us all is SQL.
In today’s article, I’ll break down how you should go about learning SQL. This will cover starting at zero and then getting to advanced topics so there will be something for everyone, so be sure to save this email so you can track your progress and what you should be working on!
Part 1: Learning what a database is
As part of learning SQL, you’ve got to learn how a database works. Databases can seem scary and daunting, but once you understand the structure of how it all works, you’ll see it for the incredible piece of technology that it is.
For this section, you’ll want to focus on some basic things:
Database & table design
Creating tables
Primary & foreign keys
Cardinality
Inserting data
Updating & upserting data
Deleting data
Different versions of databases (Postgres, MySQL, Oracle, etc)
Normalization
Most of this will all combine together as you start learning about each part, but understanding how a database and all of its tables, schemas, and structures play together is important in truly being able to go from beginner to advanced with SQL.
learning resources:
time to learn: 1 month
Part 2: Basic SQL
Now that we’ve got some database design down and you understand what a database is, you’ll get into actually using SQL to query that data from the database.
Don’t worry about trying to make your queries perfect or having super-fast queries but learn the simple syntax that SQL is.
A basic SQL query looks like this:
SELECT *
FROM CUSTOMERS;
In just two lines of SQL code, I grabbed all of the data from a theoretical “customers” table.
I like to say that SQL is easy to learn but difficult to master. As we can see that piece of code was super easy to understand and knowing these basics will set you up for success.
During this section you’ll learn the following:
Order of operations
Basic queries
Filtering for columns
Filtering for rows
Joins
Ordering
Grouping
learning resources:
time to learn: 1 → 3 months
Part 3: Advanced SQL
Once you get a grasp of basic SQL, you’ll want to learn how you can make those queries more performant.
Knowing advanced SQL is what separates the top dogs from the pups. Especially in the data engineering & analytics world. Everyone relies on querying data from databases, so if you can reduce the speed of a query by 10%, or cut database memory load by 20% by using advanced SQL knowledge, you’ll quickly become a valuable asset to any company or business.
I work with someone who has become our database go-to. He is able to optimize queries, solve complex problems, and make our database a lot better. He’s truly become an invaluable asset to our company because of his advanced SQL knowledge.
For advanced SQL you’ll learn:
Subqueries
Window functions
CTE’s
Explains
Stored procedures
Get a grasp on these and you’ll be able to set yourself apart.
learning resources:
time to learn: 3 → 6 months
Part 4: Advanced databases
Ok, so you’re now a master at SQL right? As you continue to practice you’ll need to start becoming familiar with more advanced database practices.
These aren’t the same in every database, so learning how to implement each one in each different database structure will help a ton and make you more adaptable.
In this part you’ll learn about these topics:
Pipeline ingestion
Information schemas
Indexing & sharding
Security
NoSQL
learning resources:
time to learn: 2 → 4 months
Extra tips:
Use ChatGPT
ChatGPT will help you speed up your learning ability & time at least 2x. Whether it is understanding key concepts or helping craft queries, ChatGPT should be with you at every step.
Don’t skip learning about database structures
Skipping part 1 can seem tempting. Don’t do it. Understanding how databases are structured and important concepts will set a great base for learning SQL.
With all of that, you are looking at probably at least a year of dedicated work to really get good at SQL and databases. I can vouge through experience that it is definitely worth it so I hope this article helped guide you with a path of being able to learn SQL!
McKay’s Bookmarks :)
I like to share a couple of things I found interesting or books I’m currently reading
I’m currently reading the Red Rising series which has been so good. Made me fall in love with reading again.
Rushing your town hall in Clash of Clans is for the strong-minded people out there
Real Sociedad are going to beat PSG in the Champions League