13.1. Signs of Bad SQL

The phrase “original sin” always seemed to be an oxymoron; originality is an attribute that is usually missing when people—and programmers—sin. Programmers tend to make the same kinds of errors in their designs and their code over and over. They confuse RDBMS with the file systems and 3GL- or OO-oriented programming environments they first learned. The same thing happens with a spoken natural language—you first use your old grammar and syntax rules with the new words. Eventually, you use the new grammar and syntax rules with the new words.

Here are a few diagnostics you can apply simply by looking at the code. These are not in-depth analyses, but immediately visible symptoms of deeper problems. This is like a doctor who ...

Get Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.