The rapid development of telemedicine technology has brought great convenience to people’s lives. Alongside generating great convenience, protecting patients’ privacy has become increasingly important. Therefore, to solve the above problems, this paper proposes a quantum privacy query protocol based on GHZ-like states. The protocol first utilizes existing diagnostic information for classification to encode symptom attributes. Then, the correlation after measurement using GHZ-like entangled states is utilized so that the querying party can only obtain a key message with the assistance of a third party. Through the above operation, the database cannot know the address of the message queried by the querying party, and the querying party is also unable to obtain more information. The protocol not only adds decoy factor detection but also adds the process of authentication while checking for illegal eavesdropping. It makes the protocol sufficiently resistant to joint attacks, participant attacks, and external system credit attacks. This database privacy query protocol ensures that the database service is more effective and its environment is more secure.