Frankly, when you put it that way, the answer has to be “you don’t”.
Yes, there are lots of threads on these forums full of people asking “how do I make queries from my Ionic app to a MySQL database?”. There are probably many blog posts out there addressing the same topic. Please, don’t go searching for them. There are two enormous reasons why this is a bad idea.
One is structural. The term “spaghetti code” describes designs that blur the lines of responsibility between parts of a program. I prefer the term “house of cards”. As anybody who has ever tried to build one knows, the larger they get, the more apt to fall over they become. It’s really hard to know where one can safely add new cards. Somebody opens a door, there is even a small gust of wind, and down goes the whole thing. When you connect your frontend interface directly to a database, you create a house of cards.
The other reason is security. Obviously, you don’t want any rando with a copy of your app binary to be able to futz around in the internals of your database. However, that’s what you end up opening yourself to when you embed the necessary access credentials into an Ionic app.
Your best option is to create a middleware server process that interacts with the Ionic app via HTTP and with the database in a secure environment. This is the architecture described in the Tour of Heroes. The MySQL joins happen in the middleware, which is completely isolated from the Ionic app. The Ionic app only deals with sending and receiving JSON to REST endpoints on the server.