r/SQL • • May 20 '26

PostgreSQL What are common SQL red flags?

Hello! interview prepping, here wondering what are some common red flags for wrioting SQL?

Like

LIKE failing to index, not having trasnactions, usign SELECT * instead of specific collums, etc 😃

50 Upvotes

192 comments sorted by

View all comments

Show parent comment

3

u/IHoppo May 21 '26

As a corollary to this, use aliases to give domain knowledge too when using (for example) classification tables - for instance, if a table holds roles for parties, and you want student and lecturer roles from the party classification table linked to party - so using 2 hits on the classification table, use

From classification studentClassification,
classification lecturerClassification

Etc.