Connect to postgres over ssh and run query

Hi. Is it possible to connect to Postgres in one step in my workflow and run query like "create DATABASE "?

I can’t find any solution in the internet. I found only how to create a tunnel to the database.