What file contains the queries of customized views? I am trying to understand a previous theme in a website and one view shows different results from expected. Then, I want to check whether the query is being generated wrongly or not.

Are there a file in the Views module that contains the queries for my customized views?
Views settings can be exported through the Features module as custom module code. So, if the site is using Features, and the view has been previously exported, then you will find the code inside one of the module files.

In that case, you can use a command line tool like Grep to find the file which contains the view. I would search recursively for the machine name of the view inside your www folder.

If the Features module is not in use, then you can see the view code if you go to the view edit page, then click "export view" in the upper right hand drop down.