What do the middle digits of course codes represent?
I suspect it really depends on the university. But in my university, it represents the subfield in the department within which the course is offered.

For example (I'm in electrical engineering), EE X1X might be courses on power systems engineering, EE X2X on communication networks, EE X3X on  signal processing, EE X4X on electronics...

But in my department at least, there are enough misnumbered courses (for "historical reasons") to confound anyone who doesn't know it and is looking for a pattern.