What I wish I knew before starting sql

My first evening with SQL went into memorising keywords. It was the least useful thing I could have done, and it set the tone for a month of tutorials that made sense while I watched them and evaporated the moment I opened an empty editor. These are the things I would tell myself before day one, in the order they would have helped.

The language is the smallest part of the work

SELECT, WHERE, and JOIN are learnable in an afternoon. What takes longer is knowing which of forty tables holds the fact you need, what one row of it represents, and which identifier links it to anything else. That knowledge is the job. The syntax is only how you ask.

Before writing a query, spend ten minutes on the schema: list the tables, read their column names, and find the keys that connect them. Ten minutes of that beats an hour of guessing at column names, and it is the habit that separates people who look competent early from people who look competent eventually.

Set-based thinking is a separate skill

In a spreadsheet you reason about one row at a time; in SQL you describe a whole result at once and the engine works out the order. That is genuinely a different way of thinking, and almost nobody switches in a week. Expect to write a query that processes rows one by one in your head and then discover SQL has no loop for it.

The shift arrives through small experiences: filtering a set, grouping a set, joining two sets, and noticing you never told the database which row to handle first. Once that clicks, window functions and subqueries stop looking mysterious, because they are the same idea with more moving parts.

A perfect sample database teaches a false confidence

Tutorial datasets are tidy. Every key matches, no column is half-empty, and dates are stored exactly one way. Real data has a customer who appears twice under two email addresses, a status column with five spellings of the same value, and a timestamp that means local time for one team and UTC for another.

Start with something messy that you already understand — an export of your own spending, a list of your books, an attendance sheet. The queries will be humbler and the lessons will be permanent, because you will have to decide what to do about the mess instead of assuming it away.

You will have to unlearn spreadsheet reflexes

Spreadsheet habits are comfortable and mostly wrong here. Reaching for a lookup formula becomes a join. Sorting a column by hand becomes ORDER BY. Building one big wide table with everything in it becomes the thing you learn to stop doing, because duplicated data drifts apart over time.

  • Stop thinking in cells; think in columns and rows as whole sets.
  • Stop copying values between tables; store a reference instead.
  • Stop trusting a number you have not reconciled against a raw count.

If I could restart, the first week would be schema reading, one messy dataset, and a notebook of plain-English questions — no keyword drills at all. The syntax would have arrived on its own, attached to questions I actually wanted answered.