to answer your question, as Michael has already written, it's not mandatory.
To Know more about this, You should understand the role played by the dependency query.
Consider an example. You want to cache the query which will list all the users. Something like SELECT * FROM users.
Assume that at any point of time, it is 100 users.
Now the main question is when do you think your cached data becomes invalid? Whenever the new user is added, you need to re-query (Not to use Cached Data/Invalidate Cache Data). How to find that new user is added? By Querying the ID Number. So if the query SELECT MAX(ID) FROM Users returns different value then it means the new user was added.
Remember If the user is deleted, then my example will not be valid. That time, after deleting the user, you should delete the Respective Cache Data.
In this way, you should find out the relevant Queries which can be used to Validate the Cache Data.