One of my brothers works at a publisher of training books. Around 2013 they needed a series of technical books for some vocational certificates that were about to be taught. He suggested I write one of them and I said yes. In fact, my brother-in-law wrote one too.
Out of the books they needed, I chose the one about databases. I could have picked several. Looking back, I think I could have done at least two, but I was working at the time and didn’t know how much time it would take.
The publisher gave me the table of contents and I worked on my own for several months. The point was to explain the concepts, but the database management system used is MySQL. The book has a couple of sections on XML and other topics that were already outdated when I was writing it, and I had to study them specifically. I think the rest of the content on database design and queries is still useful today.
After writing most of the book came a review phase where I had to add many more examples, images and exercises. It seemed they needed a certain number of exercises every X pages, whether they made sense or not. There was also a language review and a technical review. In the technical review they asked me to change a couple of sections, the ones about general concepts. I don’t think they went into much detail.
They paid me €1,215 as an advance on royalties. So if the book didn’t sell, I’d already have been paid that amount. But if it sold well, it would take quite a while before I started earning anything more.
Every so often they send me sales reports, but rarely, late and badly. By my count, 1,496 copies had been sold by mid-2020. They control distribution, sales and everything else. I have no control or say over any of it.
I obviously didn’t do it for the money, but because it was a good opportunity to grow professionally. Would I do it again? Probably.

