gitGood.dev
Back to Blog

Why You Should Learn SQL Before Any Framework

D
Daniel Casale
6 min read

Every week I see the same question in developer forums: "Should I learn React or Vue first?" or "Is Next.js better than Remix?"

Meanwhile, almost every job posting - from startups to Fortune 500s - has one thing in common buried in the requirements: "Experience with SQL."

And almost nobody is talking about it.

Frameworks come and go. SQL doesn't.

Think about the JavaScript ecosystem over the last ten years. jQuery dominated, then Angular, then React, then... whatever's next. Each one required developers to learn something new, often from scratch.

SQL was written in the 1970s. The syntax you learn today is fundamentally the same syntax that's been running the world's data for over 50 years. A SELECT statement from 1990 still works in 2026.

That's not because SQL is outdated. It's because it's that well designed.

When you invest time in SQL, you're investing in a skill with a half-life measured in decades, not months.

Every application talks to a database

Here's the thing that gets lost in the framework hype: frameworks are the presentation layer. They're the fancy wrapping paper. The actual value of most applications is the data underneath.

  • That React dashboard? It's fetching from a database.
  • That mobile app? API calls that query a database.
  • That AI chatbot everyone's excited about? Storing conversations in a database.

If you understand SQL, you understand how data flows through every application you'll ever work on. That's a superpower that transfers across languages, frameworks, companies, and decades.

What SQL actually teaches you

Learning SQL doesn't just teach you a query language. It teaches you how to think about data.

You learn to think in sets

Most programming is procedural - do this, then this, then this. SQL forces you to think differently. Instead of "loop through all users and check if they're active," you think "give me the set of users where active is true."

-- Not "loop through users and filter"
-- Think: "describe the data you want"
SELECT name, email, signup_date
FROM users
WHERE active = true
  AND signup_date > '2026-01-01'
ORDER BY signup_date DESC;

This set-based thinking makes you a better programmer in every language. Once you can describe what you want instead of how to get it, you start writing cleaner code everywhere.

You learn about data relationships

Understanding JOINs teaches you about how real-world entities relate to each other. A user has many orders. An order has many items. An item belongs to a category.

SELECT u.name, COUNT(o.id) as order_count, SUM(o.total) as lifetime_value
FROM users u
JOIN orders o ON u.id = o.user_id
WHERE o.created_at > '2025-01-01'
GROUP BY u.id, u.name
HAVING COUNT(o.id) > 5
ORDER BY lifetime_value DESC;

This isn't just a query. It's a business question: "Who are our most valuable repeat customers from the last year?" When you can translate business questions into SQL, you become incredibly valuable to any team.

You learn about performance

Why is the app slow? Nine times out of ten, it's a bad query. Learning SQL means learning about indexes, query plans, and why SELECT * from a table with ten million rows is a terrible idea.

This is the kind of knowledge that gets you promoted. The developer who can look at a slow page and say "the N+1 query on line 47 is hitting the database 200 times per page load" is worth their weight in gold.

The interview advantage

Here's a practical angle: SQL shows up in interviews constantly, especially for backend and full-stack roles.

I've seen candidates crush the algorithmic portion of an interview and then freeze when asked to write a basic JOIN. That's a rough look. A GROUP BY with a HAVING clause shouldn't be the thing that sinks your interview.

And it's not just direct SQL questions. Understanding databases makes you better at system design interviews too. When the interviewer asks "how would you design a notification system," knowing how data is stored and queried gives you a foundation that framework knowledge can't replace.

But I'm a frontend developer

Fair. You might be thinking this doesn't apply to you.

But here's the reality: the line between frontend and backend is blurring. Full-stack is increasingly the expectation, especially at startups and small companies. Server components, server actions, edge functions - the frontend is moving closer to the database, not further from it.

Even if you stay purely frontend, understanding the data layer makes you a better collaborator. When your backend colleague says "that query is going to be expensive," you'll understand why and can adjust your feature design accordingly.

Where to start

You don't need to install anything fancy. Here's a practical path:

Week 1-2: The basics

  • SELECT, WHERE, ORDER BY, LIMIT
  • INSERT, UPDATE, DELETE
  • Use an online playground like SQLite Online or db-fiddle

Week 3-4: Joins and aggregation

  • INNER JOIN, LEFT JOIN
  • GROUP BY, HAVING, COUNT, SUM, AVG
  • Build queries against a sample dataset (Chinook or Northwind are classics)

Week 5-6: Practical skills

  • Subqueries and CTEs (WITH clauses)
  • Indexes and EXPLAIN
  • Basic schema design - normalization, primary and foreign keys

Week 7+: Connect it to code

  • Write a small app that uses a real database
  • Practice writing migrations
  • Learn an ORM, but write raw SQL first so you understand what the ORM is doing

Six weeks. That's all it takes to go from zero to genuinely competent. Compare that to the months you'd spend mastering a framework that might be irrelevant in three years.

The skill that compounds

Every new framework you learn starts from zero. But SQL knowledge compounds. The more you use it, the more patterns you recognize, the faster you can answer questions with data, and the more valuable you become.

I'm not saying don't learn React. Learn whatever framework your target job requires. But learn SQL first - or at least alongside it. It's the foundation that makes everything else make more sense.

Your frameworks will change. Your databases will outlive them all.