rename pages table to tpage, remove table constant
improve SQL whitespace