Tip: Drop All Tables/Sequences from a User

I was testing a deployment script today and after about 10 tables something would fail. And it took a few goes to get it right (silly leading spaces). So I was getting very frustrated manually dropping all tables and constraints I had just built. So I did a bit of digging and came across this: select ‘DROP TABLE [SCHEMA_NAME].’ || TABLE_NAME || ‘ CASCADE CONSTRAINTS;’ … Continue reading Tip: Drop All Tables/Sequences from a User

Fibonacci Spiral in SQL!

I came across a challenge on Dev.to (awesome site if you’re not already on it). The challenge was to generate the Fibonacci Spiral in whatever language you use. This is fairly easy in languages such as JavaScript, Ruby and other traditional logic-based languages. But I was able to come up with a way of completing the challenge using SQL. with FIBONACCI (i, SPIRAL, PREV) as … Continue reading Fibonacci Spiral in SQL!