In TNG episode The Offspring Data has created his child Lal. My question is could he have a child with another android or human by having sex? Does he even have the baby making body part?
Data is an android. While we know he's anatomically correct (and fully functional) as a male, he does not have any biological parts to make the necessary stuff for babies, which is something of a major plot point in Star Trek: First Contact, when the Borg Queen gives Data a real patch of skin (something that Data clearly wants). Had she continued, it's entirely possible he could have been given biological testicles, but he "kills" her, which probably means he didn't want her help (nor would she offer it again)
Data created Lal by building her. He tried to recreate his own positron matrix, but failed.
The idea to create Lal came when Data attended a cybernetics conference, where he learned of a newly-developed submicron matrix transfer technology. Using his own positronic brain as a template, Data thereby programmed the brain of the android that would ultimately be known as Lal. His initial tests proved successful, leading him to continue his project.