Yes! You can also instruct the LLM to constrain the generated statement with specific clauses, so that the notion of "my data" in the english query comes with implicit constraints. This can be made safe using a validation scheme, which is what HeimdaLLM[1] does. It guarantees that generated queries are only joining to allowed tables, that they have required constraints, that they only select allowable columns, and that they only execute allowed functions (and more).
The end result is that you can produce safe SQL queries on behalf of your users, allowing your users to use natural language to query their data in your database.
For example, in this demo[2], I ask it:
query("how much have i spent renting movies, broken down by month")
And it responds correctly, guaranteed to be constrained to my data.1. https://github.com/amoffat/HeimdaLLM 2. https://github.com/amoffat/HeimdaLLM/blob/dev/notebooks/demo...