SQL
20 items tagged with "sql"
Patterns2
Materialized View
A precomputed, stored result set that trades storage and refresh cost for fast reads of expensive queries, aggregations, or denormalized projections.
Star Schema
A dimensional data-modeling pattern with a central fact table linked to denormalized dimension tables, optimized for fast, intuitive analytical queries.
Anti-Patterns5
SELECT * Everywhere
Querying all columns by default instead of naming the ones you need, wasting I/O and creating brittle coupling to schema order and shape.
Implicit Columns in INSERT
Writing INSERT statements without naming columns, relying on positional order so a schema change silently misaligns or corrupts data.
Missing Indexes
Querying large tables with no supporting index, forcing full scans that work in testing and collapse under production data volume.
Index Overuse
Adding an index for every column just in case, bloating storage and slowing every write while most indexes are never used by the planner.
Unbounded Result Sets
Querying without a LIMIT and loading entire growing tables into memory, so a query that was fine at launch crashes the app as data accumulates.
Products5
PostgreSQL
Powerful, open source object-relational database system
MySQL
Popular open-source relational database management system
MariaDB
Community-developed fork of MySQL
CockroachDB
Distributed SQL database for global applications
Drizzle ORM
TypeScript ORM for SQL databases
FAQs5
What is the difference between SQL and NoSQL databases?
SQL (relational) databases store data in tables with fixed schemas and use SQL for queries, offering strong consistency and powerful joins; examples i...
What does ACID mean in databases?
ACID is a set of guarantees that make database transactions reliable: Atomicity (a transaction either fully completes or fully rolls back), Consistenc...
What is a database index and why does it matter?
An index is a separate data structure, usually a B-tree, that lets the database find rows matching a query without scanning the entire table. It drama...
What is the difference between a primary key and a foreign key?
A primary key uniquely identifies each row in a table and cannot be null or duplicated; it is the column (or set of columns) the database uses to addr...
What is a materialized view?
A materialized view is a database object that stores the precomputed result of a query physically on disk, unlike a regular view which runs its query ...