Generating fractals … with SQL queries!!!
summary
Claim: Postgres SQL alone generates real fractals — Sierpinski, Mandelbrot, Julia, Hilbert and dragon — as text art. It uses generate_series and cross join to build grids, bitwise AND and CASE to mark Sierpinski, recursive CTE to iterate escape-time formulas (a thousand iterations for Mandelbrot), and string_agg to join rows. A 13-line query produces Sierpinski and a 50-line SQL query builds Hilbert via L-systems with replace; the queries run and produce the fractal outputs.
AI-written summary · about
chapters (6)
- 0:00Introduction to SQL
- 1:48Generating a Sierpinski Triangle
- 3:51Mandelbrot Set with Recursion
- 6:04Escape Time Fractals
- 6:53Generating L-System Fractals
- 10:49Final Examples and Conclusion








