TSQL hw task 8, task 10 - user aggregate function