I know it’s confusing, but for tunneling, you need to deploy an actual app to the space where your database is located and you are tunneling to that app via the cf command (I know it makes no sense, why you need an app there, but as far as I know there is no other way):
cf ssh -L localhost:<localport>:<remotehost-ip:<remoteport> <app-name> -N
Also, don’t forget to call cf enable-ssh <app-name> (one time) for the app you will use for the tunnel.
If you want to get more insights into SQL, check out this SQL Course from Intellipaat.