wonderakwei / PostgreSQL-Database-Management-with-Python-and-Psycopg2

This project explores the various functionalities related to PostgreSQL database management using Python and Psycopg2. The objective is to understand how to interact with a PostgreSQL database using Python scripts and Psycopg2 library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


PostgreSQL Database Management with Python and Psycopg2

Overview

This project involves managing a PostgreSQL database using Python and the Psycopg2 library. The project includes functionalities such as creating tables, inserting data, querying the database, executing stored procedures, and more.

Table of Contents

Features

  • Database Connection: Establish a connection to a PostgreSQL database using Psycopg2.
  • Table Management: Create, delete, and manage database tables.
  • Data Operations: Insert, update, delete, and query data in the database.
  • Stored Procedures: Execute PostgreSQL stored procedures and functions from Python.
  • Error Handling: Robust error handling and logging mechanisms.

Requirements

  • Python (version = 3.11)
  • PostgreSQL Database
  • Psycopg2 Library

Setup and Installation

  1. Clone the Repository:

    git clone https://github.com/wonderakwei/PostgreSQL-Database-Management-with-Python-and-Psycopg2.git
  2. Navigate to the Project Directory:

    cd PostgreSQL-Database-Management-with-Python-and-Psycopg2

SQLShell Commands

  • List All Databases:

    \list
  • Change Directory / Database:

    \c schdbm
  • Display Tables in the Database:

    \dt
  • Display Table Content:

    SELECT * FROM students;

Tools

  • Python
  • PostgreSQL
  • SQLShell
  • Git
  • PowerShell

About

This project explores the various functionalities related to PostgreSQL database management using Python and Psycopg2. The objective is to understand how to interact with a PostgreSQL database using Python scripts and Psycopg2 library.


Languages

Language:Jupyter Notebook 98.9%Language:PLpgSQL 1.1%