icon icon

Python + SQL – data operations and ORM (SQLAlchemy)

icon

Training process

Training needs analysis

If you have specific requirements regarding the training programme, we will carry out a training needs analysis for you. This will guide us on which aspects of the programme should receive greater emphasis, so that the training programme meets your specific needs.

What will you gain?

icon

Connect Python to PostgreSQL - You will learn how to configure a Python application to connect with PostgreSQL on your own, so you can start working with data smoothly in analytics workflows and backend projects.

icon

Run queries with psycopg - You will practice executing SQL from Python with psycopg, working with cursors, handling transactions, and catching errors, so your database code becomes safer and more reliable.

icon

Work with pandas and SQL - You will learn how to load data into DataFrames and write it back to the database after transformations, which will help you build practical reporting and data preparation workflows.

icon

Understand ORM in practice - You will see how SQLAlchemy and ORM work in real use, so you can replace manual table operations with clear class models that are easier to extend and maintain in larger projects.

icon

Model your data structure - You will learn to define models and map classes to tables, helping you organize application data more clearly and prepare a database structure for real business use cases faster.

icon

Master CRUD and filtering - You will practice inserting, reading, updating, and deleting records, along with building more advanced queries, so you can handle common data operations confidently in your application.

icon

Control schema changes - You will learn how to create and drop tables, update the schema, and approach migrations, which will help you evolve a database more safely as your application code changes over time.

icon

Improve safety and performance - You will learn best practices for connection handling, query parameterization, code organization, and optimization, helping you avoid common mistakes and improve solution stability.

Training programme

1. Introduction to working with a database in Python

  • client–database architecture,
  • overview of tools (psycopg, SQLAlchemy),
  • configuration of the connection to the PostgreSQL database.

2. psycopg library

  • establishing a connection to the database,
  • executing SQL queries,
  • cursor handling,
  • transactions (commit, rollback),
  • error handling.

3. Working with data and pandas

  • retrieving data into pd.DataFrame,
  • saving data from DataFrame to the database,
  • data transformations before saving,
  • efficient work with larger data sets.

4. SQLAlchemy – introduction to ORM

  • the ORM concept,
  • SQLAlchemy configuration,
  • defining data models,
  • mapping classes to tables.

5. Database structure management

  • creating tables,
  • deleting tables,
  • schema update,
  • migrations (introduction).

6. Operations on data (CRUD)

  • INSERT – adding records,
  • SELECT – retrieving data,
  • UPDATE – updating records,
  • DELETE – deleting data,
  • filtering and complex queries.

7. Best practices for working with a database

  • connection management,
  • security (query parameterization),
  • code organization,
  • performance and query optimization.

What are the prerequisites for participating in the training?

icon

Basic Python skills - You should be comfortable with variables, conditionals, loops, functions, and imports, so you can focus on database work instead of spending time on Python basics.

icon

Basic SQL knowledge - You should know core SQL statements such as SELECT, INSERT, UPDATE, and DELETE, because during the training you will execute and analyze database queries.

icon

Terminal and packages - You should know how to run Python scripts and install libraries with pip, so you can prepare your environment smoothly for exercises and hands-on work with the tools.

icon

Understanding tables and data - You should understand what tables, records, and columns are, so moving into model mapping, CRUD operations, and conscious work with database structures is much easier.