common math and aggregation sql functions