Added basic SQL function