Database functions for departments added.