SQL

14 guides tagged “SQL”.

  1. Offset vs Cursor Pagination: Which Should Your API Use? Offset pagination skips rows and drifts as data changes. Cursor pagination seeks directly and stays consistent. Compare them and learn when each is right. Software Engineering intermediate 8 min
  2. Postgres vs MySQL: Which Should You Use? Postgres and MySQL are far closer than the folklore says. Compare them on types, JSON, constraints, and operations, and get a direct recommendation. Software Engineering beginner 9 min
  3. SQLite vs Postgres: Which Should You Use? SQLite is fast and zero-ops but single-writer. Postgres is concurrent and multi-user. Compare them, and see why local SQLite plus prod Postgres breaks. Software Engineering beginner 8 min
  4. The 12 Database Mistakes That Show Up in AI-Generated Apps Missing indexes, N+1 queries, float money, naive timestamps, unpooled connections, and destructive migrations — the twelve database mistakes generated code ships with, and the fix for each. Software Engineering beginner 13 min
  5. Databases for AI Builders: Why Your AI-Generated App Gets Slow and Loses Data Your AI writes working SQL that fails at scale. Learn indexing, the N+1 problem, transactions, connection pools, migrations, backups, and consistency — with linked guides for each. Software Engineering beginner 13 min
  6. How to Choose a Database for Your App: A Decision Guide Workload, consistency, data shape, scale, and ops burden — the five questions that decide which database you should use, with a comparison table and the cases where each option is wrong. Software Engineering beginner 11 min
  7. How to Design a Database Schema (That You Won't Have to Rewrite) Design a schema from your queries, not your entities: primary keys, relationships, column types, constraints, indexes, and the migration order that survives deploy day. Software Engineering intermediate 13 min
  8. What Are the Different Types of Databases (and What Is Each One For)? Relational, document, key-value, wide-column, graph, time-series, search, and vector databases — what each data model is, the use cases it fits, and the ones it breaks. Software Engineering beginner 12 min
  9. How to Add an Index to a Slow SQL Query Diagnose a slow query with EXPLAIN, add the right index, and verify the speedup. A practical PostgreSQL tutorial. Software Engineering beginner 7 min
  10. What Is a Covering Index? An index that contains every column a query needs can answer it without visiting the table at all — an index-only scan, which is faster and cheaper than any ordinary index. Software Engineering intermediate 6 min
  11. What Is a Materialized View? A materialized view stores the result of a query as a table. It makes expensive reads fast at the cost of staleness and maintenance — and it is not the same as a view. Software Engineering intermediate 6 min
  12. How to Read an EXPLAIN Plan A step-by-step reading of a query plan: what each node does, which numbers matter, and how to spot the scan or the estimate that explains a slow query. Software Engineering intermediate 6 min
  13. What Is the N+1 Query Problem? The N+1 problem fires one query per row instead of one query total, and AI-generated ORM code causes it constantly. Learn it with a code example. Software Engineering beginner 7 min
  14. What Is a Composite Index? A composite index covers several columns in a defined order. Which queries it can serve depends on the leftmost columns, which is why column order is the whole design decision. Software Engineering intermediate 6 min