//AMIS Technology Blog » puzzle

Posts tagged puzzle

Vacatures bij AMIS services

The Knight's Challenge – Recursive SQL Queries make a move on the Chess board

3

In my quest to position ‘connect by’ (and its 11g successor, Recursive Subquery) as mechanism for recursive queries rather than just an hierarchical query facility, I stumbled across a simple, fairly meaningless challenge to take on: a knight on a chess board – and the question of finding its way from one square to another. Recursive querying in general consists of two elements:

  • the initial situation, the starting point (the n=1 step)
  • the algoritm to get from one stage to the next (the n to n+1 step)

A third, mandatory, element is the termination of the query: when is the journey complete, what is the maximum value for n or what is the exit condition. (more…)

SIG Event

Writing a Word Search puzzle solver in SQL

Brace yourself for yet another pretty useless demonstration of the unexpected wonders of SQL as well as my apparent lack of meaningful things to do with my life.

Undoubtedly, you are familiar with Word Search puzzles, the type of puzzle that present a matrix with a mash of letters in which specific words have been hidden. For example:

This Word Search contains the names of several countries (such as italy, holland, poland, spain, france, japan, togo, peru). If you look closely, you will find them:

In this article, I will show you – and I know this is something you have been waiting for – how a SQL Query can solve these puzzles for you:

(more…)

Go to Top