Database relation total