r/learnSQL 3d ago

SQL keywords every developer should actually know — from beginner to advanced

I recently put together a practical SQL guide after realizing something:

📖 Full article:
https://medium.com/the-code-frontier/sql-keywords-every-developer-should-know-well-beginner-to-advanced-4d705d6c7538?sharedUserId=darvexatechnologies

Most developers learn SELECT, INSERT, UPDATE, and DELETE pretty quickly… but production SQL gets a lot more interesting after that.

Things like:

  • INNER JOIN vs LEFT JOIN
  • CAST / CONVERT
  • DATEADD / DATEDIFF
  • GROUP BY / HAVING
  • SET NOCOUNT ON
  • SET ANSI_NULLS
  • Transactions and ROLLBACK
  • SCOPE_IDENTITY()
  • NOLOCK, ROWLOCK, READPAST
  • @@ROWCOUNT, @@ERROR, @@SPID
  • EXECUTE AS OWNER
  • EXISTS vs IN
  • TRY...CATCH

I tried to explain these from a real-world developer perspective, rather than giving textbook definitions — including where they can actually be useful and where you should be careful.

The guide is organized from beginner concepts through more advanced SQL Server features, with examples using a simple Employees and Orders dataset.

📖 Full article:
https://medium.com/the-code-frontier/sql-keywords-every-developer-should-know-well-beginner-to-advanced-4d705d6c7538?sharedUserId=darvexatechnologies

I'm curious:

What SQL keyword, function, or feature do you think developers commonly misunderstand or misuse?

For me, NOLOCK would probably be high on that list. 😄

Would love to hear what you've seen in real production code.

52 Upvotes

9 comments sorted by

6

u/reditandfirgetit 2d ago

I skimmed it to get a feel for what you were trying to communicate. You're eager and that's good. This article is too long and missing things.

For example, NOLOCK is not recommended unless it doesn't matter that you can pull inaccurate data (dirty reads). In a financial system you wouldn't want to use it

(Removed the windows function comment, I see it's a future article you want to write)

Advanced developers should know how to data model at least 3NF, how indexes work, how to read an execution plan

I would break it into a series, dont use AI to write it. Write it yourself, have AI review as an editor would. You'll retain information better that way

3

u/DevLegend26 2d ago

I write it myself. And i'm preparing documentation on window function from few days according to mg knowledge. And I'm agree with your nolock concept.

2

u/yinkeys 2d ago

Thanks

3

u/Owen-Isaac-2022 2d ago

This is a great article. Continue doing the good work.

1

u/DevLegend26 2d ago

Thanks Isaac

2

u/Owen-Isaac-2022 2d ago

You're welcome

-2

u/papari007 3d ago

I didn’t realize it was that easy to get published

3

u/DevLegend26 3d ago

What it's mean?