CodeWithSQL Blog: Latest SQL Tips and Tutorials

Explore the latest SQL tips and tutorials in our blog section. Learn SQL programming, database management, and query optimization.

SQL Aggregate Functions Explained

SQL aggregate functions explained: COUNT, SUM, AVG, MIN, MAX and GROUP_CONCAT, NULL handling, GROUP BY and HAVING, and conditional aggregation with CASE.

SQL Subqueries vs JOINs: When to Use Each

SQL subqueries vs JOINs: the types of subqueries, correlated vs non-correlated, EXISTS vs IN vs JOIN, and when each is clearer or faster, with examples.

ORDER BY, GROUP BY and HAVING Explained

ORDER BY, GROUP BY and HAVING explained: how to sort, group and filter groups in SQL, the difference between WHERE and HAVING, and the logical processing order.

WHERE Clause Explained with Real Examples

The SQL WHERE clause explained with real examples: comparison and logical operators, IN, BETWEEN, LIKE and IS NULL, WHERE vs HAVING, and sargable filters.

How to Write Better SQL Queries

How to write better SQL queries: name columns, write sargable predicates, use CTEs and joins well, format for readability, handle NULLs, and read the query plan.

SQL Transactions Explained (ACID Properties)

SQL transactions explained: COMMIT, ROLLBACK and SAVEPOINT, the four ACID properties, isolation levels and the anomalies they prevent, with clear examples.

SQL Indexes Explained for Beginners

SQL indexes explained for beginners: what an index is, how it speeds up reads, clustered vs non-clustered, which columns to index, and the read and write trade-off.

SQL Views Explained

SQL views explained: what a view is, how to create and query one, updatable views, materialized views and refresh, and when views help or hurt performance.

Page 2 of 6 · 51 articles
Learn SQL

Our structured courses take you from beginner to advanced, completely free.

→ Start Beginner Course
Write for us

Want to contribute a blog post? We'd love to hear from you.

Get in touch