SQL Resources, Tutorials and Guides

SQL is the language of relational data, and it's aged remarkably well. This hub gathers SQL tutorials and guides on queries, joins, indexing, and writing performant queries against real databases.

4 articles · Updated February 8, 2024

Understanding indexes is the single highest-leverage SQL skill — most slow queries are a missing index away from fast.

Related topics

Featured articles

Hand-picked and latest articles from this topic.

From Explain

Plain-English explainers for core concepts related to this topic.

From Basics

Quick-reference cheatsheets for tools and libraries in this space.

External resources

Curated tools, docs, and communities worth bookmarking.

Frequently asked questions

Quick answers about this topic hub.

What are SQL joins?

Joins combine rows from multiple tables based on related columns. INNER JOIN returns matching rows from both tables; LEFT JOIN keeps all rows from the left table even without matches. Mastering joins is essential to working with relational data.

How do I make a slow SQL query faster?

Start by examining the query plan to see what the database is doing. Common fixes include adding indexes on filtered and joined columns, selecting only needed columns, and avoiding functions on indexed columns in WHERE clauses.

What's the difference between WHERE and HAVING?

WHERE filters rows before grouping, while HAVING filters groups after aggregation. Use WHERE for individual row conditions and HAVING for conditions on aggregate results like counts or sums.

No posts found for this topic.

Promote your content

Reach over 400,000 developers and grow your brand.

Join our developer community

Hang out with over 4,500 developers and share your knowledge.