Added problem 5 in T-SQL