Back to articles list Articles Cookbook
9 minutes read

5 SQL Lessons to Learn Before the Year Ends

Many SQL learners get stuck between beginner and intermediate — queries work, but not always as expected. These five lessons fix the gaps most learners still have and will strengthen your SQL before the year ends.

As the year winds down, many learners start reflecting on what they’ve achieved — and what’s still on their to-learn list. If you’ve been studying SQL for a while, you’ve probably already written a few queries, joined some tables, and filtered results. But if you’re honest, there are still a few things that feel uncomfortable.

That’s normal. Every SQL learner hits this stage — somewhere between beginner and intermediate — where you can write queries that work, but you don’t always understand why they work. You can get an answer, but not always the right one.

Over the years, I’ve noticed that most learners tend to lack the same five skills. They’re not advanced topics, but they are the ones that make you confident, flexible, and ready for real-world data work. So before the year ends, here are five SQL lessons worth mastering.

1. Finally Learn LEFT JOIN and FULL JOIN

Beginners usually learn INNER JOIN just fine — but LEFT JOIN and FULL JOIN often remain a mystery. Many learners avoid them because they don’t understand how they work and, most importantly, don’t recognize when they are actually needed.

Yet in real databases, data is rarely complete. Customers don’t always have orders. Products don’t always have reviews. That’s why these joins matter — they let you analyze complete data, not just perfect data.

In real life, you should understand how LEFT JOIN and FULL JOIN work and when to use each:

  • LEFT JOIN returns all rows from the left (first) table, even if there are no matches in the other table.
  • FULL JOIN returns all rows from both tables, even if there are no matches on either side.

Example:

SELECT 
  c.customer_id, 
  c.name, 
  o.order_id
FROM customers c
LEFT JOIN orders o 
ON c.customer_id = o.customer_id;

This query lists all customers, including those who haven’t placed any orders — something an INNER JOIN would miss.

It’s time to bite the bullet and finally learn these joins. Once you do, your analyses will become far more accurate and complete.

Where to learn it:

Our SQL JOINs course gives you extensive hands-on practice with every type of join — over 90 guided and unguided exercises focused entirely on mastering joins. You’ll learn to recognize which join to use in each scenario and gain the confidence to handle complex queries without guessing. If you’re going to level up one concept this month, make it this one.

2. HAVING: Stop Mixing It Up with WHERE

Another so-called “intermediate” concept is HAVING. I put that in quotes because any SQL professional would laugh if you called it advanced — but for many beginners, it’s one of the trickier ideas to master.

HAVING is used to filter groups, not individual rows. It helps you work with aggregate conditions like counts, sums, or maximum values — the kind of logic you’ll use in almost every analytical query.

Understanding when to use WHERE and when to use HAVING is crucial for serious analysis:

  • Use WHERE to filter rows before
  • Use HAVING to filter groups after

Learning HAVING also gives you a deeper understanding of how databases process queries internally — and that knowledge is invaluable when optimizing or debugging your own code.

Example:

SELECT product_id, COUNT(*) AS total_orders
FROM sales
GROUP BY product_id
HAVING COUNT(*) > 100;

This query finds products with more than 100 sales — something WHERE can’t handle, because the groups don’t exist until after grouping.

Where to learn it:
Our SQL GROUP BY Practice course gives you dozens of exercises focused on grouping, aggregation, and HAVING. It’s the fastest way to stop guessing when to use each clause and start writing correct analytical queries with confidence.

3. How Comparisons with NULL Really Work

This one looks simple — until your results don’t make sense. These errors won’t break your query, but they’ll quietly give you wrong answers — and that’s even worse.

The simplest example: you write WHERE email = NULL and get no results.  A sneakier one: WHERE age > 18 — this will exclude customers whose age is not set.

That’s because NULL doesn’t behave like other values. It represents “unknown,” and comparing anything to “unknown” never returns TRUE. SQL uses three-valued logic: TRUE, FALSE, and UNKNOWN. Understanding how SQL handles NULL saves you from silent logic errors. = NULL always evaluates to UNKNOWN, so it filters nothing. That’s why you must use IS NULL or IS NOT NULL.

To find users without an email address, write:

WHERE email IS NULL

To find users who do have an email, write:

WHERE email IS NOT NULL

It’s a small change, but understanding it means you now grasp one of SQL’s most fundamental rules — something many developers never stop to think about.

To dive deeper into how NULL works and why comparisons can be tricky, read our article NULL Comparison Operators in SQL.

Where to learn it:

