There has been a demand for a pharmaceutical composition which is used for a prophylactic and/or therapeutic agent for various diseases associated with PDE10 (for example, mental disorder, neurodegenerative disorder and the like). The present invention provides: a compound having a PDE10 inhibitory effect, in particular, a compound which is represented by formula (I) and is characterized by having a 4-heteroarylpyrazole-5-carboxylic acid amide structure, a pharmaceutically acceptable salt thereof, and a solvate of the compound or the salt; a pharmaceutical composition which is characterized by containing, as an active ingredient, the compound, a pharmaceutically acceptable salt of the compound, or a solvate of the compound or the salt; and a pharmaceutical use of the compound, a pharmaceutically acceptable salt of the compound, or a solvate of the compound or the salt.