Teachers are constantly on the look out for things that make the teaching of particular topics easier and more rewarding for our students. Various estimates place the mixture of learner types in secondary classes at 40% Visual, 20% Auditory and 40% Kinaesthetic. Diagramming a solution would seem to appeal to much of this range.

I cannot claim all of my students fully appreciate this approach. Certainly in the initial stages of querying, some see it as an irrelevant skill and therefore refuse to take time to use it. Some resent the extra time it takes to 'draw' the solution. It takes very little effort on the part of the teacher to demonstrate the value of a method such as this when explaining complex queries.

Interestingly, I have found that students take little time to master the symbol set, and find translating a diagram into SQL is so easy that they often leave their solutions in diagram form for easier revision. Students are encouraged to shortcut their diagrams - leave out unused column names, freehand sketch, abbreviate and so on. The bottom line is that the method must work for the student or they won't use it. I encourage students to include their diagram along with their answer as mental notes during an exam. Part marks can be allocated if a student demonstrates significant progress towards a solution - the diagram becomes a students working in much the same way that drafts in English and temporary calculations do in Mathematics.

Alternative solutions are more apparent to students once they have a picture of one possible approach, and the need for complexities like correlation and existence queries become obvious when students see what columns and tables are involved in the answer. Query execution precedence and efficiency are easily explained using the diagrams also.

I artificially force the issue of student use of diagrams by routinely explaining styles of query formations using diagrams first, only introducing the new syntactic constructions after students understand what the resultant process should yield.

As a teacher, when I plan the hard questions in exercises and exams I find that diagramming a solution before writing the question often results in a much better expressed question. As we all know, writing a question does not always guarantee that the answer is actually possible, particularly if there are formation errors in the database in the first place (even where a robust design methodology was used in the design and construction of relational databases, s**t happens).

When marking queries, my marking scheme often contains the diagram rather than the specific syntax of the query. We know students are extremely talented at identifying ingenious alternative solutions to our most carefully phrased questions. I find a diagram invaluable in evaluating their correctness, with more general parts of the diagram being allocated marks as opposed to specific syntactic constructs. Indeed, I supply my students with an SQL syntax dictionary during exams as the syntax is not the focus of the exam usually.
©Copyright 2006.