A detective is a person who solves crime, investigates and spies for living. They work for police or are hired by a private person or company. A detective that is hired by a person and company is called a private investigator. Some famous fictional (not real) detectives are Sherlock Holmes, Inspector Clouseau, Nancy Drew, The Hardy Boys.
Detectives will search public and private databases, investigate people and examine evidence in order to solve the case.