Working with QtSql

Understand how we use and integrate the QtSql module with PyQt.

Creating the application

We're going to see how to utilize QSqlQuery in this first example to build a small database that we can access using the account management GUI. There are two tables in the database: accounts and nations. The country_id field in accounts and the ID field in nations serve as the connections between the two tables.

Firstly, we start by importing the modules required for our application.

Get hands-on with 1200+ tech skills courses.