Star Trek: The Next Generation, season 2, episode 3
Elementary, Dear Data
Summary
After Lt. Commander Data (Brent Spiner) easily solves an ordinary Sherlock Holmes holodeck mystery, La Forge asks the computer to make a Holmes villain capable of defeating him. The resultant Professor Moriarty (Daniel Davis) soon becomes far more powerful than expected.
Summary from Wikipedia, CC BY-SA 4.0.
Find out more
These links open the services in a new tab with the question pre-filled; the AI assistants may ask you to sign in. Their answers can contain errors.