https://github.com/dino65-dev/aisql-ai-powered-sql-query-generator
AiSQL: AI-Powered SQL Query Generator
https://github.com/dino65-dev/aisql-ai-powered-sql-query-generator
Last synced: about 1 year ago
JSON representation
AiSQL: AI-Powered SQL Query Generator
- Host: GitHub
- URL: https://github.com/dino65-dev/aisql-ai-powered-sql-query-generator
- Owner: dino65-dev
- License: mit
- Created: 2024-12-04T09:03:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-04T09:13:46.000Z (over 1 year ago)
- Last Synced: 2025-04-05T11:16:47.496Z (over 1 year ago)
- Language: Python
- Homepage: https://huggingface.co/spaces/spedrox-sac/AI_SQL_query
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AiSQL: AI-Powered SQL Query Generator
## AiSQL is a Streamlit-based application that leverages an AI model to convert natural language queries into SQL queries. It allows users to upload a CSV file, generate SQL queries based on the data, and execute those queries to retrieve results. The application also provides SQL query suggestions based on the uploaded data.
## Features
**Upload CSV File: Users can upload a CSV file to analyze.**
**Natural Language to SQL: Convert natural language queries into SQL queries using an AI model.**
**Execute SQL Queries: Run the generated SQL queries on the uploaded data and display the results.**
**SQL Query Suggestions: Generate and display SQL query suggestions based on the uploaded data.**
## Requirements
```bash
pip install -r requirements.txt
```
**Create a ```.env``` File:**
In the root directory of your project, create a file named ```.env```.
Add your Hugging Face API token to the ```.env``` file.
## Usage
```bash
streamlit run app.py
```
- **Upload a CSV File:**
Click on the "Upload a CSV file" button and select your CSV file.
The uploaded data will be displayed in a table format.
- **Run a Natural Language Query:**
Enter your query in plain English in the text area provided.
Click on the "Run Query/Code" button.
The application will generate an SQL query, execute it, and display the results.
- **Show Query Suggestions:**
Click on the "Show Query Suggestions" button.
The application will generate and display 5 SQL query suggestions based on the uploaded data.
- **Execute a Suggested Query:**
Select a query from the dropdown.
Click on the "Execute Selected Query" button.
The application will execute the selected query and display the results.