Building a Student Management System using Python,
SQLite, and Gradio
3 min read · Mar 11, 2026
Muhammad Fawad Ali Follow
Introduction
A Student Management System is a basic application used to manage student records such as name, age,
course, and marks. In this project, we will build a simple and user-friendly Student Management System
using Python.
The system will store data in a SQLite database and provide a graphical web interface using Gradio. This
allows users to add, view, search, update, and delete student records easily through a browser.
Get Muhammad Fawad Ali’s stories in your inbox
Join Medium for free to get updates from this writer.
Enter your email
Remember me for faster sign in
This project is ideal for beginners who want to learn database integration and simple web interfaces in
Python.
Technologies Used
1. Python
Python is a powerful and beginner-friendly programming language widely used for automation, web
development, data science, and software development.
2. SQLite
SQLite is a lightweight database that stores data in a single file. It does not require a server, making it
perfect for small applications.
3. Gradio
Gradio is a Python library that allows developers to quickly create web interfaces for applications. It is
widely used for building demos and simple tools.
Project Features
The Student Management System includes the following features:
Add a new student
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
View all students
Search for a student by ID
Update student marks
Delete a student record
Simple and clean web interface
Step 1: Install Required Library
Before running the project, install Gradio using pip.
pip install gradio
Step 2: Python Code for the Student Management System
Below is the complete Python code that creates the database and the web interface.
import sqlite3
import gradio as gr
# Database connection
conn = [Link]("[Link]", check_same_thread=False)
cursor = [Link]()
# Create table
[Link]("""
CREATE TABLE IF NOT EXISTS students(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
age INTEGER,
course TEXT,
marks INTEGER
)
""")
[Link]()
# Add student
def add_student(name, age, course, marks):
[Link](
"INSERT INTO students (name,age,course,marks) VALUES (?,?,?,?)",
(name, age, course, marks)
)
[Link]()
return "Student Added Successfully"
# View students
def view_students():
[Link]("SELECT * FROM students")
data = [Link]()
return data
# Search student
def search_student(sid):
[Link]("SELECT * FROM students WHERE id=?", (sid,))
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
data = [Link]()
if data:
return [data]
else:
return []
# Update student marks
def update_student(sid, marks):
[Link]("UPDATE students SET marks=? WHERE id=?", (marks, sid))
[Link]()
return "Student Updated Successfully"
# Delete student
def delete_student(sid):
[Link]("DELETE FROM students WHERE id=?", (sid,))
[Link]()
return "Student Deleted Successfully"
# Gradio interface
with [Link]() as app:
[Link]("# Student Management System")
with [Link]("Add Student"):
name = [Link](label="Name")
age = [Link](label="Age")
course = [Link](label="Course")
marks = [Link](label="Marks")
add_btn = [Link]("Add Student")
add_output = [Link]()
add_btn.click(add_student, inputs=[name, age, course, marks], outputs=add_output)
with [Link]("View Students"):
view_btn = [Link]("Show Students")
table = [Link](headers=["ID","Name","Age","Course","Marks"])
view_btn.click(view_students, outputs=table)
with [Link]("Search Student"):
sid_search = [Link](label="Student ID")
search_btn = [Link]("Search")
search_table = [Link](headers=["ID","Name","Age","Course","Marks"])
search_btn.click(search_student, inputs=sid_search, outputs=search_table)
with [Link]("Update Marks"):
sid_update = [Link](label="Student ID")
new_marks = [Link](label="New Marks")
update_btn = [Link]("Update")
update_output = [Link]()
update_btn.click(update_student, inputs=[sid_update, new_marks], outputs=update_output)
with [Link]("Delete Student"):
sid_delete = [Link](label="Student ID")
delete_btn = [Link]("Delete")
delete_output = [Link]()
delete_btn.click(delete_student, inputs=sid_delete, outputs=delete_output)
[Link]()
Step 3: Run the Application
Save the file as:
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
[Link]
Then run the program:
python [Link]
After running the code, a local web interface will open in your browser where you can manage student
records.
How the System Works
1. The application creates a SQLite database file called [Link].
2. Student information is stored in a table named students.
3. Each function performs a specific database operation such as insert, update, or delete.
4. The Gradio interface provides a simple web interface with tabs for each operation.
Advantages of This Project
Easy to understand for beginners
No complex web frameworks required
Lightweight database
Clean graphical interface
Easy to expand with more features
Sqlite
Written by Muhammad Fawad Ali
7 followers · 22 following
No responses yet
Write a response
What are your thoughts?
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
More from Muhammad Fawad Ali
Muhammad Fawad Ali
How to Return HTML in FastAPI (2 Simple Methods)
Mar 1
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Muhammad Fawad Ali
CRUD Operations (POST, GET, PUT, DELETE) in FastAPI — Simple and Easy Guide
Mar 1
Muhammad Fawad Ali
Mastering Scroll Animations with GSAP + ScrollTrigger
Mar 4
Muhammad Fawad Ali
Why Pydantic Is Important in Production-Grade Python Applications
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
Feb 21 3
See all from Muhammad Fawad Ali
Recommended from Medium
Jacob Bennett
The 5 paid subscriptions I actually use in 2026 as a Staff Software Engineer
Jan 19 4.2K 100
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
In Level Up Coding by Christian Bernecker
Building an AI Agent from Scratch with pure Python
Feb 16 1K 8
Andy McDonald
3 Python Charts You’re Probably Not Using (But Should Be)
Feb 21 408 6
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
In Women in Technology by Alina Kovtun ✨
Stop Memorizing Design Patterns: Use This Decision Tree Instead
Jan 29 6.5K 59
In Stackademic by HabibWahid
Junior Devs Use try-catch Everywhere. Senior Devs Use These 4 Exception Handling
Patterns
Feb 1 1.7K 35
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
In AI Software Engineer by Joe Njenga
Anthropic Just Released Claude Code Course (And I Earned My Certificate)
Jan 21 3.9K 60
See more recommendations
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF