Finishing assignment 5

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