Add sql functionality