The tables seem to only state the level of the spell and the caster level so I'm guessing the GM picks the actual spell based on those results?
Magic item availability is not specified by the rules, it is left entirely up to the GM. However you can draw at least some level of guidance from the Ultimate Equipment treasure generation rules, which make the distinction between common and uncommon scrolls/potions and give their probabilities. You could even use the treasure generation rules there to randomly generate a shop's contents.
There's an online generator using the rules in Ultimate Equipment here, but it is intended for determining the treasure for defeating certain types of monsters, not filling out shops. Still, you might find some combination of inputs that gives you good results.
Full disclosure: I am the creator of the online generator.