You can do it in SQL, stop writing extra code for that
“SQL, Lisp, and Haskell are the only programming languages that I’ve seen where one spends more time thinking than typing." - Philip Greenspun
Even with thinking more than typing SQL (Structured Query Language) we software engineers use it as a way to pull data only.
We usually don't leverage SQL's power of data manipulation and do the needed changes in code.
This is quite prevalent in software engineers who work in web applications. This post aims to enlighten you about the powers of SQL you might know but generally don't use.