Finishing assignment 5

Added CREATE, INSERT, SET OUTPUT statements, fixed several bugs before
and ran all queries.