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
19
u/hipsterrobot May 20 '26
I also didn’t care for WHERE 1=1 until someone explain to me that if your query has multiple filters like
WHERE 1=1
and city=something
and state=something
You can comment out each filter line to test stuff and it won’t break your query. Made a lot of sense to me.