Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Python to PostgreSQL

(The script demonstrates how to create a table, insert records, update records, delete records, and select records from a PostgreSQL database using Python)

  • This script demonstrates connects to a PostgreSQL database using Python
  • The script creates a table called employee and inserts some records into the table
  • It then updates the salary of all employees by 50% and deletes the record of an employee named James
  • Finally, it selects all records from the employee table and prints them to the console

Requirements

(The script uses the psycopg2 library to interact with the PostgreSQL database)

  1. To run this script, you need to have a PostgreSQL database set up on your local machine
  2. You also need to install the psycopg2 library using pip install psycopg2
  3. Make sure to replace the connection details (hostname, database, username, password, port_id) with your own database details

About

A python program which will use the Psycopg2 module to connect to the PostgreSQL database and then perform some database or SQL transactions.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages