I recently built a small project that lets you query a university student database using natural language instead of SQL.
What it Does
You can type queries like:
Show all students in Data Science
The app uses a large language model (LLaMA 3 via Groq) to convert your plain-English query into SQL, runs it on a local SQLite database, and shows the results in a simple web UI built with Streamlit.
Why Build This?
I wanted to explore how language models can make databases more accessible for people without SQL knowledge. This also gave me hands-on experience integrating LLMs with backend databases and building a full-stack app.
Tech Stack
- Python
- Streamlit for the UI
- LangChain for prompt management
- Groq API for fast LLaMA 3 inference
- SQLite for the database
How It Works
- User enters a natural language query in the UI
- LangChain structures a prompt for the LLM
- Groq’s LLaMA 3 model generates SQL from the query
- SQLite executes the SQL query
- Results display in the web interface
Check It Out
You can find the full source code here:
https://github.com/Hassan123j/Natural-Language-to-SQL-University-Student-Data-Query-App
Feedback and contributions are welcome!
Top comments (0)