Synopsis: Spaghetti Query

Let’s explore how making a single query for retrieving results in one go can create issues.

Let’s imagine the following scenario. Your boss is on the phone with their boss, and your boss waves to you to come over. They cover their phone receiver with their hand and whisper to you, “The executives are in a budget meeting, and we’re going to have our staff cut unless we can feed my VP some statistics to prove that our department keeps a lot of people busy. I need to know how many products we work on, how many developers fixed bugs, the average bugs fixed per developer, and how many of our fixed bugs were reported by customers. Right now!”

You leap to your SQL tool and start writing. You want all the answers at once, so you make one complex query, hoping to do the least duplicate work and, therefore, produce faster results.

Get hands-on with 1400+ tech skills courses.