Explore the database options for powering your Python apps. Learn how to create and connect to different types of databases, including SQLite, MySQL, and PostgreSQL.
Overview
Syllabus
Introduction
- Using databases to level up your Python applications
- What you need to know
- What is a database?
- Relational databases
- Non-relational databases
- Python Database API
- What is SQLite?
- Creating an SQLite database
- Manipulating records in a SQLite database
- What is SQLAlchemy?
- Setting up a virtual environment for SQLAlchemy
- Using SQLAlchemy Core with an SQLite database
- Challenge: Create an SQLite database
- Solution: Create an SQLite database
- What is MySQL?
- Creating a MySQL database
- Building tables in a MySQL database
- Connecting a Python application to a MySQL database
- Encaspulating database operations to make better applications
- Developing Pythonic applications with SQLAlchemy ORM
- Using SQLAlchemy Sessions to transact on a MySQL database
- Using SQL to import CSV data
- Leveraging SQLAlchemy and pandas to import CSV data
- Challenge: Create a MySQL database
- Solution: Create a MySQL database
- What is PostgreSQL?
- Creating a PostgreSQL database
- Creating a table in Postgres using Python
- Inserting data into a Postgres database
- Interacting with a Postgres database using Python
- Pythonic Postgres interactions with SQLAlchemy Core
- Pythonic Postgres interactions with SQLAlchemy ORM
- Grouping SQL statements with stored procedures
- Creating a stored procedure in PostgreSQL
- Using Postgres stored procedures and functions in Python
- Challenge: Create a Postgres database
- Solution: Create a Postgres database
- Setting up Flask in a Python application
- Creating a webpage with Flask
- Developing additional routes to enhance your application
- Instantiating a Postgres database using Python
- Connecting a database to a Pythonic Flask project
- Feeding data from a database into a Flask application
- Develop add functionality to a Flask application
- Challenge: Develop delete functionality
- Solution: Develop delete functionality
- Introduction to pandas
- Setting up pandas and Jupyter Notebook
- Analyzing data with pandas
- Integrating SQLAlchemy with pandas
- Next steps
Taught by
Kathryn Hodge