Turn plain English questions into database answers — no SQL knowledge required!
NL2SQL is a web application that allows users to ask questions in plain English about their SQLite databases. The app automatically:
- Converts your question into a SQL query.
- Executes the query on your database.
- Shows the results in an interactive table.
- Lets you download results as a CSV file.
Perfect for anyone who wants to query databases without writing a single line of SQL.
- Natural Language Queries: Ask questions like “Show top 5 students by GPA in 2023.”
- Automatic SQL Generation: Uses AI (Google Gemini) to write SQL for you.
- Database Schema Display: See all tables and columns in your database.
- Raw Schema Option: For advanced users, view the database structure (DDL statements).
- Results Table & Download: View query results and download them as CSV.
- Automatic AI Model Selection: Uses the best available Gemini AI model automatically.
- Open the app in your browser.
- Upload your SQLite
.db
file. - Browse your database tables and columns (optional).
- Type your question in plain English.
- Click Generate SQL.
- View the generated SQL and query results.
- Download the results as a CSV if needed.
- Currently supports SQLite databases (.db).
- Save time and avoid manual SQL coding.
- Perfect for managers, analysts, or anyone who needs database insights quickly.
- Works instantly in the browser — no installation required.
Try it now: https://naturallanguage2sequelite.streamlit.app
This section is optional for clients; mostly relevant for technical users.
- Clone the repository:
git clone https://github.com/guptakushal03/NaturalLanguage2SQLite.git
cd NaturalLanguage2SQLite
- Install dependencies:
pip install -r requirements.txt
- Configure your Gemini API key:
Create
.streamlit/secrets.toml
and add:
GEMINI_API_KEY="your_api_key_here"
- Run the app locally:
streamlit run app.py
Kushal Gupta
- Email: guptakushal2003@gmail.com
- Portfolio: guptakushal03.github.io/TechFolio