In this repository, you find additional material, helpful links and more related to the talks on SQL recursion that Michael Tiefenbacher and I have given at the German Db2 User Group (DeDUG) and at the IDUG EMEA DB2 Tech Conference.
The image below, based on Escher's drawing hands, is taken from this blog post on two kinds of SQL recursion.
Sample queries in this repository:
- Db2-based Sudoku solver and Db2z-based Sudoku solver, see below for SQLite original
- compute factorial
- XML test data generation
- compute table dependencies, use the catalog tables to determine best order to export database objects
- CONNECT BY vs. CTE shows the same task done differently
Information on airports, airlines, connections and more is available on OpenFlights. The script flightroute_setup.sql provides the statements to set up tables and import data downloaded from OpenFlights.
Compute the flight routes to Philadelphia using this query.
References to the Db2 Knowledge Center