DEV Community

select * from SQL

Posts on tips and tricks, using and learning about SQL for database development and analysis.

Posts

👋 Sign in for the ability to sort posts by relevant, latest, or top.
Killing Deadlocks Before They Form: Wait-Die vs Wound-Wait Schemes

Killing Deadlocks Before They Form: Wait-Die vs Wound-Wait Schemes

Comments
2 min read
SQLAlchemy MissingGreenlet in Async Code: Fix Lazy Loading With selectinload, awaitable_attrs, or lazy="raise"

SQLAlchemy MissingGreenlet in Async Code: Fix Lazy Loading With selectinload, awaitable_attrs, or lazy="raise"

Comments
5 min read
BigQuery MERGE Is Not a Uniqueness Constraint: A Replay-Safe Tutorial

BigQuery MERGE Is Not a Uniqueness Constraint: A Replay-Safe Tutorial

Comments
3 min read
A created_at-only cursor lost 587 rows, even with clock_timestamp() and microseconds

A created_at-only cursor lost 587 rows, even with clock_timestamp() and microseconds

Comments
3 min read
Stop Using OFFSET for Pagination: Keyset Pagination Is 10,000x Faster on Deep Pages

Stop Using OFFSET for Pagination: Keyset Pagination Is 10,000x Faster on Deep Pages

Comments
3 min read
SQL injection in the WHERE clause: how to reach unreleased products (PortSwigger)

SQL injection in the WHERE clause: how to reach unreleased products (PortSwigger)

Comments
2 min read
SQL Server Multiple Cascade Paths (Error 1785): Which Foreign Key Loses ON DELETE CASCADE, and What Replaces It

SQL Server Multiple Cascade Paths (Error 1785): Which Foreign Key Loses ON DELETE CASCADE, and What Replaces It

Comments
11 min read
5 Reasons Your SQL Index Is Being Ignored (and How to Fix Them)

5 Reasons Your SQL Index Is Being Ignored (and How to Fix Them)

Comments
3 min read
4 SQL NULL Traps That Silently Break Your Queries (NOT IN Returns 0 Rows!)

4 SQL NULL Traps That Silently Break Your Queries (NOT IN Returns 0 Rows!)

Comments
3 min read
SQL Challenge: Can You Build a Customer Report Using JOIN, GROUP BY and CASE WHEN?

SQL Challenge: Can You Build a Customer Report Using JOIN, GROUP BY and CASE WHEN?

Comments
2 min read
SQL Window Functions in 5 Minutes: ROW_NUMBER, RANK, Running Totals, Top N

SQL Window Functions in 5 Minutes: ROW_NUMBER, RANK, Running Totals, Top N

Comments
3 min read
First Record with a Specific Value Within Each Group

First Record with a Specific Value Within Each Group

6
Comments
4 min read
PostgreSQL Query Optimization: Indexes, EXPLAIN ANALYZE, B-tree vs GIN vs GiST & the N+1 Problem 🚀

PostgreSQL Query Optimization: Indexes, EXPLAIN ANALYZE, B-tree vs GIN vs GiST & the N+1 Problem 🚀

Comments
17 min read
SQL Server Index Tuning for Beginners: A Practical Guide

SQL Server Index Tuning for Beginners: A Practical Guide

Comments
4 min read
How to Convert Shopify Product CSV Exports into Clean SQL Statements

How to Convert Shopify Product CSV Exports into Clean SQL Statements

Comments
4 min read
👋 Sign in for the ability to sort posts by relevant, latest, or top.