adding sql code