added/changed sql for potpourri