Revised Books Available

Big Announcement: the 2024.8 version of Unlearning SQL, and the 2024.9 version of Pivot to Python are available from booksellers online. Both are revised and all the code tested with Python 3.12.

Unlearning SQL

This book shows you how to translate essential SQL concepts into the Python …

more ...


DBLock Context Manager

Consider, for a moment, the shelve and dbm packages for storing things in a “database.” Built-in. Lightweight. The database is essentially a mapping from identifiers to objects. It can be quite nice.

The shelve module directly puts Python objects in a file. It’s an ideal database structure for Python …

more ...

The Schema Evolution Problem

Fundamentally, we need to provide explicit version identification on a schema. This is technically easy, but organizationally nearly impossible.

Technically, we need to use some kind of version control software for our model and the resulting DDL. We need some meta-meta-data to track schema names and version numbers. If we …

more ...


Denormalization or "What did you mean by that?"

I use the word denormalization heavily, to make a point to a certain class of developers. Other developers object to the term, since it doesn't have a precise meaning.

The point I often have to make this:

  1. 3rd Normal Form is for Updates.
  2. Data Warehousing is about Insert and Select …
more ...

Genius Move -- Characteristic Functions

The comment was eaten by Haloscan, but here's the text...

You need to read Rozhenstein on characteristic functions.

select
sum(case when a < .5 then 1 else 0 end) 'A'
,sum(case when a >= .5 and a < .75 then 1 else 0 end) 'B'
,sum(case when a >= .75 then …
more ...



Database Design and UML - What was the question again?

One issue in creating a database design is working around the limitations inherent in the SQL data model. I'm going to call it the SQL model because you can make the case that the entity-relationship (ER) model is an abstraction and could have a far more expressive implementation. I'm going …

more ...