A small Python program that connects to a database and performs CRUD operations for student records.
- List all students
- Add a new student
- Update a student's email by their id
- Delete a student record by their id
connect()— Connects to postgres server.get_all_students()— Retrieve and return all student records.add_student(first_name, last_name, email, enrollment_date)— Insert a new student.update_student_email(student_id, new_email)— Update email for a student by ID.delete_student(student_id)— Remove a student record by ID.
- Clone the repository:
git clone https://github.com/Siddigz/Student-Management-System-SMS.git - Navigate to the directory:
cd .\Student-Management-System-SMS\ - Install dependencies:
pip install -r requirements.txt
-
Prerequisites
- Python 3.8+ and pip
- PostgreSQL server running and accessible
-
Configure the database connection in app.py
DB_USER = "postgres" DB_PASS = "sql123" DB_HOST = "localhost" DB_PORT = "5432" -
Create the database and table (if not done already)
- Create the students table according to database.sql file
-
Run the application
- Start the program using:
py main.py
- Start the program using:
YouTube: https://youtu.be/9N-XBiOqaWY