- MySQL – UPDATE
Changing rows that already exist. UPDATE with WHERE and the habit that saves you — run it as a SELECT first, UPDATE with a JOIN for a backfill, updating from a subquery, ORDER BY and LIMIT on an UPDATE to work through a large table in batches, and `sql_safe_updates`, the setting that refuses an UPDATE with no WHERE clause before it becomes an incident.
- MySQL – INSERT
Putting rows in. Single-row and multi-row INSERT and why the multi-row form is dramatically faster, INSERT ... SELECT, leaving AUTO_INCREMENT and DEFAULT columns out, INSERT IGNORE and what it actually swallows, ON DUPLICATE KEY UPDATE for an upsert, REPLACE and why it is usually the wrong one, and LOAD DATA for a bulk load.
- MongoDB – Why NoSQL, and When Not To
What a document store actually buys you, what it costs, and the four cases where a relational database is still the right answer.
- MySQL – Window Functions
Aggregating without collapsing the rows. OVER (PARTITION BY ... ORDER BY ...), ROW_NUMBER, RANK and DENSE_RANK and the difference ties make, LAG and LEAD for comparing a row to the one before it, running totals with a frame clause, NTILE, and the top-N-per-group problem — which is genuinely awkward without window functions and three lines with them.
- LeetCode 47 – Permutations II
Permutations with duplicates, and the extra line is a different extra line from the one Combination Sum II uses — which catches people who think they already learned this trick. With no start index, used[] is the only signal of depth, so the rule becomes !used[i-1]. All three de-duplication rules compared side by side.