added adv SQL