2022-11-28
|~3 min read
|409 words
In my post on how to use CTEs to write legible queries, I skipped over a potentially useful thing in SQL: how to add a column of calculated…
2022-11-28
|~6 min read
|1099 words
NB: This note is based on my experience using Mode analytics to run analysis on an Amazon Redshift SQL database. If there are language…
2022-11-28
|~3 min read
|439 words
When starting a new project or service, one question you’re nearly guaranteed to ask, is what kind of data store do you need? Let’s start…
2022-11-28
|~2 min read
|372 words
I’ve known for a while that one of the ways to prevent SQL injection attacks is to use parameterized queries - but I never really understood…
2022-11-28
|~1 min read
|194 words
I was fiddling with some test databases recently when a colleague suggested I could wipe the entire database (without dropping the table…
2022-11-28
|~3 min read
|552 words
I recently came across a creative solution to finding the relationships between different values within a table using SQL. This may be…
2022-11-28
|~2 min read
|258 words
A few days ago, I wrote about handling arrays from Javascript to SQL. Turns out, I missed an edge case - empty arrays. If you try to set an…
2022-11-28
|~2 min read
|298 words
Yesterday we updated a Postgres record’s details based on the and returned the update in a single query. What if the details was not a…
2022-11-28
|~2 min read
|239 words
Often, after making a change to a database, we want to verify that the change was made and use the updated rows. A naïve approach would be…
2022-11-28
|~1 min read
|123 words
There are two ways to add a comment to a SQL query - using and . The differences are as follows: With a comment surrounded by and , the…