updated calculator sql