# Text-to-SQL or Text-to-Dataframe

**URL:** <https://community.openai.com/t/text-to-sql-or-text-to-dataframe/884405>\
**Category:** Community\
**Tags:** gpt-4\
**Created:** [July 28, 2024, 2:07pm UTC](https://community.openai.com/t/text-to-sql-or-text-to-dataframe/884405 "2024-07-28T14:07:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fa0900467](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/fa0900467/32/432297_2.png) [@fa0900467](https://community.openai.com/u/fa0900467)\
**Post date:** [July 28, 2024, 2:07pm UTC](https://community.openai.com/t/text-to-sql-or-text-to-dataframe/884405/1 "2024-07-28T14:07:58Z")

</div>

Ok so, I’m making a Text-to-SQL or Text-to-Dataframe application, I used RAG+prompting and all that stuff at first for this at first but the answers were mostly wrong numbers. So then I moved towards Agentic RAG approach.  
I have two questions:

1. What are best approaches to create this application which accurate in terms of NL to SQL and in terms of accurately getting the numbers right from Data.
2. I am trying Function Calling method from OpenAI, It is working well right because there are only few functions. Question is, do I have to create functions for every possible scenario or there is more generic approach towards this?
