Relational Database Planning: Tips and Code