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 😃

51 Upvotes

192 comments sorted by

View all comments

Show parent comment

2

u/myDuderinos May 21 '26

Overuse of CTEs can also be a red flag though

It's what Ai always wants you to do, but depending on the DB it can be a lot worse for the performance

2

u/sandrrawrr May 21 '26

With anything, these are concepts that can be poorly written. But sometimes, it's 3 am and you're staring at a 5th level of a nested statement and wonder what your life is if you can just turn the whole thing into a few clean CTEs.