r/SQL • u/badboyzpwns • 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 😃
51
Upvotes
View all comments
Show parent comment
3
u/StickPuppet May 21 '26
I tend to disagree, depending on why you're using it.
where 1=1
and condition1 = true
and condition2 = false
and condition3 between ....
this allows me to change/remove constraints on the fly for testing, especially if the final outcome has no constraints, and I want to do a small quick 1 line filter to go go back and forth on in testing.