Blogs
Short, practical SQL articles with code you can run.
EXPLAIN SELECT name FROM employees WHERE id = 42;
Performance
Best Practices for Writing Efficient SQL Code
Ten habits that keep queries fast and readable: indexes, data types, parameters, EXISTS, UNION ALL and reading the query plan.
Interview question
Find Nth Highest Salary in 5 Different Ways
The most asked SQL interview question, solved with LIMIT/OFFSET, a correlated subquery, TOP, DENSE_RANK and a self join.
SQL basics
Introduction to SQL Joins: Inner, Outer, Left, Right, and Cross
What each join returns, with the syntax and a quick comparison table so you never mix them up in an interview.
Database design
Understanding Primary Keys, Foreign Keys, and Unique Constraints in SQL
Three constraints that keep your data correct: what each one does, the syntax, and how they differ.
SQL basics
10 Essential SQL Queries Every Developer Should Know
SELECT, WHERE, GROUP BY, JOIN, ORDER BY, INSERT, UPDATE, DELETE, DISTINCT and LIMIT, each with a short example you can run today.
