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 😃

49 Upvotes

192 comments sorted by

View all comments

Show parent comment

1

u/GunnerMcGrath Jul 03 '26

I agree that you might be forced to use them in rare cases like this, but that just means your system is poorly built. Maybe you can't do anything about that but someone should.

I have seen cursors used a lot over my nearly 30 year career and I have never once said "oh, that's clever." People almost exclusively use them because they don't understand how to do set based updates properly and just take the easy way out of going one at a time and the system always suffers.

I'm not interested in arguing for the sake of arguing. This is my experience and position and you are free to disagree.