Sobes.tech

sobes.tech AI

Answer from AI

In my Python projects, I have worked with several database management systems (DBMS):

  • PostgreSQL — used for storing structured data, interacted through the psycopg2 library and SQLAlchemy ORM.
  • MySQL — applied in web applications, connected via PyMySQL or MySQL Connector.
  • SQLite — used for lightweight local applications and testing, thanks to built-in support in Python through the sqlite3 module.

Example of connecting to PostgreSQL using psycopg2:

import psycopg2

conn = psycopg2.connect(
    dbname="mydb",
    user="user",
    password="password",
    host="localhost"
)

cursor = conn.cursor()
cursor.execute('SELECT * FROM users')
rows = cursor.fetchall()
for row in rows:
    print(row)

conn.close()