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
10
u/eww1991 May 20 '26
The only trustworthy use case I can thing of for distinct is you know something should be unique and you're doing a count(col), count(distinct col) just to be sure, like to just double check a join isn't going wrong somewhere