It's ~150LOC but doesn't have aggregates (yet)
A very long time ago I started writing a game in a weekend a for Ludum dare competition and ended up writing a toy sql engine of my own https://williame.github.io/post/59997353762.html
I still get the urge to make a proper one one day. With the sql features that I wish sql engines had. Hmmm. Need-sniping myself now… :)