adding sql functionality