databases/
Tables, queries, indexes, transactions, storage engines and caching.
6 results
databases/sql-window-functions-how-every-row-gets-a-rank-or-running-total-withou.md
SQL window functions: how every row gets a rank or running total without collapsing the table
A window function adds a calculated column to every row without collapsing rows the way GROUP BY does. Learn what OVER, PARTITION BY and…
databases/pagination-why-next-page-shows-a-post-twice-and-how-a-bookmark-fixes-i.md
Pagination: why 'next page' shows a post twice, and how a bookmark fixes it
Why does "next page" sometimes show the same post twice, and why does page 90,000 load slowly? Both come from paging with LIMIT and OFFSET…
databases/the-n-1-query-problem-why-a-page-that-asks-the-database-501-questions.md
The N+1 query problem: why a page that asks the database 501 questions is slow
A page that lists authors and their books can quietly send one query per author. With 500 authors that is 501 trips to the database, and…
databases/sql-null-why-two-people-vanish-from-both-your-queries.md
SQL NULL: why two people vanish from both your queries
Two people have no age in your table. You ask for everyone older than 30, then for everyone not older than 30, and the two lists add up to…
databases/sql-joins-how-two-tables-become-one-answer-inner-left-right-full.md
SQL JOINs: how two tables become one answer (INNER, LEFT, RIGHT, FULL)
Your data lives in two tables, but your question needs both. A JOIN lines them up, and the four kinds (INNER, LEFT, RIGHT, FULL) differ…
databases/your-first-sql-query-ask-a-table-of-pets-a-question.md
Your first SQL query: ask a table of pets a question
SQL is the language you use to ask a database questions, and five words get you surprisingly far: SELECT, FROM, WHERE, ORDER BY and LIMIT…