Elementary, Dear Data
|"Elementary, Dear Data"|
|Star Trek: The Next Generation episode|
|Directed by||Rob Bowman|
|Written by||Brian Alan Lane|
|Featured music||Dennis McCarthy|
|Cinematography by||Edward R. Brown|
|Original air date||December 5, 1988|
"Elementary, Dear Data" is the third episode of the second season of the American science fiction television series Star Trek: The Next Generation, the 29th episode overall. It was written by Brian Alan Lane and directed by Rob Bowman. It was originally released on December 5, 1988 in broadcast syndication.
Set in the 24th century, the series follows the adventures of the crew of the Federation starship Enterprise. In this episode, a holographic adversary manages to take control of the Enterprise. The plot line from this episode was continued in the sixth season episode "Ship in a Bottle".
In 1989, "Elementary, Dear Data" was Nominated for two Emmy Awards: Outstanding Art Direction for a Series, Richard D. James, Art Director; Jim Mees, Set Decorator and Outstanding Costume Design for a Series, Durinda Wood, Costume Designer; William Ware Theiss, Starfleet Uniforms Creator. 
As the Federation starship Enterprise, under the command of Captain Jean-Luc Picard, waits to rendezvous with the USS Victory, Chief Engineer La Forge and Commander Data go to the Holodeck to recreate a Sherlock Holmes mystery. Data, who has read all of the Holmes stories, recognizes and solves the mystery within minutes. Frustrated, Geordi storms out of the holodeck, leaving Data confused. In Ten Forward, Geordi explains that the fun is in solving the unknown; Data does not understand. Overhearing their conversation, Chief Medical Officer Dr. Pulaski asserts that Data is incapable of solving a mystery to which he does not already know the outcome. Data accepts Dr. Pulaski's challenge and invites her to join them on the Holodeck. There, Geordi instructs the computer to create a unique Sherlock Holmes mystery with an adversary who is capable of defeating Data.
In the new program, Dr. Pulaski is kidnapped, and Data investigates. They soon discover that Professor Moriarty is responsible, but when they find him with Pulaski in his hideout, they are shocked when they learn that Moriarty is aware of the Holodeck program being a simulation, and is able to access the Holodeck computer, showing them a sketch of the Enterprise he has drawn based on the computer's description. Data and Geordi leave the Holodeck to alert the Captain, and Geordi realizes that when he asked the computer to create the program he had asked for an adversary who could defeat Data, not Sherlock Holmes; as a result, the computer gave the Holodeck character Professor Moriarty the knowledge and sentience needed to challenge Data. When Moriarty gains access to the ship's stabilizer controls, Data returns to the Holodeck with Captain Picard.
Picard meets Moriarty, who demonstrates that he has evolved beyond his original programming and asks to continue to exist in the real world. Picard tells Moriarty that this would not be possible; instead, he saves the program and tells Moriarty that if they ever discover a way to convert Holodeck matter into a permanent form they will bring him back. Picard discontinues the program and the USS Victory arrives.
Story and script
According to Co-executive producer Maurice Hurley, the idea for this episode was inspired by Data's experiences in "The Big Goodbye". Hurley stated, "It wasn't a writer saying, 'Let's do this.' It was one of the people living on the Enterprise."
This episode contains elements from and references to the Sherlock Holmes short stories A Scandal in Bohemia, The Red-Headed League, The Adventure of the Speckled Band, and The Adventure of the Bruce-Partington Plans, as well as the Holmes novel The Valley of Fear. Furthermore, Moriarty's creation being a result of Geordi La Forge requesting an opponent capable of defeating Data references Arthur Conan Doyle's creation of the same character for the short story The Final Problem – specifically, as an opponent capable of defeating Sherlock Holmes who, at the time, Doyle wanted to kill off.
Reportedly, the original ending had Jean-Luc Picard lying to Moriarty, that he could have existed outside the holodeck, the same way the piece of paper on which he drew the Enterprise also stayed intact outside the holodeck. Co-executive producer Maurice Hurley wanted to keep that ending, as it made Picard look clever, but Gene Roddenberry nixed it, saying it made Picard look cruel. Instead, the paper stays intact without any explanation. 
Daniel Davis as James Moriarty. Daniel Davis used an English accent for this role in both episodes; however, he is from Arkansas and speaks with an American accent when not in character. Davis was auditioning for the role of Moriarty alongside another actor in the room Brian Bedford directly in front of director Rob Bowman. Davis said of being in the room with Brian Bedford, "So he’s the standout in my mind, and we were sort of taking bets with each other about which of us would get it. We hadn’t worked together or seen each other in a long time. So it was a very friendly rivalry. Then, when I got it, he was a very good sport and invited me to come to dinner to celebrate that I had gotten the part." 
Anne Elizabeth Ramsay as Ensign Clancy. Making her first Star Trek: The Next Generation appearance as Ensign Clancy. The actress reprised the role in “The Emissary,” also in season two. Ramsay went on to a busy career as an actress. She co-starred as Lisa Stemple, the dysfunctional sister of Helen Hunt’s character, in 123 episodes of Mad About You, for which she shared a Screen Actors Guild Award nomination. Ramsay also played a recurring role on Six Feet Under and Dexter. 
- "28-years-later-its-still-elementary-dear-data". www.startrek.com. Archived from the original on 5 December 2016. Retrieved 4 January 2018.
- "rewatch-qelementary-dear-data". www.tor.com. Archived from the original on 18 August 2011. Retrieved 4 January 2018.
- "interview-treks-moriarty-daniel-davis". www.startrek.com. Archived from the original on 25 June 2014. Retrieved 4 January 2018.