adding sql JOIN completion and corresponding unit tests