We don’t specifically have a Strapi process for that but you could use the bookshelf custom query: https://strapi.io/documentation/v3.x/concepts/queries.html#bookshelf
Or you can directly use knex and run a raw SQL query like strapi.connections.default.raw('Some SQL Query Here')