Share via

Using Azure OpenAI to retrieve SQL data

Janarthanan S 700 Reputation points
2023-09-13T13:35:16.8166667+00:00

Is it preferred to provide the full schema (lets say into a .sql file) to GPT model?

or instead give it instructions to search for it directly in the database which is quick to produce better results.

Azure Open Datasets
Azure Open Datasets

An Azure service that provides curated open data for machine learning workflows.

Azure OpenAI Service
Azure OpenAI Service

An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments
{count} vote

Answer accepted by question author
  1. Chakaravarthi Rangarajan Bhargavi 1,205 Reputation points MVP
    2023-09-13T15:14:47.3233333+00:00

    Hi Janarthanan,

    Great question let me get you though this, the choice between providing a full schema in a .sql file or instructing a GPT model to search directly in a database depends on various factors like security, maintenance, and performance. Providing a .sql file can enhance security and predictability but requires manual maintenance. Direct database access offers real-time data but necessitates robust security measures and may impact performance, depending on the database's complexity. The decision should align with project requirements and consider the trade-offs between convenience and security.

    If you find this answer useful kindly accept it, for assistance ping here thanks.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.