adding peg solution for sql problem