r/learnSQL • u/Sea_Butterfly713 • Jun 20 '26
what mistakes you guys did while learning SQL
i learn from other mistakes , so tell me
36
Upvotes
r/learnSQL • u/Sea_Butterfly713 • Jun 20 '26
i learn from other mistakes , so tell me
9
u/nboro94 Jun 20 '26 edited Jun 20 '26
2 Major ones for me:
15
u/woahboooom Jun 20 '26
Forgot a where clause with a delete statement... luckily they had a back up
4
u/Max_Americana Jun 20 '26
“I can edit this table on Friday in prod.. it definitely won’t break tomorrow at 4 am!”
Never again will I promote on a Friday.
3
u/murdercat42069 Jun 20 '26
Terrible joins
3
u/2daytrending Jun 21 '26
Spent way too long memorizing syntax instead of actually writing queries and breaking stuff.
2
u/ChristianPacifist Jun 21 '26
Obviously using a <> / != operator with a NULL-containing field and filtering out NULLs that are supposed to be kept.
Related is returning no rows by mistake using a NOT IN compared to a NULL-containing list.
Another tricky one is not realizing how a running sum window function can repeat values on rows in a tie if you order by non-unique values. Always include a tiebreak unique value when doing an order by while doing ORDER BY window functions as a general best practice in very many situations.