Last week I led a SQL based Coding Dojo as part of the Madgex ILP programme. A lot of ILP sessions are in a presentation format, and I wanted to do something with a bit more, or in fact a lot more, attendee participation. I've been interested in the idea of deliberate practice for a while, and Richard has been to quite a few coding dojos and so I figured it was time to give it a try. Shortly after I'd decided to do one, I attended a Skills Matter evening and stumbled across Ivan Sanchez, who blogged about Starting a Coding dojo which helped me get my thoughts in hand.

I chose to use SQL as the area to practice, mainly because it is an area I am really familiar with and so could help out if necessary. Also I have a copy of Joe Celko's SQL Puzzles and Answers which provided me with a great collection of puzzles to practice with.

I chose a puzzle called Double Duty which is described as follows:

A person may have more than one role. The roles are defined as follows:
O – Officer
D – Director

The PersonRole table is defined as:
PersonName VARCHAR(50)
RoleCode CHAR(1)

Produce a list of People and their roles where they are either Officer or Director, and where anyone with both the O and D role is represented once as B – Both.


I've put a copy of the SQL file I produced to create the tables, and populate the data here, so feel free to take a look.

I opened the session by explaining what a dojo was (a training hall for practice in the martial arts), what a coding dojo was (a practice area for coding skills) and introduced the problem domain (I provided print outs of the table structure, data and expected results). I then introduced the roles we were going to use - driver and co-pilot - and the rules we were going to adhere to. In our main meeting room we have a large plasma screen and so I connected this to my laptop so that the audience could see exactly the same as the driver and co-pilot. I provided a couple of SQL books and a SQL Server cheatsheet for reference.

After the initial self-consciousness had gone, the pairs settled into the idea pretty well, and it was interesting to watch the different pairs interact and form new (rapid) working relationships. There were 7 participants, and each spent 5 minutes as the driver and 5 minutes as the co-pilot. By the end of the session there were 4 solutions produced which meant that the group as a whole felt that they'd achieved something. We ran a quick retrospective at the end of the session and the following were the major points:

  • The audience found a certain amount of frustration by not being able to help, and not being able to shout out suggestions.
  • At least one person acting as the co-pilot found it hard to articulate what needed to be done.
  • At least one person admitted to finding it hard to think without having their fingers on the keyboard.
  • At least one person learnt something about SQL.
  • Quite a few people found a laptop keyboard hard to use, so a proper keyboard would have helped.


As a result of the success of this one, I've booked in another one for a couple of months time - again SQL based but I'm also thinking of making use of TDD Problems for another practicable skill.