Implemented several database relations