Approaches to construct mysql query from multiple databases hosted in different servers

Hi All,

One of my project has micro service architecture where each service has its own database as per below example. Now, I need to form a sql query via OpenAI for below user prompt “Retrieve customer information and order details for customers who have placed orders.”. Could you please let us know your thoughts to construct mysql query from multiple databases hosted in different servers.

for example:

Microservice 1:
Host: db1.example.com
Port: 3306
Username: user1
Password: [password1]
Database Name: database1

Table in Microservice 1:
Table 1: Customers
Columns: CustomerID, FirstName, LastName

Microservice 2:
Host: db2.example.com
Port: 3306
Username: user2
Password: password2
Database Name: database2

Table in Microservice 2:
Table 2: Orders
Columns: OrderID, CustomerID, ProductID, OrderDate, Quantity

Hi and welcome to the Developer Forum!

Are you trying to ask this question to ChatGPT?

Actually I couldn’t get better answer from ChatGPT . So, tried to check with the developer community.

Greetings, did you ever find a solution to this? Thanks!