On my first job at an internet provider company, they had no backend. They were using some proprietary software and SQL functions instead. One day the CEO came in and said: "Guys, we need to print a small QR code on mails to customers. ". The team lead responded: "Sure, our intern can do it."
Oh my gosh, that was a crazy task! I built a fully functional QR code generator on pure SQL from scratch! It was very fun.
Check out Wikipedia [1]. They explain how QR codes work really well. Well enough to build your own generator.
I also used ZXing code [2], that Muzani shared below here, as a reference.
[1] — https://en.wikipedia.org/wiki/QR_code
[2] — https://github.com/zxing/zxing