ISBL: A Database That Might Have Been

Ever heard of ISBL?

You’d be forgiven if you hadn’t. Wikipedia devotes only a single sentence to it, and you’re unlikely to find it mentioned in any database textbook. It’s a relational database language that was developed during the 1970s at IBM’s UK Scientific Centre, around about the time that SQL was being spawned in IBMs US labs.

ISBL never took off, whilst SQL became ubiquitous. This is a shame, because ISBL was an elegant system that used only six query operators, and was firmly based on Codd’s relational model; conversely, SQL was a mixed up mess of inconsistent keywords and terrible design decisions.

In today’s SQL dominated world, modern programmers may be sceptical of my opinions. Sure, SQL may have it’s quirks, but it’s not that bad a language - is it? Rather than lecture you, I’ll provide an example…

Consider the following problem: you have a school full of students, and you wish to find all subjects the students can legitimately take next year. A student may take a subject if she hasn’t taken it in a previous year, or she may retake it if she scored lower than 40% in her exams.

In SQL, I might write a query using inner and outer joins:

SELECT DISTINCT student_name, subject_name FROM records
INNER JOIN students ON students.student_id = records.student_id
RIGHT OUTER JOIN subjects ON subjects.subject_id = records.subject_id
WHERE students.student_id IS NULL OR exam_mark < 40

Contrast this to the equivalent in ISBL:

subject_choices = students * subjects
subjects_passed = choices * records : exam_mark >= 40
(subject_choices - subjects_passed) % (student_name, subject_name)

What’s this? Proper variables? Operators in the place of keywords? Sacrilege! What sort of relational database language doesn’t need huge query blocks or obscure join clauses?

In fact, ISBL makes do with only six basic operators: natural join (*), union (+), difference (-), intersection (.), projection (%) and selection (:). The natural join operator is a particular stroke of genius, as with proper naming of columns, tables slot together without the need for the clumsy ON clauses or giant WHERE clauses that litter SQL queries.

And despite a lifetime using SQL, I find that the the union, difference and intersection operators seem to produce far more readable queries than the varying types of joins in SQL.

So next time you’re creating a complex database query that ends up being over a page of Byzantine joins and sub-selects, spare a moment to curse the winds of fate that lead us to a world dominated by SQL, rather than a derivative of that long forgotten query language: ISBL.