Yes, there is a database file (MTABLE.SYS) file visible when you’re connected in MSC mode. But the ratings are not stored in that file (as far as I know).
There is no MTP ‘folder’. That is the alternate connection mode. I’m sure you can rate songs on your player, even if they were loaded in MSC mode. But as I understand it, those ratings will be lost when you re-connect to your computer and maybe add or delete some content. The ratings will only be saved if you use MTP mode.
But then, I’m only citing what I remember from reading other posts on the subject here. I don’t use the rating system; it’s a worthless feature as far as I’m concerned. I don’t put anything on my players I don’t like, so why would I want (or need) to ‘rate’ them.
My suggestion would be to use the Search function here on the forum and pour through what has already been written and discussed on the subject.