Back to articles list Articles Cookbook
7 minutes read

Why Learn SQL as a Software Developer

As a software developer, you may have been in situations in which you had to work with SQL. You may wonder if having a superficial knowledge of SQL is enough for the role or if you should really delve into it. Short answer: you should! I will explain why software developers should learn SQL in this article.

I have been a software developer for 15 years, and I’ve noticed a progressive change in the role. Years ago, a software developer needed to know the programming language they were working with and some libraries or frameworks. Nowadays, the reality is more complex and many software developers are learning SQL in depth. Let’s see why.

SQL’s Importance in Software Development Roles

Software developers often think that they don’t need to invest time in learning SQL and that only knowing the basics is enough. But in my opinion this is an outdated idea. The scope of software development has changed.

Let’s say you are officially a Python developer. Of course, you need to know the Python language and the libraries and frameworks related to your particular area of development. You also need to understand multiple related fields orbiting around software development: IoT, Cloud, DevOps, and data/databases (among others).

Of this list, don’t underestimate the importance of data and databases. Every software developer interview I’ve done in the last ten years has ALWAYS asked questions about SQL. In the last few years, I have also led many Python tech interviews – and I must confess that I have a dedicated plot for questions about databases and more especially SQL.

Do you feel ready for your next technical interview? If not, Marek Pankowski will help you! Check out his article Common SQL Job Interview Questions. If you need to learn SQL first, I recommend our SQL from A to Z track. Its seven courses and hundreds of coding challenges will get you well on your way in your SQL journey!

It’s Worth Learning SQL as a Developer!

In this section, I will explain why, in my opinion, it is worth learning SQL as a Developer.

SQL Is Everywhere!

First of all, SQL is behind most data technologies. No matter the domain you work with, you’ll likely use at least one SQL technology.

Relational databases are an old technology, but they’re more relevant than ever! E-commerce sites, social networks, news websites, and even your banking app use SQL.

Although new database technologies have appeared in the last years, relational databases and SQL remain the principal technology for databases. According to the 2024 Stack Overflow Developer Survey, professional developers are massively using relational databases: indeed, the 4 most used databases are relational databases (PostgreSQL, MySQL, SQLite, and MS Server).

Why Learn SQL as a Software Developer

Stack Overflow Survey 2024

If you wonder where SQL is being used today, I recommend you check out Agnieszka Kozubek-Krycuń’s excellent article SQL Technologies Are More Common Than You Think. (Spoiler: they’re everywhere!)

Learn SQL to Understand ORMs

Next, let’s talk about Object Relational Mappers (ORMs). As a developer, you might wonder: “Why should I know SQL? ORMs can do the work!” That’s a big mistake!

Using an ORM is generally a good practice: it helps interact with the relational databases and provides an abstraction layer that generates the SQL query for you. ORMs are also great allies for security: they can protect you against a direct SQL injection attack or other SQL vulnerabilities.

However, ORMs – like all systems – have limitations. The most famous one is a performance issue. An ORM represents an additional layer between your database and your backend and has its own latency. The latency may be irrelevant for small queries, but it can become a huge issue for big queries. In this case, you have two alternatives: restructure the query to be more efficient or write the SQL query by hand. In both scenarios, you need a deep understanding of SQL.

SQL Is Essential for Data Analysis

SQL is the language of data analysis. Product Managers have asked me (a developer, not a data analyst) many times to prepare reports, including charts and data analytics dashboards. As a developer, you may think “Hey, this is not my job!”, but it actually is! All the BI tools (e.g. Metabase, Looker) connect to relational databases and use SQL under the hood.

Although the visual interface of those tools allows you to extract data easily from the database, product managers, marketers, or whoever needs the data are mostly non-tech people; they have no clue how a database is structured. Furthermore, the visual interface of BI tools has limitations; you will probably have to draft raw queries using SQL. After all, SQL is a programming language and you are a developer!

Ready to dip your toes into SQL? If so, check out our awesome (and free) SQL Basics Cheat Sheet , which is a handy guide to the language’s most-used commands. It’s a great way to start to learn SQL or to refresh your memory!

Efficient Troubleshooting

Troubleshooting application performance is more common than you think; it’s even a typical question in technical interviews. Suppose the response time for a given action inside your application is abnormally high (or even times out). How could you solve it? Many actors can be involved in this issue: cross-domain, cache, endpoint throttling, server capacity, cold start, and… database.

If the problem comes from the database, you may be asked to optimise some queries – no matter if your application is using an ORM or not. In this case, having a deep knowledge of SQL is essential. Is your database missing indexes? Could you create a view for frequent queries? Could the queries be paginated? You’ll need SQL for all of these.

Making Technical Decisions

Learning SQL and relational databases in general is also very useful when it’s time to make technical decisions. As a software developer and eventually a technical leader, you can be asked to choose between different technologies before starting a new project. When it comes to databases, you need to know the different types of databases and the way they scale (and hence, the costs).

The nature of the industry where you are working is also important. Traditionally, relational databases are used when transactions (sequences of multiple operations on a database) are needed for ACID compliance. So if you are building an e-commerce or banking application, an SQL database is probably the best choice.

That said, learning SQL also gives you an idea of what can be done easily. Years ago, my team and I chose to use a NoSQL database to store our app’s user session information. This DB offered unstructured data, no transactions needed, vertical scaling. The choice seemed to be the good one until we were asked to create a data analytics dashboard for the user session data. What we could have done easily with an SQL database and simple commands took us a considerable amount of time. Essentially, we finished by reinventing the wheel.

Debugging & Automation

Knowing SQL as a developer is also very useful when debugging or creating test data. In some cases, you will have to debug your app and work directly with the database. Many times, I’ve had to query the company's production database to find an edge case and create an SQL script to fix it. Knowing commands such as SELECT, JOIN, and WHERE (to retrieve the data) and INSERT, UPDATE, and DELETE (to modify it) is essential.

SQL scripts also help you automate common database tasks. You could, for example, run a script every day to find and deactivate all the users of your database who did not renew their membership after multiple notifications.

Career Opportunities

The last reason why you should learn SQL as a developer is because it helps you with career advancement and opportunities. By learning SQL, you can better collaborate with data teams (data analysts, scientists, and engineers). Kateryna Koidan summarised this perfectly in her excellent article How Developers Can Build SQL Skills. And after a time, you might even pivot careers to working with data if you find you like it.

Learn SQL Today!

In this article, we’ve seen why it is worth learning SQL as a software developer. You will probably need it during your daily work, and it can help you with career advancement and new opportunities.

I hope I convinced you to start your SQL journey! If so, I highly recommend you take a look at our track SQL from A to Z. It covers everything you’ll need in SQL as a developer.

Thanks for reading this article; I really hope you liked it! See you in the next one!