Manipulating Data with Python
So far, all the SQL statements and commands in this book have been executed through the client tools provided by PostgreSQL, either pgAdmin or psql. The user types the statements into the client tools, the tools forward the statements to the Database Management System (DBMS), the DBMS executes the statements and passes the result back to the tools, and the tools either display the data on the screen or save it as a file for further analytics.
While pgAdmin and psql offer a breadth of functionalities, many data scientists and data analysts are starting to use Python as a helpful client tool, too. Python is a high-level language that can be easily used to process data. Just like pgAdmin and psql, companies can use Python to connect to the database, execute SQL statements for different stages of the CRUD lifecycle process, and get results back. In this usage scenario, Python serves a similar role to psql, in that it carries the SQL to the database from...