Updated SQL references to reference nonlocal db