Finished Database Code.