database UI code