Transact SQL homework

Without ex.9 and ex.10