how to connect to database in python and run a select statement code example Example: python retrieves records after db select query cursor.fetchall()