It's always a good practice to design with paper and a pencil before starting to program. If you do, you'll find that your code is much better because you'll contemplate scenarios that you may not see if you start programming right away, and, instead of hacking your way around what you have already programmed, you'll be able to design solutions beforehand. It's an easy investment that very often pays off, so that's what we will do in this section, we will design our data.
Designing our data tables
The basic variables
Let's start from the most simple scenario we can imagine and try to find any potential problems we may encounter. For each sale, we would like to have the following variables...