/Natural-language-to-SQL

An application which uses streamlit interface and converts user's query into SQL query, executes it on a database, and then returns the result.

Primary LanguagePythonMIT LicenseMIT

An LLM-powered application which takes user queries related to a database -> converts the query into a SQL query -> executes the query on the db -> returns the result in text and table format✨


Features: 🪄

  1. Uses OpenAI's API to process user queries and convert it into SQL query.
  2. The application is able to extract the relevant information from the database based on the query.
  3. The list of tables in the database is available on the top in the Streamlit interface. You can use this list to query relevant information.

Setup: 🧰

  1. Clone this repository:
git clone https://github.com/Aaryan015/Natural-language-to-SQL.git
  1. Install the necessary libraries:
pip install streamlit openai pandas python-dotenv
  1. Create a .env file and place the API key in it.
  2. Place a sample database file (.db) in the same directory.
  3. Run the application:
python -m streamlit run app.py
  1. Input your query.