Coding Archives -

Category: Coding

  • Salad and SQL

    This afternoon, my manager asked me what I would do, if I had to make a choice between salad and SQL. This is obviously a difficult question to answer, given that one option is a (nominally) healthy choice of food, and the other is a set of imperatives, used to manipulate things in a database.

  • Using a window function in SQL to find the shortest viable data period for multiple items

    I have a large table of data, and the important columns for me are the clickdate, productid and clickcost columns. The cost represents how much I’ve spent on marketing the product. I want to look at every product once it’s had a cost of at least $50. (Before then, there’s not enough data for me […]

  • A way to avoid some carelessness with postgres

    Part of my day job involves loading data from lots of different files into a database, and one way this can go horribly wrong is if I attempt to load the same file twice. Either the database will get mad at me because I’ll be trying to violate referential integrity, or my end users will […]