This Streamlit-based application allows users to query data from various sources (like MySQL or CSV files) using plain natural language. The queries are converted into SQL using OpenAI's ChatGPT LLM under the hood.
- 🔌 MySQL Database Integration: Connect to a MySQL database and automatically extract schema.
- 📂 CSV File Upload: Upload multiple CSV files and query them using natural language.
- 🧠 Table & Attribute-Level Prompting: Provide metadata or context at table and column levels to improve query accuracy.
- 🤖 LLM-Powered SQL Generation: Convert your natural language queries into SQL using OpenAI’s GPT.
- ✍️ Manual Query Support: You can write and execute your own SQL queries.
- 📊 Visual Interface: Clean and interactive UI built with Streamlit.
Provide your MySQL credentials and database details to connect.
Upload multiple CSV files and view available tables.
Add detailed descriptions to tables and attributes to help the model understand your schema.
Ask questions and get answers across multiple data sources.
- Connect to a MySQL database or upload CSV files.
- Schema is extracted and optionally enhanced with user prompts.
- Ask a natural language question (e.g., "What is the average salary by department?").
- The model generates and executes the SQL.
- Results are displayed in an interactive format.
- You can also write and run your own SQL queries.
- Clone the Repository
git clone https://github.com/your-username/Text_to_sql.git cd Text_to_sql




