Skip to content

d-loree/Student-CRUD-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Student CRUD Applicaiton with Python

This project provides a CRUD (Create, Read, Update, Delete) application developed with Python allowing you to use the following operations:

  • Get all students (Prints all students in database)
  • Add a student (Adds student to the database)
  • Update a student's email (Update a student's email in the database using their student ID)
  • Delete a student (Delete a student from the database using their student ID)

Setup

  1. Install PostgreSQL on PC and create a database.

  2. Add the following table inside your PostgresSQL database using the SQL statement:

CREATE TABLE students (
	student_id SERIAL PRIMARY KEY,
	first_name TEXT NOT NULL,
	last_name TEXT NOT NULL,
	email TEXT NOT NULL UNIQUE,
	enrollment_date DATE NOT NULL
)
  1. Optional: Insert data for testing:
INSERT INTO students (first_name, last_name, email, enrollment_date) VALUES
('John', 'Doe', '[email protected]', '2023-09-01'),
('Jane', 'Smith', '[email protected]', '2023-09-01'),
('Jim', 'Beam', '[email protected]', '2023-09-02');
  1. Make sure Python3 is installed on your computer

  2. Install psycopg2 for PostgreSQL access with Python: 'py -m pip install psycopg2'

  3. Download 'student_crud.py' and add your PostgreSQL credentials to the 'Enter database credentials' section

  4. Run the application and manage the database: 'py student_dbms.py'

About

A simple CRUD application for a student database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages