I started go-migrate in 2023 as the migration layer of my private Go framework. I am releasing these layers separately. HaloLog handles structured logging. This tutorial uses the migration library to ship two versions in one binary and check their installation order. An illustrative release. A SQL…
Learn SQL From Scratch: 7 Essential SQL Queries Every Beginner Should Know SQL (Structured Query Language) is an important skill for students, software developers, data analysts, and freshers preparing for technical interviews. If you are new to SQL, here are seven useful SQL queries explained with…
👉 Every query in this post runs live, on real PostgreSQL or SQLite in your browser, at sqlstreak.com/sql/window-functions . Change them and see what breaks. Window functions were the point where SQL "clicked" for me. Before them, every "rank these", "top 3 per category" or "compared with last time"…
People want to use AI to run reports on their databases. They also don't want to give AI access to their database. It's a Catch-22. AskDB is an open-source TypeScript text-to-SQL toolkit: it turns a question into checked SQL for your app to run. The model sees your schema and the notes you write…
A legacy system keeps its customer support history in SQL Server. A reporting copy lives in PostgreSQL. The nightly load stopped two days ago, and before that it had already dropped a few rows. Now the copy has holes. You do not want to reload the whole table. You want to take the last week, find…
Finance teams and analytics engineers frequently need to pull general ledger data out of NetSuite and load it into relational databases or warehouse platforms like PostgreSQL, MySQL, or Snowflake. NetSuite reports excel at displaying financial data on screen, but spreadsheet exports require careful…
A spreadsheet gets slow and awkward once a CSV has many thousands of rows and you want totals, filters or joins. SQL is made for those questions, and you do not need to install and configure a database server to use it. Here are three simple ways, using an example file called orders.csv with the…
Originally published at SQL & Cloud Lab . This post was drafted with AI assistance. Isolation levels decide what a transaction is allowed to see while other transactions are changing the same data. They are the reason a report can block an order screen, or why NOLOCK sometimes returns rows twice.…
SQL Challenge #103: Find the Top 2 Highest-Paid Employees in Every Department Using ROW_NUMBER() Window functions are very useful in SQL interviews and real-world data analysis. They help us rank records, compare values and solve problems that are difficult to handle with basic aggregate functions.…
SQL Window Functions for Cohort and Retention Analytics Cohort retention answers a simple product question: after users first become active, how many return in later periods? For example: Of users whose first activity was in January, what percentage was active in February? Do February cohorts…