Our Standard SQL Functions course includes a dedicated module on NULL. You’ll learn how to avoid common mistakes with missing values and how to use functions such as COALESCE, IFNULL, and NULLIF to handle them properly. This course will help you understand how NULL behaves in expressions and aggregates, so your queries always return accurate results.

4. Correlated Subqueries

Some beginners love subqueries and try to do everything with them. Others are afraid of them and avoid them completely. But one thing is almost universal — both beginners and many intermediate users fear correlated subqueries.

Correlated subqueries are subqueries that reference the outer query and can’t run on their own. They depend on the current row of the outer query, which makes them both more complex and more powerful.

That’s what gives them their strength: you can solve problems that would otherwise need multiple steps or temporary tables. On the other hand, using them correctly requires understanding how a database processes a query — step by step.

Example:

SELECT name, department_id, salary
FROM employees e
WHERE salary > (
  SELECT AVG(salary)
  FROM employees
  WHERE department_id = e.department_id
);

This query finds employees who earn more than the average salary in their department — a common real-world task that’s hard to express without a correlated subquery.

It’s worth learning, even if it feels intimidating at first. Once you understand how correlated subqueries work, you’ll see that they open the door to a whole new level of SQL problem-solving.

Where to learn it:

Our SQL Subqueries course helps you go from “I kind of understand subqueries” to confidently writing both simple and correlated ones. It offers extensive hands-on practice and immediate feedback, so you’ll learn when and how to use each type while seeing how SQL processes them step by step. Once you master this concept, a big part of SQL suddenly clicks.

5. How to Explore a Database

This is one of the skills that separates beginners from intermediate and advanced SQL users. Beginners can write queries when they already know the structure of a database — but when faced with an unfamiliar one, they often don’t know where to start. You won’t always get a diagram or documentation that explains how everything connects.

Most SQL courses skip this part completely, yet it’s essential for real-world work. Knowing how to explore a database on your own gives you independence and confidence. You’ll be able to find the right data, understand relationships between tables, and plan your queries without waiting for someone to explain the structure.

Here’s what database exploration looks like in practice:

  • Identify what tables and columns exist – start by learning the overall structure of the database.
  • Find the right tables and columns – locate where the data relevant to your analysis is stored.
  • Inspect a few sample rows – run
    SELECT * FROM customers LIMIT 5;
    to see what the data looks like.
  • Check row counts – understand how large each table is.
  • Look at minimum and maximum values – get a sense of data ranges (e.g., earliest and latest dates).
  • Review value distribution – spot duplicates, missing values, or outliers.
    Sketch your own diagram – map relationships between tables to visualize how the database fits together.

If you want a practical walkthrough of this process, read How to Explore a Database: The Northwind Project, which shows each step in detail using a real dataset.

Where to learn it:

Our SQL Databases for Practice course lets you explore real-world databases safely. It’s not a course with exercises — it’s a sandbox of sample databases for you to play with. You’ll explore the structure on your own, come up with your own questions, and find the answers yourself.

If database exploration feels intimidating, this course will remove that fear completely.

Afraid to get started? Check out our guided courses in the SQL Practice Track. They include typical exercises across many databases. Once you feel more confident, return to the SQL Databases for Practice course and explore freely.

Wrapping Up the Year: Why These Five Lessons Matter

These lessons aren’t “nice to have.” They’re the core concepts that transform you from a beginner who can follow instructions into an analyst who can solve problems independently.

Think about what mastering them gives you:

  • You can combine data from multiple sources without breaking queries.
  • You can analyze grouped data correctly.
  • You can handle missing values without silent errors.
  • You can use subqueries to answer complex questions elegantly.
  • You can explore new databases with confidence.

These are the skills that make you useful in any data-driven team.

How to use this list:

Don’t rush to learn all five at once. Pick one concept, spend a few focused days on it, and practice until it feels natural. Then move on. If you start now, you can comfortably master all five before the year ends.

By December 31, you’ll not only understand SQL better — you’ll use it the way professionals do.

Finish Strong

You don’t need a New Year’s resolution to improve your skills. These five lessons are the small, high-impact wins that most learners skip — and that’s exactly why mastering them now gives you an edge.

If you want access to every course mentioned here, check out our All Forever SQL Package. It includes all current and future LearnSQL.com courses in one single purchase — no subscription, no expiration. It’s the best long-term value for anyone serious about mastering SQL.

Choose one lesson, start today at LearnSQL.com, and end the year knowing you’ve finally filled the gaps holding you back. Your future queries (and your future self) will thank you.