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 😃

53 Upvotes

192 comments sorted by

View all comments

Show parent comment

1

u/lalaluna05 May 21 '26

I haven’t either, but I always assume there’s an edge case I haven’t come across yet 😂 I’ve only been working in data for 5ish years so I just figure I have a while to go before I stumble across something!!

2

u/GunnerMcGrath May 22 '26

25 years here, never have had a situation where a cursor was even remotely the right choice. Have refactored many cursors others have written (including one that had been running for 24 hours when I was asked to help and I turned it into a single update statement that ran in a split second).