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 😃
50
Upvotes
View all comments
Show parent comment
1
u/GunnerMcGrath Jul 03 '26
I would not write a stores procedure that had to be run on one record at a time. That's horrifically inefficient. I would write the procedure to handle the full dataset all at once. Often times temp tables are involved if you have to iterate on data, but it's going to be much faster.