How to connect to a VPN and query the database in the VPN

I have a scenario where I have to query a DB inside a VPN and get the result .So can I do all this in my local machine .If so how can we. Or should I install studio in my vpn and do it there.