r/SQL • u/Happieeman • 3d ago
Discussion SQL HACKS
Hello guys,
I work as a SQL Developer. What productivity hacks or practices do you follow in your day-to-day office work?
For example:
I create a new SQL script every morning, naming it with the current date (SYSDATE), to keep track of my daily work.
I maintain an Excel sheet listing the database objects I've created, along with remarks about each object.
What other useful productivity hacks or practices do you follow?
I'd love to learn from your experience!
1
u/mirinai_ai 3d ago
One practice worth adding for UPDATE/DELETE work: run the same WHERE clause as a SELECT COUNT(*) first, then wrap the real statement in a transaction so you can ROLLBACK if the row count isn't what you expected. It fits well with dated scripts, since the check query can sit right above the change.
1
u/GaniToshido 3d ago
Ditch the Excel sheet for object tracking, babysitting external docs is an unnecessary pain that always gets out of sync. In my MariaDB setups, I slap a COMMENT string directly onto the table and column definitions when creating them. When I need a data dictionary, I query information_schema to pull a live report of what I've built. It keeps the documentation living inside the engine itself, so you never have to guess if your spreadsheet is outdated.
1
u/AlternativeHour3098 3d ago
I build a dashboard whoch runs some daily queries in yhe backend in databricks. Better than running few things on a daily basis just trigger anytime of the day