Altered SQL tables to represent more general application of pwapi